From b524810724fafe57316494c5720833ca2d6b14e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=AB=98=E6=9B=A6?= Date: Mon, 7 Mar 2022 21:33:27 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=B5=E8=AF=9D=E6=9C=8D=E5=8A=A1=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E7=94=A8=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 高曦 --- telephony/telephonyjstest/BUILD.gn | 7 + .../telephonyjstest/contact_function/BUILD.gn | 32 + .../contact_function/Test.json | 18 + .../entry/src/main/config.json | 93 + .../entry/src/main/ets/MainAbility/app.ets | 23 + .../src/main/ets/MainAbility/pages/Badge.ets | 95 + .../src/main/ets/MainAbility/pages/Blank.ets | 47 + .../src/main/ets/MainAbility/pages/Button.ets | 70 + .../src/main/ets/MainAbility/pages/Column.ets | 51 + .../ets/MainAbility/pages/ColumnSplit.ets | 70 + .../main/ets/MainAbility/pages/Counter.ets | 51 + .../main/ets/MainAbility/pages/DataPanel.ets | 69 + .../main/ets/MainAbility/pages/Divider.ets | 71 + .../src/main/ets/MainAbility/pages/Flex.ets | 135 + .../ets/MainAbility/pages/GridContainer.ets | 170 + .../src/main/ets/MainAbility/pages/Image.ets | 90 + .../main/ets/MainAbility/pages/Navigator.ets | 60 + .../src/main/ets/MainAbility/pages/Panel.ets | 96 + .../main/ets/MainAbility/pages/Progress.ets | 76 + .../src/main/ets/MainAbility/pages/Qrcode.ets | 44 + .../src/main/ets/MainAbility/pages/Rating.ets | 63 + .../main/ets/MainAbility/pages/RowSplit.ets | 78 + .../src/main/ets/MainAbility/pages/Scroll.ets | 200 + .../src/main/ets/MainAbility/pages/Slider.ets | 82 + .../src/main/ets/MainAbility/pages/Span.ets | 64 + .../src/main/ets/MainAbility/pages/Stack.ets | 103 + .../src/main/ets/MainAbility/pages/Text.ets | 237 + .../src/main/ets/MainAbility/pages/index.ets | 65 + .../main/ets/MainAbility/test/List.test.ets | 38 + .../src/main/ets/MainAbility/test/Utils.ets | 119 + .../MainAbility/test/contact/Calllog_test.js | 1361 ++++ .../test/contact/ContactCard_test.js | 5441 ++++++++++++++ .../test/contact/ContactClass_test.js | 310 + .../test/contact/ContacterJsunit.ets | 262 + .../MainAbility/test/contact/Contacts_test.js | 6306 +++++++++++++++++ .../MainAbility/test/contact/Groups_test.js | 574 ++ .../test/contact/ObjectInterface_test.js | 915 +++ .../test/contact/Voicemail_test.js | 1329 ++++ .../ets/MainAbility/test/contact/common.js | 726 ++ .../MainAbility/test/contact/recovery_test.js | 156 + .../main/ets/MainAbility/test/lib/Const.js | 36 + .../main/resources/base/element/string.json | 12 + .../src/main/resources/base/media/icon.png | Bin 0 -> 6790 bytes .../entry/src/main/resources/rawfile/hand.png | Bin 0 -> 976 bytes .../entry/src/main/resources/rawfile/icon.png | Bin 0 -> 6790 bytes .../src/main/resources/rawfile/images.jpg | Bin 0 -> 3377 bytes .../src/main/resources/rawfile/person.png | Bin 0 -> 1636 bytes .../src/main/resources/rawfile/star-1-1.png | Bin 0 -> 5326 bytes .../src/main/resources/rawfile/star-1-2.png | Bin 0 -> 8295 bytes .../src/main/resources/rawfile/star-1-3.png | Bin 0 -> 5545 bytes .../src/main/resources/rawfile/video/show.mp4 | 0 .../signature/openharmony_sx.p7b | Bin 0 -> 3437 bytes .../contact_function_merge/BUILD.gn | 32 + .../contact_function_merge/Test.json | 18 + .../entry/src/main/config.json | 93 + .../entry/src/main/ets/MainAbility/app.ets | 23 + .../src/main/ets/MainAbility/pages/Badge.ets | 95 + .../src/main/ets/MainAbility/pages/Blank.ets | 47 + .../src/main/ets/MainAbility/pages/Button.ets | 70 + .../src/main/ets/MainAbility/pages/Column.ets | 51 + .../ets/MainAbility/pages/ColumnSplit.ets | 70 + .../main/ets/MainAbility/pages/Counter.ets | 51 + .../main/ets/MainAbility/pages/DataPanel.ets | 69 + .../main/ets/MainAbility/pages/Divider.ets | 71 + .../src/main/ets/MainAbility/pages/Flex.ets | 135 + .../ets/MainAbility/pages/GridContainer.ets | 170 + .../src/main/ets/MainAbility/pages/Image.ets | 90 + .../main/ets/MainAbility/pages/Navigator.ets | 60 + .../src/main/ets/MainAbility/pages/Panel.ets | 96 + .../main/ets/MainAbility/pages/Progress.ets | 76 + .../src/main/ets/MainAbility/pages/Qrcode.ets | 44 + .../src/main/ets/MainAbility/pages/Rating.ets | 63 + .../main/ets/MainAbility/pages/RowSplit.ets | 78 + .../src/main/ets/MainAbility/pages/Scroll.ets | 200 + .../src/main/ets/MainAbility/pages/Slider.ets | 82 + .../src/main/ets/MainAbility/pages/Span.ets | 64 + .../src/main/ets/MainAbility/pages/Stack.ets | 103 + .../src/main/ets/MainAbility/pages/Text.ets | 237 + .../src/main/ets/MainAbility/pages/index.ets | 65 + .../main/ets/MainAbility/test/List.test.ets | 22 + .../src/main/ets/MainAbility/test/Utils.ets | 119 + .../test/contact/ContactMerge_test.js | 1873 +++++ .../main/ets/MainAbility/test/lib/Const.js | 36 + .../main/resources/base/element/string.json | 12 + .../src/main/resources/base/media/icon.png | Bin 0 -> 6790 bytes .../entry/src/main/resources/rawfile/hand.png | Bin 0 -> 976 bytes .../entry/src/main/resources/rawfile/icon.png | Bin 0 -> 6790 bytes .../src/main/resources/rawfile/images.jpg | Bin 0 -> 3377 bytes .../src/main/resources/rawfile/person.png | Bin 0 -> 1636 bytes .../src/main/resources/rawfile/star-1-1.png | Bin 0 -> 5326 bytes .../src/main/resources/rawfile/star-1-2.png | Bin 0 -> 8295 bytes .../src/main/resources/rawfile/star-1-3.png | Bin 0 -> 5545 bytes .../src/main/resources/rawfile/video/show.mp4 | 0 .../signature/openharmony_sx.p7b | Bin 0 -> 3437 bytes .../contact_performance/BUILD.gn | 32 + .../contact_performance/Test.json | 18 + .../entry/src/main/config.json | 93 + .../entry/src/main/ets/MainAbility/app.ets | 23 + .../src/main/ets/MainAbility/pages/Badge.ets | 95 + .../src/main/ets/MainAbility/pages/Blank.ets | 47 + .../src/main/ets/MainAbility/pages/Button.ets | 70 + .../src/main/ets/MainAbility/pages/Column.ets | 51 + .../ets/MainAbility/pages/ColumnSplit.ets | 70 + .../main/ets/MainAbility/pages/Counter.ets | 51 + .../main/ets/MainAbility/pages/DataPanel.ets | 69 + .../main/ets/MainAbility/pages/Divider.ets | 71 + .../src/main/ets/MainAbility/pages/Flex.ets | 135 + .../ets/MainAbility/pages/GridContainer.ets | 170 + .../src/main/ets/MainAbility/pages/Image.ets | 90 + .../main/ets/MainAbility/pages/Navigator.ets | 60 + .../src/main/ets/MainAbility/pages/Panel.ets | 96 + .../main/ets/MainAbility/pages/Progress.ets | 76 + .../src/main/ets/MainAbility/pages/Qrcode.ets | 44 + .../src/main/ets/MainAbility/pages/Rating.ets | 63 + .../main/ets/MainAbility/pages/RowSplit.ets | 78 + .../src/main/ets/MainAbility/pages/Scroll.ets | 200 + .../src/main/ets/MainAbility/pages/Slider.ets | 82 + .../src/main/ets/MainAbility/pages/Span.ets | 64 + .../src/main/ets/MainAbility/pages/Stack.ets | 103 + .../src/main/ets/MainAbility/pages/Text.ets | 237 + .../src/main/ets/MainAbility/pages/index.ets | 65 + .../main/ets/MainAbility/test/List.test.ets | 22 + .../src/main/ets/MainAbility/test/Utils.ets | 119 + .../test/contact/Performance_test.js | 627 ++ .../main/ets/MainAbility/test/lib/Const.js | 36 + .../main/resources/base/element/string.json | 12 + .../src/main/resources/base/media/icon.png | Bin 0 -> 6790 bytes .../entry/src/main/resources/rawfile/hand.png | Bin 0 -> 976 bytes .../entry/src/main/resources/rawfile/icon.png | Bin 0 -> 6790 bytes .../src/main/resources/rawfile/images.jpg | Bin 0 -> 3377 bytes .../src/main/resources/rawfile/person.png | Bin 0 -> 1636 bytes .../src/main/resources/rawfile/star-1-1.png | Bin 0 -> 5326 bytes .../src/main/resources/rawfile/star-1-2.png | Bin 0 -> 8295 bytes .../src/main/resources/rawfile/star-1-3.png | Bin 0 -> 5545 bytes .../src/main/resources/rawfile/video/show.mp4 | 0 .../signature/openharmony_sx.p7b | Bin 0 -> 3437 bytes .../contact_stability/BUILD.gn | 32 + .../contact_stability/Test.json | 18 + .../entry/src/main/config.json | 93 + .../entry/src/main/ets/MainAbility/app.ets | 23 + .../src/main/ets/MainAbility/pages/Badge.ets | 95 + .../src/main/ets/MainAbility/pages/Blank.ets | 47 + .../src/main/ets/MainAbility/pages/Button.ets | 70 + .../src/main/ets/MainAbility/pages/Column.ets | 51 + .../ets/MainAbility/pages/ColumnSplit.ets | 70 + .../main/ets/MainAbility/pages/Counter.ets | 51 + .../main/ets/MainAbility/pages/DataPanel.ets | 69 + .../main/ets/MainAbility/pages/Divider.ets | 71 + .../src/main/ets/MainAbility/pages/Flex.ets | 135 + .../ets/MainAbility/pages/GridContainer.ets | 170 + .../src/main/ets/MainAbility/pages/Image.ets | 90 + .../main/ets/MainAbility/pages/Navigator.ets | 60 + .../src/main/ets/MainAbility/pages/Panel.ets | 96 + .../main/ets/MainAbility/pages/Progress.ets | 76 + .../src/main/ets/MainAbility/pages/Qrcode.ets | 44 + .../src/main/ets/MainAbility/pages/Rating.ets | 63 + .../main/ets/MainAbility/pages/RowSplit.ets | 78 + .../src/main/ets/MainAbility/pages/Scroll.ets | 200 + .../src/main/ets/MainAbility/pages/Slider.ets | 82 + .../src/main/ets/MainAbility/pages/Span.ets | 64 + .../src/main/ets/MainAbility/pages/Stack.ets | 103 + .../src/main/ets/MainAbility/pages/Text.ets | 237 + .../src/main/ets/MainAbility/pages/index.ets | 65 + .../main/ets/MainAbility/test/List.test.ets | 22 + .../src/main/ets/MainAbility/test/Utils.ets | 119 + .../test/contact/Stability_test.js | 538 ++ .../main/ets/MainAbility/test/lib/Const.js | 36 + .../main/resources/base/element/string.json | 12 + .../src/main/resources/base/media/icon.png | Bin 0 -> 6790 bytes .../entry/src/main/resources/rawfile/hand.png | Bin 0 -> 976 bytes .../entry/src/main/resources/rawfile/icon.png | Bin 0 -> 6790 bytes .../src/main/resources/rawfile/images.jpg | Bin 0 -> 3377 bytes .../src/main/resources/rawfile/person.png | Bin 0 -> 1636 bytes .../src/main/resources/rawfile/star-1-1.png | Bin 0 -> 5326 bytes .../src/main/resources/rawfile/star-1-2.png | Bin 0 -> 8295 bytes .../src/main/resources/rawfile/star-1-3.png | Bin 0 -> 5545 bytes .../src/main/resources/rawfile/video/show.mp4 | 0 .../signature/openharmony_sx.p7b | Bin 0 -> 3437 bytes .../telephonyjstest/netmanager_http/BUILD.gn | 32 + .../telephonyjstest/netmanager_http/Test.json | 18 + .../entry/src/main/config.json | 93 + .../entry/src/main/ets/MainAbility/app.ets | 23 + .../src/main/ets/MainAbility/pages/Badge.ets | 95 + .../src/main/ets/MainAbility/pages/Blank.ets | 47 + .../src/main/ets/MainAbility/pages/Button.ets | 70 + .../src/main/ets/MainAbility/pages/Column.ets | 51 + .../ets/MainAbility/pages/ColumnSplit.ets | 70 + .../main/ets/MainAbility/pages/Counter.ets | 51 + .../main/ets/MainAbility/pages/DataPanel.ets | 69 + .../main/ets/MainAbility/pages/Divider.ets | 71 + .../src/main/ets/MainAbility/pages/Flex.ets | 135 + .../ets/MainAbility/pages/GridContainer.ets | 170 + .../src/main/ets/MainAbility/pages/Image.ets | 90 + .../main/ets/MainAbility/pages/Navigator.ets | 60 + .../src/main/ets/MainAbility/pages/Panel.ets | 96 + .../main/ets/MainAbility/pages/Progress.ets | 76 + .../src/main/ets/MainAbility/pages/Qrcode.ets | 44 + .../src/main/ets/MainAbility/pages/Rating.ets | 63 + .../main/ets/MainAbility/pages/RowSplit.ets | 78 + .../src/main/ets/MainAbility/pages/Scroll.ets | 200 + .../src/main/ets/MainAbility/pages/Slider.ets | 82 + .../src/main/ets/MainAbility/pages/Span.ets | 64 + .../src/main/ets/MainAbility/pages/Stack.ets | 103 + .../src/main/ets/MainAbility/pages/Text.ets | 237 + .../src/main/ets/MainAbility/pages/index.ets | 65 + .../ets/MainAbility/test/HttpJsunit.test.ets | 36 + .../test/HttpRequestJsunit.test.ets | 280 + .../test/HttpRequestOptionsJsunit.test.ets | 522 ++ .../test/HttpResponseJsunit.test.ets | 449 ++ .../main/ets/MainAbility/test/List.test.ets | 32 + .../test/RequestMethodJsunit.test.ets | 347 + .../test/ResponseCodeJsunit.test.ets | 456 ++ .../src/main/ets/MainAbility/test/Utils.ets | 119 + .../main/ets/MainAbility/test/lib/Const.js | 36 + .../main/resources/base/element/string.json | 12 + .../src/main/resources/base/media/icon.png | Bin 0 -> 6790 bytes .../entry/src/main/resources/rawfile/hand.png | Bin 0 -> 976 bytes .../entry/src/main/resources/rawfile/icon.png | Bin 0 -> 6790 bytes .../src/main/resources/rawfile/images.jpg | Bin 0 -> 3377 bytes .../src/main/resources/rawfile/person.png | Bin 0 -> 1636 bytes .../src/main/resources/rawfile/star-1-1.png | Bin 0 -> 5326 bytes .../src/main/resources/rawfile/star-1-2.png | Bin 0 -> 8295 bytes .../src/main/resources/rawfile/star-1-3.png | Bin 0 -> 5545 bytes .../src/main/resources/rawfile/video/show.mp4 | 0 .../signature/openharmony_sx.p7b | Bin 0 -> 3437 bytes .../netmanager_socket/BUILD.gn | 32 + .../netmanager_socket/Test.json | 18 + .../entry/src/main/config.json | 93 + .../entry/src/main/ets/MainAbility/app.ets | 23 + .../src/main/ets/MainAbility/pages/Badge.ets | 95 + .../src/main/ets/MainAbility/pages/Blank.ets | 47 + .../src/main/ets/MainAbility/pages/Button.ets | 70 + .../src/main/ets/MainAbility/pages/Column.ets | 51 + .../ets/MainAbility/pages/ColumnSplit.ets | 70 + .../main/ets/MainAbility/pages/Counter.ets | 51 + .../main/ets/MainAbility/pages/DataPanel.ets | 69 + .../main/ets/MainAbility/pages/Divider.ets | 71 + .../src/main/ets/MainAbility/pages/Flex.ets | 135 + .../ets/MainAbility/pages/GridContainer.ets | 170 + .../src/main/ets/MainAbility/pages/Image.ets | 90 + .../main/ets/MainAbility/pages/Navigator.ets | 60 + .../src/main/ets/MainAbility/pages/Panel.ets | 96 + .../main/ets/MainAbility/pages/Progress.ets | 76 + .../src/main/ets/MainAbility/pages/Qrcode.ets | 44 + .../src/main/ets/MainAbility/pages/Rating.ets | 63 + .../main/ets/MainAbility/pages/RowSplit.ets | 78 + .../src/main/ets/MainAbility/pages/Scroll.ets | 200 + .../src/main/ets/MainAbility/pages/Slider.ets | 82 + .../src/main/ets/MainAbility/pages/Span.ets | 64 + .../src/main/ets/MainAbility/pages/Stack.ets | 103 + .../src/main/ets/MainAbility/pages/Text.ets | 237 + .../src/main/ets/MainAbility/pages/index.ets | 65 + .../test/ConnectionJsunit.test.ets | 1002 +++ .../test/ConnectionSecondJsUnit.test.ets | 431 ++ .../main/ets/MainAbility/test/List.test.ets | 28 + .../MainAbility/test/SocketJsunit.test.ets | 1796 +++++ .../src/main/ets/MainAbility/test/Utils.ets | 119 + .../MainAbility/test/WebSocketJsunit.test.ets | 515 ++ .../main/ets/MainAbility/test/lib/Const.js | 36 + .../main/resources/base/element/string.json | 12 + .../src/main/resources/base/media/icon.png | Bin 0 -> 6790 bytes .../entry/src/main/resources/rawfile/hand.png | Bin 0 -> 976 bytes .../entry/src/main/resources/rawfile/icon.png | Bin 0 -> 6790 bytes .../src/main/resources/rawfile/images.jpg | Bin 0 -> 3377 bytes .../src/main/resources/rawfile/person.png | Bin 0 -> 1636 bytes .../src/main/resources/rawfile/star-1-1.png | Bin 0 -> 5326 bytes .../src/main/resources/rawfile/star-1-2.png | Bin 0 -> 8295 bytes .../src/main/resources/rawfile/star-1-3.png | Bin 0 -> 5545 bytes .../src/main/resources/rawfile/video/show.mp4 | 0 .../signature/openharmony_sx.p7b | Bin 0 -> 3437 bytes telephony/telephonyjstest/new_add/BUILD.gn | 32 + telephony/telephonyjstest/new_add/Test.json | 18 + .../new_add/entry/src/main/config.json | 93 + .../entry/src/main/ets/MainAbility/app.ets | 23 + .../src/main/ets/MainAbility/pages/Badge.ets | 95 + .../src/main/ets/MainAbility/pages/Blank.ets | 47 + .../src/main/ets/MainAbility/pages/Button.ets | 70 + .../src/main/ets/MainAbility/pages/Column.ets | 51 + .../ets/MainAbility/pages/ColumnSplit.ets | 70 + .../main/ets/MainAbility/pages/Counter.ets | 51 + .../main/ets/MainAbility/pages/DataPanel.ets | 69 + .../main/ets/MainAbility/pages/Divider.ets | 71 + .../src/main/ets/MainAbility/pages/Flex.ets | 135 + .../ets/MainAbility/pages/GridContainer.ets | 170 + .../src/main/ets/MainAbility/pages/Image.ets | 90 + .../main/ets/MainAbility/pages/Navigator.ets | 60 + .../src/main/ets/MainAbility/pages/Panel.ets | 96 + .../main/ets/MainAbility/pages/Progress.ets | 76 + .../src/main/ets/MainAbility/pages/Qrcode.ets | 44 + .../src/main/ets/MainAbility/pages/Rating.ets | 63 + .../main/ets/MainAbility/pages/RowSplit.ets | 78 + .../src/main/ets/MainAbility/pages/Scroll.ets | 200 + .../src/main/ets/MainAbility/pages/Slider.ets | 82 + .../src/main/ets/MainAbility/pages/Span.ets | 64 + .../src/main/ets/MainAbility/pages/Stack.ets | 103 + .../src/main/ets/MainAbility/pages/Text.ets | 237 + .../src/main/ets/MainAbility/pages/index.ets | 65 + .../ets/MainAbility/test/CallJsunit.test.ets | 850 +++ .../test/ConvertOptionsJsunit.test.ets | 1262 ++++ .../ets/MainAbility/test/DataJsunit.test.ets | 166 + .../main/ets/MainAbility/test/List.test.ets | 38 + .../MainAbility/test/ObserverJsunit.test.ets | 766 ++ .../ets/MainAbility/test/RadioJsunit.test.ets | 302 + .../test/RadioSecondJsunit.test.ets | 209 + .../ets/MainAbility/test/SimJsunit.test.ets | 164 + .../MainAbility/test/SmsMmsJsunit.test.ets | 892 +++ .../test/StatisticsJsunit.test.ets | 1383 ++++ .../src/main/ets/MainAbility/test/Utils.ets | 119 + .../main/ets/MainAbility/test/lib/Const.js | 36 + .../main/resources/base/element/string.json | 12 + .../src/main/resources/base/media/icon.png | Bin 0 -> 6790 bytes .../entry/src/main/resources/rawfile/hand.png | Bin 0 -> 976 bytes .../entry/src/main/resources/rawfile/icon.png | Bin 0 -> 6790 bytes .../src/main/resources/rawfile/images.jpg | Bin 0 -> 3377 bytes .../src/main/resources/rawfile/person.png | Bin 0 -> 1636 bytes .../src/main/resources/rawfile/star-1-1.png | Bin 0 -> 5326 bytes .../src/main/resources/rawfile/star-1-2.png | Bin 0 -> 8295 bytes .../src/main/resources/rawfile/star-1-3.png | Bin 0 -> 5545 bytes .../src/main/resources/rawfile/video/show.mp4 | 0 .../new_add/signature/openharmony_sx.p7b | Bin 0 -> 3437 bytes 320 files changed, 49395 insertions(+) create mode 100644 telephony/telephonyjstest/contact_function/BUILD.gn create mode 100644 telephony/telephonyjstest/contact_function/Test.json create mode 100644 telephony/telephonyjstest/contact_function/entry/src/main/config.json create mode 100644 telephony/telephonyjstest/contact_function/entry/src/main/ets/MainAbility/app.ets create mode 100644 telephony/telephonyjstest/contact_function/entry/src/main/ets/MainAbility/pages/Badge.ets create mode 100644 telephony/telephonyjstest/contact_function/entry/src/main/ets/MainAbility/pages/Blank.ets create mode 100644 telephony/telephonyjstest/contact_function/entry/src/main/ets/MainAbility/pages/Button.ets create mode 100644 telephony/telephonyjstest/contact_function/entry/src/main/ets/MainAbility/pages/Column.ets create mode 100644 telephony/telephonyjstest/contact_function/entry/src/main/ets/MainAbility/pages/ColumnSplit.ets create mode 100644 telephony/telephonyjstest/contact_function/entry/src/main/ets/MainAbility/pages/Counter.ets create mode 100644 telephony/telephonyjstest/contact_function/entry/src/main/ets/MainAbility/pages/DataPanel.ets create mode 100644 telephony/telephonyjstest/contact_function/entry/src/main/ets/MainAbility/pages/Divider.ets create mode 100644 telephony/telephonyjstest/contact_function/entry/src/main/ets/MainAbility/pages/Flex.ets create mode 100644 telephony/telephonyjstest/contact_function/entry/src/main/ets/MainAbility/pages/GridContainer.ets create mode 100644 telephony/telephonyjstest/contact_function/entry/src/main/ets/MainAbility/pages/Image.ets create mode 100644 telephony/telephonyjstest/contact_function/entry/src/main/ets/MainAbility/pages/Navigator.ets create mode 100644 telephony/telephonyjstest/contact_function/entry/src/main/ets/MainAbility/pages/Panel.ets create mode 100644 telephony/telephonyjstest/contact_function/entry/src/main/ets/MainAbility/pages/Progress.ets create mode 100644 telephony/telephonyjstest/contact_function/entry/src/main/ets/MainAbility/pages/Qrcode.ets create mode 100644 telephony/telephonyjstest/contact_function/entry/src/main/ets/MainAbility/pages/Rating.ets create mode 100644 telephony/telephonyjstest/contact_function/entry/src/main/ets/MainAbility/pages/RowSplit.ets create mode 100644 telephony/telephonyjstest/contact_function/entry/src/main/ets/MainAbility/pages/Scroll.ets create mode 100644 telephony/telephonyjstest/contact_function/entry/src/main/ets/MainAbility/pages/Slider.ets create mode 100644 telephony/telephonyjstest/contact_function/entry/src/main/ets/MainAbility/pages/Span.ets create mode 100644 telephony/telephonyjstest/contact_function/entry/src/main/ets/MainAbility/pages/Stack.ets create mode 100644 telephony/telephonyjstest/contact_function/entry/src/main/ets/MainAbility/pages/Text.ets create mode 100644 telephony/telephonyjstest/contact_function/entry/src/main/ets/MainAbility/pages/index.ets create mode 100644 telephony/telephonyjstest/contact_function/entry/src/main/ets/MainAbility/test/List.test.ets create mode 100644 telephony/telephonyjstest/contact_function/entry/src/main/ets/MainAbility/test/Utils.ets create mode 100644 telephony/telephonyjstest/contact_function/entry/src/main/ets/MainAbility/test/contact/Calllog_test.js create mode 100644 telephony/telephonyjstest/contact_function/entry/src/main/ets/MainAbility/test/contact/ContactCard_test.js create mode 100644 telephony/telephonyjstest/contact_function/entry/src/main/ets/MainAbility/test/contact/ContactClass_test.js create mode 100644 telephony/telephonyjstest/contact_function/entry/src/main/ets/MainAbility/test/contact/ContacterJsunit.ets create mode 100644 telephony/telephonyjstest/contact_function/entry/src/main/ets/MainAbility/test/contact/Contacts_test.js create mode 100644 telephony/telephonyjstest/contact_function/entry/src/main/ets/MainAbility/test/contact/Groups_test.js create mode 100644 telephony/telephonyjstest/contact_function/entry/src/main/ets/MainAbility/test/contact/ObjectInterface_test.js create mode 100644 telephony/telephonyjstest/contact_function/entry/src/main/ets/MainAbility/test/contact/Voicemail_test.js create mode 100644 telephony/telephonyjstest/contact_function/entry/src/main/ets/MainAbility/test/contact/common.js create mode 100644 telephony/telephonyjstest/contact_function/entry/src/main/ets/MainAbility/test/contact/recovery_test.js create mode 100644 telephony/telephonyjstest/contact_function/entry/src/main/ets/MainAbility/test/lib/Const.js create mode 100644 telephony/telephonyjstest/contact_function/entry/src/main/resources/base/element/string.json create mode 100644 telephony/telephonyjstest/contact_function/entry/src/main/resources/base/media/icon.png create mode 100644 telephony/telephonyjstest/contact_function/entry/src/main/resources/rawfile/hand.png create mode 100644 telephony/telephonyjstest/contact_function/entry/src/main/resources/rawfile/icon.png create mode 100644 telephony/telephonyjstest/contact_function/entry/src/main/resources/rawfile/images.jpg create mode 100644 telephony/telephonyjstest/contact_function/entry/src/main/resources/rawfile/person.png create mode 100644 telephony/telephonyjstest/contact_function/entry/src/main/resources/rawfile/star-1-1.png create mode 100644 telephony/telephonyjstest/contact_function/entry/src/main/resources/rawfile/star-1-2.png create mode 100644 telephony/telephonyjstest/contact_function/entry/src/main/resources/rawfile/star-1-3.png create mode 100644 telephony/telephonyjstest/contact_function/entry/src/main/resources/rawfile/video/show.mp4 create mode 100644 telephony/telephonyjstest/contact_function/signature/openharmony_sx.p7b create mode 100644 telephony/telephonyjstest/contact_function_merge/BUILD.gn create mode 100644 telephony/telephonyjstest/contact_function_merge/Test.json create mode 100644 telephony/telephonyjstest/contact_function_merge/entry/src/main/config.json create mode 100644 telephony/telephonyjstest/contact_function_merge/entry/src/main/ets/MainAbility/app.ets create mode 100644 telephony/telephonyjstest/contact_function_merge/entry/src/main/ets/MainAbility/pages/Badge.ets create mode 100644 telephony/telephonyjstest/contact_function_merge/entry/src/main/ets/MainAbility/pages/Blank.ets create mode 100644 telephony/telephonyjstest/contact_function_merge/entry/src/main/ets/MainAbility/pages/Button.ets create mode 100644 telephony/telephonyjstest/contact_function_merge/entry/src/main/ets/MainAbility/pages/Column.ets create mode 100644 telephony/telephonyjstest/contact_function_merge/entry/src/main/ets/MainAbility/pages/ColumnSplit.ets create mode 100644 telephony/telephonyjstest/contact_function_merge/entry/src/main/ets/MainAbility/pages/Counter.ets create mode 100644 telephony/telephonyjstest/contact_function_merge/entry/src/main/ets/MainAbility/pages/DataPanel.ets create mode 100644 telephony/telephonyjstest/contact_function_merge/entry/src/main/ets/MainAbility/pages/Divider.ets create mode 100644 telephony/telephonyjstest/contact_function_merge/entry/src/main/ets/MainAbility/pages/Flex.ets create mode 100644 telephony/telephonyjstest/contact_function_merge/entry/src/main/ets/MainAbility/pages/GridContainer.ets create mode 100644 telephony/telephonyjstest/contact_function_merge/entry/src/main/ets/MainAbility/pages/Image.ets create mode 100644 telephony/telephonyjstest/contact_function_merge/entry/src/main/ets/MainAbility/pages/Navigator.ets create mode 100644 telephony/telephonyjstest/contact_function_merge/entry/src/main/ets/MainAbility/pages/Panel.ets create mode 100644 telephony/telephonyjstest/contact_function_merge/entry/src/main/ets/MainAbility/pages/Progress.ets create mode 100644 telephony/telephonyjstest/contact_function_merge/entry/src/main/ets/MainAbility/pages/Qrcode.ets create mode 100644 telephony/telephonyjstest/contact_function_merge/entry/src/main/ets/MainAbility/pages/Rating.ets create mode 100644 telephony/telephonyjstest/contact_function_merge/entry/src/main/ets/MainAbility/pages/RowSplit.ets create mode 100644 telephony/telephonyjstest/contact_function_merge/entry/src/main/ets/MainAbility/pages/Scroll.ets create mode 100644 telephony/telephonyjstest/contact_function_merge/entry/src/main/ets/MainAbility/pages/Slider.ets create mode 100644 telephony/telephonyjstest/contact_function_merge/entry/src/main/ets/MainAbility/pages/Span.ets create mode 100644 telephony/telephonyjstest/contact_function_merge/entry/src/main/ets/MainAbility/pages/Stack.ets create mode 100644 telephony/telephonyjstest/contact_function_merge/entry/src/main/ets/MainAbility/pages/Text.ets create mode 100644 telephony/telephonyjstest/contact_function_merge/entry/src/main/ets/MainAbility/pages/index.ets create mode 100644 telephony/telephonyjstest/contact_function_merge/entry/src/main/ets/MainAbility/test/List.test.ets create mode 100644 telephony/telephonyjstest/contact_function_merge/entry/src/main/ets/MainAbility/test/Utils.ets create mode 100644 telephony/telephonyjstest/contact_function_merge/entry/src/main/ets/MainAbility/test/contact/ContactMerge_test.js create mode 100644 telephony/telephonyjstest/contact_function_merge/entry/src/main/ets/MainAbility/test/lib/Const.js create mode 100644 telephony/telephonyjstest/contact_function_merge/entry/src/main/resources/base/element/string.json create mode 100644 telephony/telephonyjstest/contact_function_merge/entry/src/main/resources/base/media/icon.png create mode 100644 telephony/telephonyjstest/contact_function_merge/entry/src/main/resources/rawfile/hand.png create mode 100644 telephony/telephonyjstest/contact_function_merge/entry/src/main/resources/rawfile/icon.png create mode 100644 telephony/telephonyjstest/contact_function_merge/entry/src/main/resources/rawfile/images.jpg create mode 100644 telephony/telephonyjstest/contact_function_merge/entry/src/main/resources/rawfile/person.png create mode 100644 telephony/telephonyjstest/contact_function_merge/entry/src/main/resources/rawfile/star-1-1.png create mode 100644 telephony/telephonyjstest/contact_function_merge/entry/src/main/resources/rawfile/star-1-2.png create mode 100644 telephony/telephonyjstest/contact_function_merge/entry/src/main/resources/rawfile/star-1-3.png create mode 100644 telephony/telephonyjstest/contact_function_merge/entry/src/main/resources/rawfile/video/show.mp4 create mode 100644 telephony/telephonyjstest/contact_function_merge/signature/openharmony_sx.p7b create mode 100644 telephony/telephonyjstest/contact_performance/BUILD.gn create mode 100644 telephony/telephonyjstest/contact_performance/Test.json create mode 100644 telephony/telephonyjstest/contact_performance/entry/src/main/config.json create mode 100644 telephony/telephonyjstest/contact_performance/entry/src/main/ets/MainAbility/app.ets create mode 100644 telephony/telephonyjstest/contact_performance/entry/src/main/ets/MainAbility/pages/Badge.ets create mode 100644 telephony/telephonyjstest/contact_performance/entry/src/main/ets/MainAbility/pages/Blank.ets create mode 100644 telephony/telephonyjstest/contact_performance/entry/src/main/ets/MainAbility/pages/Button.ets create mode 100644 telephony/telephonyjstest/contact_performance/entry/src/main/ets/MainAbility/pages/Column.ets create mode 100644 telephony/telephonyjstest/contact_performance/entry/src/main/ets/MainAbility/pages/ColumnSplit.ets create mode 100644 telephony/telephonyjstest/contact_performance/entry/src/main/ets/MainAbility/pages/Counter.ets create mode 100644 telephony/telephonyjstest/contact_performance/entry/src/main/ets/MainAbility/pages/DataPanel.ets create mode 100644 telephony/telephonyjstest/contact_performance/entry/src/main/ets/MainAbility/pages/Divider.ets create mode 100644 telephony/telephonyjstest/contact_performance/entry/src/main/ets/MainAbility/pages/Flex.ets create mode 100644 telephony/telephonyjstest/contact_performance/entry/src/main/ets/MainAbility/pages/GridContainer.ets create mode 100644 telephony/telephonyjstest/contact_performance/entry/src/main/ets/MainAbility/pages/Image.ets create mode 100644 telephony/telephonyjstest/contact_performance/entry/src/main/ets/MainAbility/pages/Navigator.ets create mode 100644 telephony/telephonyjstest/contact_performance/entry/src/main/ets/MainAbility/pages/Panel.ets create mode 100644 telephony/telephonyjstest/contact_performance/entry/src/main/ets/MainAbility/pages/Progress.ets create mode 100644 telephony/telephonyjstest/contact_performance/entry/src/main/ets/MainAbility/pages/Qrcode.ets create mode 100644 telephony/telephonyjstest/contact_performance/entry/src/main/ets/MainAbility/pages/Rating.ets create mode 100644 telephony/telephonyjstest/contact_performance/entry/src/main/ets/MainAbility/pages/RowSplit.ets create mode 100644 telephony/telephonyjstest/contact_performance/entry/src/main/ets/MainAbility/pages/Scroll.ets create mode 100644 telephony/telephonyjstest/contact_performance/entry/src/main/ets/MainAbility/pages/Slider.ets create mode 100644 telephony/telephonyjstest/contact_performance/entry/src/main/ets/MainAbility/pages/Span.ets create mode 100644 telephony/telephonyjstest/contact_performance/entry/src/main/ets/MainAbility/pages/Stack.ets create mode 100644 telephony/telephonyjstest/contact_performance/entry/src/main/ets/MainAbility/pages/Text.ets create mode 100644 telephony/telephonyjstest/contact_performance/entry/src/main/ets/MainAbility/pages/index.ets create mode 100644 telephony/telephonyjstest/contact_performance/entry/src/main/ets/MainAbility/test/List.test.ets create mode 100644 telephony/telephonyjstest/contact_performance/entry/src/main/ets/MainAbility/test/Utils.ets create mode 100644 telephony/telephonyjstest/contact_performance/entry/src/main/ets/MainAbility/test/contact/Performance_test.js create mode 100644 telephony/telephonyjstest/contact_performance/entry/src/main/ets/MainAbility/test/lib/Const.js create mode 100644 telephony/telephonyjstest/contact_performance/entry/src/main/resources/base/element/string.json create mode 100644 telephony/telephonyjstest/contact_performance/entry/src/main/resources/base/media/icon.png create mode 100644 telephony/telephonyjstest/contact_performance/entry/src/main/resources/rawfile/hand.png create mode 100644 telephony/telephonyjstest/contact_performance/entry/src/main/resources/rawfile/icon.png create mode 100644 telephony/telephonyjstest/contact_performance/entry/src/main/resources/rawfile/images.jpg create mode 100644 telephony/telephonyjstest/contact_performance/entry/src/main/resources/rawfile/person.png create mode 100644 telephony/telephonyjstest/contact_performance/entry/src/main/resources/rawfile/star-1-1.png create mode 100644 telephony/telephonyjstest/contact_performance/entry/src/main/resources/rawfile/star-1-2.png create mode 100644 telephony/telephonyjstest/contact_performance/entry/src/main/resources/rawfile/star-1-3.png create mode 100644 telephony/telephonyjstest/contact_performance/entry/src/main/resources/rawfile/video/show.mp4 create mode 100644 telephony/telephonyjstest/contact_performance/signature/openharmony_sx.p7b create mode 100644 telephony/telephonyjstest/contact_stability/BUILD.gn create mode 100644 telephony/telephonyjstest/contact_stability/Test.json create mode 100644 telephony/telephonyjstest/contact_stability/entry/src/main/config.json create mode 100644 telephony/telephonyjstest/contact_stability/entry/src/main/ets/MainAbility/app.ets create mode 100644 telephony/telephonyjstest/contact_stability/entry/src/main/ets/MainAbility/pages/Badge.ets create mode 100644 telephony/telephonyjstest/contact_stability/entry/src/main/ets/MainAbility/pages/Blank.ets create mode 100644 telephony/telephonyjstest/contact_stability/entry/src/main/ets/MainAbility/pages/Button.ets create mode 100644 telephony/telephonyjstest/contact_stability/entry/src/main/ets/MainAbility/pages/Column.ets create mode 100644 telephony/telephonyjstest/contact_stability/entry/src/main/ets/MainAbility/pages/ColumnSplit.ets create mode 100644 telephony/telephonyjstest/contact_stability/entry/src/main/ets/MainAbility/pages/Counter.ets create mode 100644 telephony/telephonyjstest/contact_stability/entry/src/main/ets/MainAbility/pages/DataPanel.ets create mode 100644 telephony/telephonyjstest/contact_stability/entry/src/main/ets/MainAbility/pages/Divider.ets create mode 100644 telephony/telephonyjstest/contact_stability/entry/src/main/ets/MainAbility/pages/Flex.ets create mode 100644 telephony/telephonyjstest/contact_stability/entry/src/main/ets/MainAbility/pages/GridContainer.ets create mode 100644 telephony/telephonyjstest/contact_stability/entry/src/main/ets/MainAbility/pages/Image.ets create mode 100644 telephony/telephonyjstest/contact_stability/entry/src/main/ets/MainAbility/pages/Navigator.ets create mode 100644 telephony/telephonyjstest/contact_stability/entry/src/main/ets/MainAbility/pages/Panel.ets create mode 100644 telephony/telephonyjstest/contact_stability/entry/src/main/ets/MainAbility/pages/Progress.ets create mode 100644 telephony/telephonyjstest/contact_stability/entry/src/main/ets/MainAbility/pages/Qrcode.ets create mode 100644 telephony/telephonyjstest/contact_stability/entry/src/main/ets/MainAbility/pages/Rating.ets create mode 100644 telephony/telephonyjstest/contact_stability/entry/src/main/ets/MainAbility/pages/RowSplit.ets create mode 100644 telephony/telephonyjstest/contact_stability/entry/src/main/ets/MainAbility/pages/Scroll.ets create mode 100644 telephony/telephonyjstest/contact_stability/entry/src/main/ets/MainAbility/pages/Slider.ets create mode 100644 telephony/telephonyjstest/contact_stability/entry/src/main/ets/MainAbility/pages/Span.ets create mode 100644 telephony/telephonyjstest/contact_stability/entry/src/main/ets/MainAbility/pages/Stack.ets create mode 100644 telephony/telephonyjstest/contact_stability/entry/src/main/ets/MainAbility/pages/Text.ets create mode 100644 telephony/telephonyjstest/contact_stability/entry/src/main/ets/MainAbility/pages/index.ets create mode 100644 telephony/telephonyjstest/contact_stability/entry/src/main/ets/MainAbility/test/List.test.ets create mode 100644 telephony/telephonyjstest/contact_stability/entry/src/main/ets/MainAbility/test/Utils.ets create mode 100644 telephony/telephonyjstest/contact_stability/entry/src/main/ets/MainAbility/test/contact/Stability_test.js create mode 100644 telephony/telephonyjstest/contact_stability/entry/src/main/ets/MainAbility/test/lib/Const.js create mode 100644 telephony/telephonyjstest/contact_stability/entry/src/main/resources/base/element/string.json create mode 100644 telephony/telephonyjstest/contact_stability/entry/src/main/resources/base/media/icon.png create mode 100644 telephony/telephonyjstest/contact_stability/entry/src/main/resources/rawfile/hand.png create mode 100644 telephony/telephonyjstest/contact_stability/entry/src/main/resources/rawfile/icon.png create mode 100644 telephony/telephonyjstest/contact_stability/entry/src/main/resources/rawfile/images.jpg create mode 100644 telephony/telephonyjstest/contact_stability/entry/src/main/resources/rawfile/person.png create mode 100644 telephony/telephonyjstest/contact_stability/entry/src/main/resources/rawfile/star-1-1.png create mode 100644 telephony/telephonyjstest/contact_stability/entry/src/main/resources/rawfile/star-1-2.png create mode 100644 telephony/telephonyjstest/contact_stability/entry/src/main/resources/rawfile/star-1-3.png create mode 100644 telephony/telephonyjstest/contact_stability/entry/src/main/resources/rawfile/video/show.mp4 create mode 100644 telephony/telephonyjstest/contact_stability/signature/openharmony_sx.p7b create mode 100644 telephony/telephonyjstest/netmanager_http/BUILD.gn create mode 100644 telephony/telephonyjstest/netmanager_http/Test.json create mode 100644 telephony/telephonyjstest/netmanager_http/entry/src/main/config.json create mode 100644 telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/app.ets create mode 100644 telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/pages/Badge.ets create mode 100644 telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/pages/Blank.ets create mode 100644 telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/pages/Button.ets create mode 100644 telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/pages/Column.ets create mode 100644 telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/pages/ColumnSplit.ets create mode 100644 telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/pages/Counter.ets create mode 100644 telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/pages/DataPanel.ets create mode 100644 telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/pages/Divider.ets create mode 100644 telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/pages/Flex.ets create mode 100644 telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/pages/GridContainer.ets create mode 100644 telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/pages/Image.ets create mode 100644 telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/pages/Navigator.ets create mode 100644 telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/pages/Panel.ets create mode 100644 telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/pages/Progress.ets create mode 100644 telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/pages/Qrcode.ets create mode 100644 telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/pages/Rating.ets create mode 100644 telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/pages/RowSplit.ets create mode 100644 telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/pages/Scroll.ets create mode 100644 telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/pages/Slider.ets create mode 100644 telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/pages/Span.ets create mode 100644 telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/pages/Stack.ets create mode 100644 telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/pages/Text.ets create mode 100644 telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/pages/index.ets create mode 100644 telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/test/HttpJsunit.test.ets create mode 100644 telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/test/HttpRequestJsunit.test.ets create mode 100644 telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/test/HttpRequestOptionsJsunit.test.ets create mode 100644 telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/test/HttpResponseJsunit.test.ets create mode 100644 telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/test/List.test.ets create mode 100644 telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/test/RequestMethodJsunit.test.ets create mode 100644 telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/test/ResponseCodeJsunit.test.ets create mode 100644 telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/test/Utils.ets create mode 100644 telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/test/lib/Const.js create mode 100644 telephony/telephonyjstest/netmanager_http/entry/src/main/resources/base/element/string.json create mode 100644 telephony/telephonyjstest/netmanager_http/entry/src/main/resources/base/media/icon.png create mode 100644 telephony/telephonyjstest/netmanager_http/entry/src/main/resources/rawfile/hand.png create mode 100644 telephony/telephonyjstest/netmanager_http/entry/src/main/resources/rawfile/icon.png create mode 100644 telephony/telephonyjstest/netmanager_http/entry/src/main/resources/rawfile/images.jpg create mode 100644 telephony/telephonyjstest/netmanager_http/entry/src/main/resources/rawfile/person.png create mode 100644 telephony/telephonyjstest/netmanager_http/entry/src/main/resources/rawfile/star-1-1.png create mode 100644 telephony/telephonyjstest/netmanager_http/entry/src/main/resources/rawfile/star-1-2.png create mode 100644 telephony/telephonyjstest/netmanager_http/entry/src/main/resources/rawfile/star-1-3.png create mode 100644 telephony/telephonyjstest/netmanager_http/entry/src/main/resources/rawfile/video/show.mp4 create mode 100644 telephony/telephonyjstest/netmanager_http/signature/openharmony_sx.p7b create mode 100644 telephony/telephonyjstest/netmanager_socket/BUILD.gn create mode 100644 telephony/telephonyjstest/netmanager_socket/Test.json create mode 100644 telephony/telephonyjstest/netmanager_socket/entry/src/main/config.json create mode 100644 telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/MainAbility/app.ets create mode 100644 telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/MainAbility/pages/Badge.ets create mode 100644 telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/MainAbility/pages/Blank.ets create mode 100644 telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/MainAbility/pages/Button.ets create mode 100644 telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/MainAbility/pages/Column.ets create mode 100644 telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/MainAbility/pages/ColumnSplit.ets create mode 100644 telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/MainAbility/pages/Counter.ets create mode 100644 telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/MainAbility/pages/DataPanel.ets create mode 100644 telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/MainAbility/pages/Divider.ets create mode 100644 telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/MainAbility/pages/Flex.ets create mode 100644 telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/MainAbility/pages/GridContainer.ets create mode 100644 telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/MainAbility/pages/Image.ets create mode 100644 telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/MainAbility/pages/Navigator.ets create mode 100644 telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/MainAbility/pages/Panel.ets create mode 100644 telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/MainAbility/pages/Progress.ets create mode 100644 telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/MainAbility/pages/Qrcode.ets create mode 100644 telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/MainAbility/pages/Rating.ets create mode 100644 telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/MainAbility/pages/RowSplit.ets create mode 100644 telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/MainAbility/pages/Scroll.ets create mode 100644 telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/MainAbility/pages/Slider.ets create mode 100644 telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/MainAbility/pages/Span.ets create mode 100644 telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/MainAbility/pages/Stack.ets create mode 100644 telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/MainAbility/pages/Text.ets create mode 100644 telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/MainAbility/pages/index.ets create mode 100644 telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/MainAbility/test/ConnectionJsunit.test.ets create mode 100644 telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/MainAbility/test/ConnectionSecondJsUnit.test.ets create mode 100644 telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/MainAbility/test/List.test.ets create mode 100644 telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/MainAbility/test/SocketJsunit.test.ets create mode 100644 telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/MainAbility/test/Utils.ets create mode 100644 telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/MainAbility/test/WebSocketJsunit.test.ets create mode 100644 telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/MainAbility/test/lib/Const.js create mode 100644 telephony/telephonyjstest/netmanager_socket/entry/src/main/resources/base/element/string.json create mode 100644 telephony/telephonyjstest/netmanager_socket/entry/src/main/resources/base/media/icon.png create mode 100644 telephony/telephonyjstest/netmanager_socket/entry/src/main/resources/rawfile/hand.png create mode 100644 telephony/telephonyjstest/netmanager_socket/entry/src/main/resources/rawfile/icon.png create mode 100644 telephony/telephonyjstest/netmanager_socket/entry/src/main/resources/rawfile/images.jpg create mode 100644 telephony/telephonyjstest/netmanager_socket/entry/src/main/resources/rawfile/person.png create mode 100644 telephony/telephonyjstest/netmanager_socket/entry/src/main/resources/rawfile/star-1-1.png create mode 100644 telephony/telephonyjstest/netmanager_socket/entry/src/main/resources/rawfile/star-1-2.png create mode 100644 telephony/telephonyjstest/netmanager_socket/entry/src/main/resources/rawfile/star-1-3.png create mode 100644 telephony/telephonyjstest/netmanager_socket/entry/src/main/resources/rawfile/video/show.mp4 create mode 100644 telephony/telephonyjstest/netmanager_socket/signature/openharmony_sx.p7b create mode 100644 telephony/telephonyjstest/new_add/BUILD.gn create mode 100644 telephony/telephonyjstest/new_add/Test.json create mode 100644 telephony/telephonyjstest/new_add/entry/src/main/config.json create mode 100644 telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/app.ets create mode 100644 telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/pages/Badge.ets create mode 100644 telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/pages/Blank.ets create mode 100644 telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/pages/Button.ets create mode 100644 telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/pages/Column.ets create mode 100644 telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/pages/ColumnSplit.ets create mode 100644 telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/pages/Counter.ets create mode 100644 telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/pages/DataPanel.ets create mode 100644 telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/pages/Divider.ets create mode 100644 telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/pages/Flex.ets create mode 100644 telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/pages/GridContainer.ets create mode 100644 telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/pages/Image.ets create mode 100644 telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/pages/Navigator.ets create mode 100644 telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/pages/Panel.ets create mode 100644 telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/pages/Progress.ets create mode 100644 telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/pages/Qrcode.ets create mode 100644 telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/pages/Rating.ets create mode 100644 telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/pages/RowSplit.ets create mode 100644 telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/pages/Scroll.ets create mode 100644 telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/pages/Slider.ets create mode 100644 telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/pages/Span.ets create mode 100644 telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/pages/Stack.ets create mode 100644 telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/pages/Text.ets create mode 100644 telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/pages/index.ets create mode 100644 telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/test/CallJsunit.test.ets create mode 100644 telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/test/ConvertOptionsJsunit.test.ets create mode 100644 telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/test/DataJsunit.test.ets create mode 100644 telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/test/List.test.ets create mode 100644 telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/test/ObserverJsunit.test.ets create mode 100644 telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/test/RadioJsunit.test.ets create mode 100644 telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/test/RadioSecondJsunit.test.ets create mode 100644 telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/test/SimJsunit.test.ets create mode 100644 telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/test/SmsMmsJsunit.test.ets create mode 100644 telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/test/StatisticsJsunit.test.ets create mode 100644 telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/test/Utils.ets create mode 100644 telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/test/lib/Const.js create mode 100644 telephony/telephonyjstest/new_add/entry/src/main/resources/base/element/string.json create mode 100644 telephony/telephonyjstest/new_add/entry/src/main/resources/base/media/icon.png create mode 100644 telephony/telephonyjstest/new_add/entry/src/main/resources/rawfile/hand.png create mode 100644 telephony/telephonyjstest/new_add/entry/src/main/resources/rawfile/icon.png create mode 100644 telephony/telephonyjstest/new_add/entry/src/main/resources/rawfile/images.jpg create mode 100644 telephony/telephonyjstest/new_add/entry/src/main/resources/rawfile/person.png create mode 100644 telephony/telephonyjstest/new_add/entry/src/main/resources/rawfile/star-1-1.png create mode 100644 telephony/telephonyjstest/new_add/entry/src/main/resources/rawfile/star-1-2.png create mode 100644 telephony/telephonyjstest/new_add/entry/src/main/resources/rawfile/star-1-3.png create mode 100644 telephony/telephonyjstest/new_add/entry/src/main/resources/rawfile/video/show.mp4 create mode 100644 telephony/telephonyjstest/new_add/signature/openharmony_sx.p7b diff --git a/telephony/telephonyjstest/BUILD.gn b/telephony/telephonyjstest/BUILD.gn index 97520ef46..a4e956d92 100644 --- a/telephony/telephonyjstest/BUILD.gn +++ b/telephony/telephonyjstest/BUILD.gn @@ -16,7 +16,14 @@ group("telephonyjstest") { deps = [ "call_manager:call_manager", "cellular_data:cellular_data", + "contact_function:ActsContactFunctionEtsTest", + "contact_function_merge:ActsContactFunctionMergeEtsTest", + "contact_performance:ActsContactPerformanceEtsTest", + "contact_stability:ActsContactStabilityEtsTest", + "netmanager_http:ActsNetManagerHttpEtsTest", + "netmanager_socket:ActsNetManagerSocketEtsTest", "network_search:network_search", + "new_add:ActsNewAddEtsTest", "sim:sim", "sms_mms:sms_mms", ] diff --git a/telephony/telephonyjstest/contact_function/BUILD.gn b/telephony/telephonyjstest/contact_function/BUILD.gn new file mode 100644 index 000000000..b02f559e3 --- /dev/null +++ b/telephony/telephonyjstest/contact_function/BUILD.gn @@ -0,0 +1,32 @@ +# 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("ActsContactFunctionEtsTest") { + hap_profile = "./entry/src/main/config.json" + deps = [ + ":ace_demo_ets_assets", + ":ace_demo_ets_resources", + ] + ets2abc = true + certificate_profile = "./signature/openharmony_sx.p7b" + hap_name = "ActsContactFunctionEtsTest" +} +ohos_js_assets("ace_demo_ets_assets") { + source_dir = "./entry/src/main/ets/MainAbility" +} +ohos_resources("ace_demo_ets_resources") { + sources = [ "./entry/src/main/resources" ] + hap_profile = "./entry/src/main/config.json" +} diff --git a/telephony/telephonyjstest/contact_function/Test.json b/telephony/telephonyjstest/contact_function/Test.json new file mode 100644 index 000000000..ebe415586 --- /dev/null +++ b/telephony/telephonyjstest/contact_function/Test.json @@ -0,0 +1,18 @@ +{ + "description": "Configuration for hjunit demo Tests", + "driver": { + "type": "JSUnitTest", + "test-timeout": "1800000", + "package": "com.ohos.contactfunction", + "shell-timeout": "60000" + }, + "kits": [ + { + "test-file-name": [ + "ActsContactFunctionEtsTest.hap" + ], + "type": "AppInstallKit", + "cleanup-apps": true + } + ] +} diff --git a/telephony/telephonyjstest/contact_function/entry/src/main/config.json b/telephony/telephonyjstest/contact_function/entry/src/main/config.json new file mode 100644 index 000000000..a3efcbc97 --- /dev/null +++ b/telephony/telephonyjstest/contact_function/entry/src/main/config.json @@ -0,0 +1,93 @@ +{ + "app": { + "bundleName": "com.ohos.contactfunction", + "vendor": "open", + "version": { + "code": 1000000, + "name": "1.0.0" + }, + "apiVersion": { + "compatible": 7, + "releaseType": "Release", + "target": 7 + } + }, + "deviceConfig": {}, + "module": { + "package": "com.ohos.contactfunction", + "name": ".MyApplication", + "mainAbility": ".MainAbility", + "srcPath": "MainAbility", + "deviceType": [ + "phone" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "entry", + "moduleType": "entry", + "installationFree": false + }, + "abilities": [ + { + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ], + "orientation": "unspecified", + "visible": true, + "srcPath": "MainAbility", + "name": ".MainAbility", + "srcLanguage": "ets", + "icon": "$media:icon", + "description": "$string:description_mainability", + "formsEnabled": false, + "label": "$string:entry_MainAbility", + "type": "page", + "launchType": "standard" + } + ], + "js": [ + { + "mode": { + "syntax": "ets", + "type": "pageAbility" + }, + "pages": [ + "pages/index", + "pages/Button", + "pages/Blank", + "pages/DataPanel", + "pages/Divider", + "pages/Text", + "pages/RowSplit", + "pages/Scroll", + "pages/Stack", + "pages/Image", + "pages/Progress", + "pages/Qrcode", + "pages/Rating", + "pages/Span", + "pages/Slider", + "pages/Badge", + "pages/Column", + "pages/ColumnSplit", + "pages/Counter", + "pages/Flex", + "pages/GridContainer" + + ], + "name": ".MainAbility", + "window": { + "designWidth": 720, + "autoDesignWidth": false + } + } + ] + } +} \ No newline at end of file diff --git a/telephony/telephonyjstest/contact_function/entry/src/main/ets/MainAbility/app.ets b/telephony/telephonyjstest/contact_function/entry/src/main/ets/MainAbility/app.ets new file mode 100644 index 000000000..261fadca2 --- /dev/null +++ b/telephony/telephonyjstest/contact_function/entry/src/main/ets/MainAbility/app.ets @@ -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('Application onCreate') + }, + onDestroy() { + console.info('Application onDestroy') + }, +} \ No newline at end of file diff --git a/telephony/telephonyjstest/contact_function/entry/src/main/ets/MainAbility/pages/Badge.ets b/telephony/telephonyjstest/contact_function/entry/src/main/ets/MainAbility/pages/Badge.ets new file mode 100644 index 000000000..66de6f8e3 --- /dev/null +++ b/telephony/telephonyjstest/contact_function/entry/src/main/ets/MainAbility/pages/Badge.ets @@ -0,0 +1,95 @@ +/* + * 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. + */ + +@Entry +@Component +struct badge { + @State counts: number = 33 + @State message: string = 'new' + @State active: boolean = false + private content: string = "badge Page"; + + onPageShow() { + console.info('badge page show called'); + } + + onBuildDone() { + console.info('badge page build done called'); + } + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Scroll() { + Column() { + Text(`${this.content}`) + .fontSize(50) + .fontWeight(FontWeight.Bold) + Badge({ + count: this.counts, + position: BadgePosition.Right, + maxCount: 99, + style: { color: 0xFFFFFF, fontSize: 16, badgeSize: 20, badgeColor: Color.Red } + }) { + Button('message') + .onClick(() => { + this.counts++ + }) + .width(100).height(50).backgroundColor(0x317aff) + } + .width(100) + .height(50) + .key('badge') + + Text("BadgePosition.RightTop").fontSize(16) + Badge({ + count: this.counts, + position: BadgePosition.RightTop, + maxCount: 99, + style: { color: 0xFFFFFF, fontSize: '16', badgeSize: '20', badgeColor: Color.Red } + }) { + Button('message') + .onClick(() => { + this.counts++ + }) + .width(100).height(50).backgroundColor(0x317aff) + } + .width(100) + .height(50) + .key('badge1') + + Text("BadgePosition.Left").fontSize(16) + Badge({ + count: this.counts, + position: BadgePosition.Left, + maxCount: 99, + style: { color: Color.Pink, fontSize: 16, badgeSize: 20, badgeColor: Color.Red } + }) { + Button('message') + .onClick(() => { + this.counts++ + }) + .width(100).height(50).backgroundColor(0x317aff) + } + .width(100) + .height(50) + .key('badge2') + } + } + } + .key('flex') + .width('100%') + .height('100%') + } +} diff --git a/telephony/telephonyjstest/contact_function/entry/src/main/ets/MainAbility/pages/Blank.ets b/telephony/telephonyjstest/contact_function/entry/src/main/ets/MainAbility/pages/Blank.ets new file mode 100644 index 000000000..a50fc719e --- /dev/null +++ b/telephony/telephonyjstest/contact_function/entry/src/main/ets/MainAbility/pages/Blank.ets @@ -0,0 +1,47 @@ +/* + * 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. + */ + +@Entry +@Component +struct blank_testcase { + @State Color: Color = Color.Pink + @State active: boolean = false + private content: string = "Blank Page" + + onPageShow() { + console.info('Blank page show called'); + } + + onBuildDone() { + console.info('Blank page build done called'); + } + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Text(`${this.content}`) + .fontSize(50) + .fontWeight(FontWeight.Bold) + Blank(100) + .color(this.Color) + .key('blank') + Text('on/off').fontSize(18).height(60) + } + .key('flex') + .width('100%') + .height('100%') + + + } +} diff --git a/telephony/telephonyjstest/contact_function/entry/src/main/ets/MainAbility/pages/Button.ets b/telephony/telephonyjstest/contact_function/entry/src/main/ets/MainAbility/pages/Button.ets new file mode 100644 index 000000000..ac2271ea3 --- /dev/null +++ b/telephony/telephonyjstest/contact_function/entry/src/main/ets/MainAbility/pages/Button.ets @@ -0,0 +1,70 @@ +/* + * 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 router from '@system.router' + +@Entry +@Component +struct button_testcase { + @State stateEffect: boolean = true + @State ButtonType: ButtonType = ButtonType.Circle + private content: string = "Button Page"; + + onPageShow() { + console.info('Button page show called'); + } + + onBuildDone() { + console.info('Button page build done called'); + } + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Text(`${this.content}`) + .fontSize(50) + .fontWeight(FontWeight.Bold) + Button('1.value', { type: ButtonType.Circle, stateEffect: this.stateEffect }) + .fontSize(12) + .fontWeight(FontWeight.Bold) + .fontColor(0xCCCCCC) + .height(40) + .width(40) + .key('button') + .backgroundColor('#0D9FFB') + .onClick(() => { + router.back() + }) + .padding(10) + Button() { + Text("2.Capsule") + } + .type(ButtonType.Capsule) + .stateEffect(false) + .backgroundColor('#0D9FFB') + .padding(10) + .key('button1') + + Button() { + Text("3.Normal") + }.type(ButtonType.Normal) + .backgroundColor('#0D9FFB') + .key('button2') + + }.key('flex') + .width('100%') + .height('100%') + } +} + diff --git a/telephony/telephonyjstest/contact_function/entry/src/main/ets/MainAbility/pages/Column.ets b/telephony/telephonyjstest/contact_function/entry/src/main/ets/MainAbility/pages/Column.ets new file mode 100644 index 000000000..b9e5c84e2 --- /dev/null +++ b/telephony/telephonyjstest/contact_function/entry/src/main/ets/MainAbility/pages/Column.ets @@ -0,0 +1,51 @@ +/* + * 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. + */ + +@Entry +@Component +struct column { + @State active: boolean = false + private content: string = "Column Page" + + onPageShow() { + console.info('Column page show called'); + } + + onBuildDone() { + console.info('Column page build done called'); + } + + build() { + Column({ space: 5 }) { + Text('alignItems(Center)').fontSize(9).fontColor(0xCCCCCC).width('90%') + Column() { + Column().width('50%').height(50).backgroundColor(0xAFEEEE) + Column().width('50%').height(50).backgroundColor(0x00FFFF) + }.alignItems(HorizontalAlign.Center).width('90%').border({ width: 1 }).key('column') + + Text('alignItems(Start)').fontSize(9).fontColor(0xCCCCCC).width('90%') + Column({ space: '5' }) { + Column().width('50%').height(50).backgroundColor(0xAFEEEE) + Column().width('50%').height(50).backgroundColor(0x00FFFF) + }.alignItems(HorizontalAlign.Start).width('90%').border({ width: 1 }).key('column1') + + Text('alignItems(End)').fontSize(9).fontColor(0xCCCCCC).width('90%') + Column() { + Column().width('50%').height(50).backgroundColor(0xAFEEEE) + Column().width('50%').height(50).backgroundColor(0x00FFFF) + }.alignItems(HorizontalAlign.End).width('90%').border({ width: 1 }).key('column2') + }.width('100%').padding({ top: 5 }) + } +} diff --git a/telephony/telephonyjstest/contact_function/entry/src/main/ets/MainAbility/pages/ColumnSplit.ets b/telephony/telephonyjstest/contact_function/entry/src/main/ets/MainAbility/pages/ColumnSplit.ets new file mode 100644 index 000000000..cb0597310 --- /dev/null +++ b/telephony/telephonyjstest/contact_function/entry/src/main/ets/MainAbility/pages/ColumnSplit.ets @@ -0,0 +1,70 @@ +/* + * 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. + */ + +@Entry +@Component +struct columnSplit { + private content: string = "ColumnSplit Page" + + onPageShow() { + console.info('ColumnSplit page show called'); + } + + onBuildDone() { + console.info('ColumnSplit page build done called'); + } + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Scroll() { + Column() { + Text(`${this.content}`) + .fontSize(50) + .fontWeight(FontWeight.Bold) + Column() { + Text('ColumnSplit').fontSize(9).fontColor(0xCCCCCC).width('90%') + ColumnSplit() { + Text('1').width('100%').height(50).backgroundColor(0xF5DEB3).textAlign(TextAlign.Center) + Text('2').width('100%').height(50).backgroundColor(0xD2B48C).textAlign(TextAlign.Center) + Text('3').width('100%').height(50).backgroundColor(0xF5DEB3).textAlign(TextAlign.Center) + Text('4').width('100%').height(50).backgroundColor(0xD2B48C).textAlign(TextAlign.Center) + Text('5').width('100%').height(50).backgroundColor(0xF5DEB3).textAlign(TextAlign.Center) + }.key('columnSplit') + .resizeable(true) + .width('90%').height('60%') + + }.width("100%") + + Column() { + Text('ColumnSplit1').fontSize(9).fontColor(0xCCCCCC).width('90%') + ColumnSplit() { + Text('1').width('100%').height(50).backgroundColor(0xF5DEB3).textAlign(TextAlign.Center) + Text('2').width('100%').height(50).backgroundColor(0xD2B48C).textAlign(TextAlign.Center) + Text('3').width('100%').height(50).backgroundColor(0xF5DEB3).textAlign(TextAlign.Center) + Text('4').width('100%').height(50).backgroundColor(0xD2B48C).textAlign(TextAlign.Center) + Text('5').width('100%').height(50).backgroundColor(0xF5DEB3).textAlign(TextAlign.Center) + }.key('columnSplit1') + .resizeable(false) + .width('90%').height('60%') + + }.width("100%") + } + } + } + .key('flex') + .width('100%') + .height('100%') + } +} diff --git a/telephony/telephonyjstest/contact_function/entry/src/main/ets/MainAbility/pages/Counter.ets b/telephony/telephonyjstest/contact_function/entry/src/main/ets/MainAbility/pages/Counter.ets new file mode 100644 index 000000000..ecdbfaf10 --- /dev/null +++ b/telephony/telephonyjstest/contact_function/entry/src/main/ets/MainAbility/pages/Counter.ets @@ -0,0 +1,51 @@ +/* + * 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. + */ + +@Entry +@Component +struct counter { + @State value: number = 0 + @State active: boolean = false + private content: string = "Counter Page" + + onPageShow() { + console.info('Counter page show called'); + } + + onBuildDone() { + console.info('Counter page build done called'); + } + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Text(`${this.content}`) + .fontSize(50) + .fontWeight(FontWeight.Bold) + Counter() { + Text(this.value.toString()) + }.margin(100) + .key('counter') + .onInc(() => { + this.value++ + }) + .onDec(() => { + this.value-- + }) + }.width("100%") + .key('flex') + .width('100%') + .height('100%') + } +} diff --git a/telephony/telephonyjstest/contact_function/entry/src/main/ets/MainAbility/pages/DataPanel.ets b/telephony/telephonyjstest/contact_function/entry/src/main/ets/MainAbility/pages/DataPanel.ets new file mode 100644 index 000000000..3c6248484 --- /dev/null +++ b/telephony/telephonyjstest/contact_function/entry/src/main/ets/MainAbility/pages/DataPanel.ets @@ -0,0 +1,69 @@ +/* + * 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 router from '@system.router' + +@Entry +@Component +struct dataPanel_testcase { + @State width: string= "200" + @State height: string= "100" + @State active: boolean = false + private content: string = "DataPanel Page" + + onPageShow() { + console.info('Blank page show called'); + } + + onBuildDone() { + console.info('Blank page build done called'); + } + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Text(`${this.content}`) + .fontSize(50) + DataPanel({ values: [20, 40, 20], max: 100, type: DataPanelType.Line }) + .width(this.width) + .height(this.height) + .key('DataPanel') + .onClick(() => { + router.back() + }) + .closeEffect(false) + + DataPanel({ values: [20, 40, 20], max: 100, type: DataPanelType.Circle}) + .width(this.width) + .height(this.height) + .key('DataPanel2') + .onClick(() => { + router.back() + }) + .closeEffect(true) + DataPanel({ values: [20, 40, 20], max: 100}) + .width(this.width) + .height(this.height) + .key('DataPanel3') + .onClick(() => { + router.back() + }) + .closeEffect(false) + } + .key('flex') + .width('100%') + .height('100%') + + } +} diff --git a/telephony/telephonyjstest/contact_function/entry/src/main/ets/MainAbility/pages/Divider.ets b/telephony/telephonyjstest/contact_function/entry/src/main/ets/MainAbility/pages/Divider.ets new file mode 100644 index 000000000..02bf60779 --- /dev/null +++ b/telephony/telephonyjstest/contact_function/entry/src/main/ets/MainAbility/pages/Divider.ets @@ -0,0 +1,71 @@ +/* + * 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 router from '@system.router' + +@Entry +@Component +struct divider_textcase { + @State vertical: boolean = true + @State color: Color = Color.Red + @State strokeWidth: number = 7 + @State lineCap: LineCapStyle = LineCapStyle.Butt + @State active: boolean = false + private content: string = "Divider Page"; + + onPageShow() { + console.info('Button page show called'); + } + + onBuildDone() { + console.info('Button page build done called'); + } + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Text(`${this.content}`) + .fontSize(50) + Divider() + .lineCap(LineCapStyle.Butt) + .strokeWidth(this.strokeWidth) + .color(this.color) + .vertical(this.vertical) + .height(150) + .key('divider') + .onClick(() => { + router.back() + }) + Divider() + .lineCap(LineCapStyle.Round) + .vertical(false) + .color(Color.Green) + .strokeWidth(10) + .height(150) + .key('divider1') + Divider() + .lineCap(LineCapStyle.Square) + .color(Color.Green) + .vertical(true) + .strokeWidth(10) + .height(150) + .key('divider2') + } + .key('flex') + .width('100%') + .height('100%') + } +} + + diff --git a/telephony/telephonyjstest/contact_function/entry/src/main/ets/MainAbility/pages/Flex.ets b/telephony/telephonyjstest/contact_function/entry/src/main/ets/MainAbility/pages/Flex.ets new file mode 100644 index 000000000..a0e21251e --- /dev/null +++ b/telephony/telephonyjstest/contact_function/entry/src/main/ets/MainAbility/pages/Flex.ets @@ -0,0 +1,135 @@ +/* + * 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. + */ + +@Entry +@Component +struct flex { + private content: string = "Flex Page" + + onPageShow() { + console.info('Flex page show called'); + } + + onBuildDone() { + console.info('Flex page build done called'); + } + + build() { + Column() { + Column({ space : 2 }) { + Text('direction:Column').fontSize(9).fontColor(0xCCCCCC).width('90%') + Flex({ + direction: FlexDirection.Column, + wrap: FlexWrap.NoWrap, + justifyContent: FlexAlign.Center, + alignItems:ItemAlign.Start, + alignContent: FlexAlign.Start, + }) { + Text('1').width('100%').height(20).backgroundColor(0xF5DEB3) + Text('2').width('100%').height(20).backgroundColor(0xD2B48C) + Text('3').width('100%').height(20).backgroundColor(0xF5DEB3) + } + .key('flex') + .height(70) + .width('90%') + .padding(10) + .backgroundColor(0xAFEEEE) + + Text('direction:Row').fontSize(9).fontColor(0xCCCCCC).width('90%') + Flex({ + direction: FlexDirection.Row, + wrap: FlexWrap.Wrap, + justifyContent: FlexAlign.Start, + alignItems:ItemAlign.Start, + alignContent: FlexAlign.Center, + }) { + Text('1').width('20%').height(20).backgroundColor(0xF5DEB3) + Text('2').width('20%').height(20).backgroundColor(0xD2B48C) + Text('3').width('20%').height(20).backgroundColor(0xF5DEB3) + } + .key('flex1') + .height(70) + .width('90%') + .padding(10) + .backgroundColor(0xAFEEEE) + + Text('direction:RowReverse').fontSize(9).fontColor(0xCCCCCC).width('90%') + Flex({ + direction: FlexDirection.RowReverse, + wrap: FlexWrap.Wrap, + justifyContent: FlexAlign.End, + alignItems:ItemAlign.End, + alignContent: FlexAlign.End, + }) { + Text('1').width('50%').height(20).backgroundColor(0xF5DEB3) + Text('2').width('50%').height(20).backgroundColor(0xD2B48C) + Text('3').width('50%').height(20).backgroundColor(0xF5DEB3) + } + .key('flex2') + .height(90) + .width('90%') + .padding(10) + .backgroundColor(0xAFEEEE) + + Text('justifyContent:SpaceBetween').fontSize(9).fontColor(0xCCCCCC).width('90%') + Flex({ + justifyContent: FlexAlign.SpaceBetween, + wrap: FlexWrap.Wrap, + }) { + Text('1').width('100%').height(20).backgroundColor(0xF5DEB3) + Text('2').width('100%').height(20).backgroundColor(0xD2B48C) + Text('3').width('100%').height(20).backgroundColor(0xF5DEB3) + } + .key('flex3') + .height(100) + .width('90%') + .padding(10) + .backgroundColor(0xAFEEEE) + + Text('justifyContent AND alignContent').fontSize(9).fontColor(0xCCCCCC).width('90%') + Flex({ + justifyContent: FlexAlign.SpaceEvenly, + alignContent: FlexAlign.SpaceEvenly, + wrap: FlexWrap.Wrap, + }) { + Text('1').width('50%').height(20).backgroundColor(0xF5DEB3) + Text('2').width('50%').height(20).backgroundColor(0xD2B48C) + Text('3').width('50%').height(20).backgroundColor(0xF5DEB3) + } + .key('flex4') + .height(90) + .width('90%') + .padding(10) + .backgroundColor(0xAFEEEE) + + Text('justifyContent AND alignContent').fontSize(9).fontColor(0xCCCCCC).width('90%') + Flex({ + justifyContent: FlexAlign.SpaceAround, + alignContent: FlexAlign.SpaceAround, + wrap: FlexWrap.Wrap, + }) { + Text('1').width('50%').height(20).backgroundColor(0xF5DEB3) + Text('2').width('50%').height(20).backgroundColor(0xD2B48C) + Text('3').width('50%').height(20).backgroundColor(0xF5DEB3) + } + .key('flex5') + .height(90) + .width('90%') + .padding(10) + .backgroundColor(0xAFEEEE) + }.width('100%').margin({ top: 5 }) + }.width('100%') + } +} diff --git a/telephony/telephonyjstest/contact_function/entry/src/main/ets/MainAbility/pages/GridContainer.ets b/telephony/telephonyjstest/contact_function/entry/src/main/ets/MainAbility/pages/GridContainer.ets new file mode 100644 index 000000000..573581104 --- /dev/null +++ b/telephony/telephonyjstest/contact_function/entry/src/main/ets/MainAbility/pages/GridContainer.ets @@ -0,0 +1,170 @@ +/* + * 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. + */ + +@Entry +@Component +struct gridContainer { + @State sizeType: SizeType = SizeType.XS + @State active: boolean = false + private content: string = "GridContainer Page" + + onPageShow() { + console.info('GridContainer page show called'); + } + + onBuildDone() { + console.info('GridContainer page build done called'); + } + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Text(`${this.content}`) + .fontSize(50) + .fontWeight(FontWeight.Bold) + Scroll() { + Column({ space: 5 }) { + GridContainer({ columns: 12, sizeType: this.sizeType, gutter: 10, margin: 20 }) { + Row() { + Text('1') + .useSizeType({ + xs: { span: 6, offset: 0 }, + sm: { span: 2, offset: 0 }, + md: { span: 2, offset: 0 }, + lg: { span: 2, offset: 0 } + }) + .height(50).backgroundColor(0x4682B4).textAlign(TextAlign.Center) + Text('2').gridSpan(2) + + .height(50).backgroundColor(0x00BFFF).textAlign(TextAlign.Center) + Text('3').gridOffset(3) + + .height(50).backgroundColor(0x4682B4).textAlign(TextAlign.Center) + } + }.key('gridContainer') + .width('90%') + .alignItems(HorizontalAlign.Start) + + Text('Click Simulate to change the device width').fontSize(9).width('90%').fontColor(0xCCCCCC) + Row() { + Button('XS') + .onClick(() => { + this.sizeType = SizeType.XS + }).backgroundColor(0x317aff) + Button('SM') + .onClick(() => { + this.sizeType = SizeType.SM + }).backgroundColor(0x317aff) + Button('MD') + .onClick(() => { + this.sizeType = SizeType.MD + }).backgroundColor(0x317aff) + Button('LG') + .onClick(() => { + this.sizeType = SizeType.LG + }).backgroundColor(0x317aff) + } + + GridContainer({ columns: "auto", sizeType: SizeType.MD, gutter: '10', margin: '20' }) { + Row() { + Text('1') + .useSizeType({ + xs: { span: 6, offset: 0 }, + sm: { span: 2, offset: 0 }, + md: { span: 2, offset: 0 }, + lg: { span: 2, offset: 0 } + }) + .height(50).backgroundColor(0x4682B4).textAlign(TextAlign.Center) + Text('2').gridSpan(2) + + .height(50).backgroundColor(0x00BFFF).textAlign(TextAlign.Center) + Text('3').gridOffset(3) + + .height(50).backgroundColor(0x4682B4).textAlign(TextAlign.Center) + } + }.key('gridContainer1') + .width('90%') + .alignItems(HorizontalAlign.Center) + + GridContainer({ columns: 12, sizeType: SizeType.SM, gutter: 10, margin: 20 }) { + Row() { + Text('1') + .useSizeType({ + xs: { span: 6, offset: 0 }, + sm: { span: 2, offset: 0 }, + md: { span: 2, offset: 0 }, + lg: { span: 2, offset: 0 } + }) + .height(50).backgroundColor(0x4682B4).textAlign(TextAlign.Center) + Text('2').gridSpan(2) + + .height(50).backgroundColor(0x00BFFF).textAlign(TextAlign.Center) + Text('3').gridOffset(3) + + .height(50).backgroundColor(0x4682B4).textAlign(TextAlign.Center) + } + }.key('gridContainer2') + .width('90%') + .alignItems(HorizontalAlign.End) + + GridContainer({ columns: 12, sizeType: SizeType.LG, gutter: 10, margin: 20 }) { + Row() { + Text('1') + .useSizeType({ + xs: { span: 6, offset: 0 }, + sm: { span: 2, offset: 0 }, + md: { span: 2, offset: 0 }, + lg: { span: 2, offset: 0 } + }) + .height(50).backgroundColor(0x4682B4).textAlign(TextAlign.Center) + Text('2').gridSpan(2) + + .height(50).backgroundColor(0x00BFFF).textAlign(TextAlign.Center) + Text('3').gridOffset(3) + + .height(50).backgroundColor(0x4682B4).textAlign(TextAlign.Center) + } + }.key('gridContainer3') + .width('90%') + .alignItems(HorizontalAlign.End) + + GridContainer({ columns: 12, sizeType: SizeType.Auto, gutter: 10, margin: 20 }) { + Row() { + Text('1') + .useSizeType({ + xs: { span: 6, offset: 0 }, + sm: { span: 2, offset: 0 }, + md: { span: 2, offset: 0 }, + lg: { span: 2, offset: 0 } + }) + .height(50).backgroundColor(0x4682B4).textAlign(TextAlign.Center) + Text('2').gridSpan(2) + + .height(50).backgroundColor(0x00BFFF).textAlign(TextAlign.Center) + Text('3').gridOffset(3) + + .height(50).backgroundColor(0x4682B4).textAlign(TextAlign.Center) + } + }.key('gridContainer4') + .width('90%') + .alignItems(HorizontalAlign.End) + + }.width('100%').margin({ top: 5 }) + } + } + .key('flex') + .width('100%') + .height('100%') + } +} diff --git a/telephony/telephonyjstest/contact_function/entry/src/main/ets/MainAbility/pages/Image.ets b/telephony/telephonyjstest/contact_function/entry/src/main/ets/MainAbility/pages/Image.ets new file mode 100644 index 000000000..5cc583e93 --- /dev/null +++ b/telephony/telephonyjstest/contact_function/entry/src/main/ets/MainAbility/pages/Image.ets @@ -0,0 +1,90 @@ +/* + * 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. + */ + +@Entry +@Component +struct image_textcase { + @State Width: number = 0 + @State height: number = 0 + + onPageShow() { + console.info('Image page show called'); + } + + onBuildDone() { + console.info('Image page build done called'); + } + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Column() { + Text(`Image page`) + .fontSize(50) + .fontWeight(FontWeight.Bold) + Image("/resources/rawfile/hand.png") + .matchTextDirection(false) + .fitOriginalSize(false) + .fillColor(0xCCCCCC) + .objectFit(ImageFit.Cover) + .objectRepeat(ImageRepeat.NoRepeat) + .interpolation(ImageInterpolation.None) + .renderMode(ImageRenderMode.Original) + .autoResize(false) + .syncLoad(false) + .sourceSize({ width: 200, height: 100 }) + .alt("/resources/rawfile/person.png") + .key('image1') + Image("/resources/rawfile/hand.png") + .objectFit(ImageFit.Contain) + .objectRepeat(ImageRepeat.X) + .interpolation(ImageInterpolation.High) + .renderMode(ImageRenderMode.Template) + .key('image2') + .height(180) + .width(180) + .onComplete((msg: { + width: number, + height: number + }) => { + this.Width = msg.width + this.height = msg.height + console.info('Width ----' + this.Width) + console.info('height ----' + this.height) + }) + .onError(() => { + console.info('load image fail') + }) + Image("/resources/rawfile/hand.png") + .objectFit(ImageFit.Fill) + .objectRepeat(ImageRepeat.Y) + .interpolation(ImageInterpolation.Low) + .key('image3') + Image("/resources/rawfile/hand.png") + .objectFit(ImageFit.None) + .objectRepeat(ImageRepeat.XY) + .interpolation(ImageInterpolation.Medium) + .key('image4') + Image("/resources/rawfile/hand.png") + .objectFit(ImageFit.ScaleDown) + .key('image5') + }.width(300) + .height(300) + .borderColor(Color.Pink) + .borderWidth(4) + } + } +} + + diff --git a/telephony/telephonyjstest/contact_function/entry/src/main/ets/MainAbility/pages/Navigator.ets b/telephony/telephonyjstest/contact_function/entry/src/main/ets/MainAbility/pages/Navigator.ets new file mode 100644 index 000000000..6c50769cf --- /dev/null +++ b/telephony/telephonyjstest/contact_function/entry/src/main/ets/MainAbility/pages/Navigator.ets @@ -0,0 +1,60 @@ +/* + * 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. + */ + +@Entry +@Component +struct navigator_testcase { + @State active: boolean = false + @State params: Object = { text: 'news' } + + onPageShow() { + console.info('Navigator page show called'); + } + + onBuildDone() { + console.info('Navigator page build done called'); + } + + build() { + Column() { + Navigator({ target: "pages/index", type: NavigationType.Back }) { + Text('Navigator test in Navigator,back') + }.active(this.active) + .key('navigator') + .params({ + data: 24 + }) + + Navigator({ target: "pages/index", type: NavigationType.Push }) { + Text('Navigator test in Navigator,push') + }.active(this.active) + .key('navigator2') + .params({ + data: 24 + }) + + Navigator({ target: "pages/index", type: NavigationType.Replace }) { + Text('Navigator test in Navigator,replace') + }.active(this.active) + .key('navigator3') + .params({ + data: 24 + }) + }.width(300) + .height(300) + .borderColor(Color.Pink) + .borderWidth(2) + } +} diff --git a/telephony/telephonyjstest/contact_function/entry/src/main/ets/MainAbility/pages/Panel.ets b/telephony/telephonyjstest/contact_function/entry/src/main/ets/MainAbility/pages/Panel.ets new file mode 100644 index 000000000..32ddabbd1 --- /dev/null +++ b/telephony/telephonyjstest/contact_function/entry/src/main/ets/MainAbility/pages/Panel.ets @@ -0,0 +1,96 @@ +/* + * 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. + */ + +@Entry +@Component +struct PanelExample { + @State show: boolean = true + + onPageShow() { + console.info('Panel page show called'); + } + + onBuildDone() { + console.info('Panel page build done called'); + } + + build() { + Column() { + Text('2021-09-30 Today Calendar: 1.afternoon......Click for details') + .width('90%') + .height(50) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + .padding({ left: 20 }) + .onClick(() => { + this.show = !this.show + }) + Panel(this.show) { + Column() { + Text('Today Calendar') + Divider() + Text('1. afternoon 4:00 The project meeting') + } + } + .key('panel') + .type(PanelType.Foldable) + .mode(PanelMode.Half) + .dragBar(true) + .fullHeight(500) + .halfHeight(250) + .miniHeight(100) + .onChange((value: any) => { + console.info(`width:${value.width},height:${value.height},mode:${value.mode}`) + }) + + Panel(this.show) { + Column() { + Text('Today Calendar') + Divider() + Text('1. afternoon 4:00 The project meeting') + } + } + .key('panel2') + .type(PanelType.Minibar) + .mode(PanelMode.Mini) + .dragBar(true) + .fullHeight(500) + .halfHeight(250) + .miniHeight(100) + .onChange((value: any) => { + console.info(`width:${value.width},height:${value.height},mode:${value.mode}`) + }) + + Panel(false) { + Column() { + Text('Today Calendar') + Divider() + Text('1. afternoon 4:00 The project meeting') + } + } + .key('panel3') + .type(PanelType.Temporary) + .mode(PanelMode.Full) + .dragBar(true) + .fullHeight(500) + .halfHeight(250) + .miniHeight(100) + .onChange((value: any) => { + console.info(`width:${value.width},height:${value.height},mode:${value.mode}`) + }) + + }.width('100%').height('50%').backgroundColor(0xDCDCDC).padding({ top: 5 }) + } +} \ No newline at end of file diff --git a/telephony/telephonyjstest/contact_function/entry/src/main/ets/MainAbility/pages/Progress.ets b/telephony/telephonyjstest/contact_function/entry/src/main/ets/MainAbility/pages/Progress.ets new file mode 100644 index 000000000..c8608089f --- /dev/null +++ b/telephony/telephonyjstest/contact_function/entry/src/main/ets/MainAbility/pages/Progress.ets @@ -0,0 +1,76 @@ +/* + * 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. + */ + +@Entry +@Component +struct progress_testcase { + onPageShow() { + console.info('Progress page show called'); + } + + onBuildDone() { + console.info('Progress page build done called'); + } + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Column() { + Text(`Progress page`) + .fontSize(50) + .fontWeight(FontWeight.Bold) + Progress({ value: 20, total: 40, style: ProgressStyle.Linear }) + .value(3) + .color(Color.Blue) + .width(50) + .height(70) + .key('progress') + + Progress({ value: 20, total: 40, style: ProgressStyle.Eclipse }) + .value(3) + .color(Color.Blue) + .width(50) + .height(70) + .key('progress2') + + Progress({ value: 20, total: 40, style: ProgressStyle.Ring }) + .value(3) + .color(Color.Blue) + .width(50) + .height(70) + .key('progress3') + + Progress({ value: 20, total: 40, style: ProgressStyle.ScaleRing }) + .value(3) + .color(Color.Blue) + .width(50) + .height(70) + .key('progress4') + + Progress({ value: 20, total: 40, style: ProgressStyle.Capsule }) + .value(3) + .color(Color.Blue) + .width(50) + .height(70) + .key('progress5') + + } + .width(400) + .height(400) + .borderColor(Color.Pink) + .borderWidth(2) + } + } +} + diff --git a/telephony/telephonyjstest/contact_function/entry/src/main/ets/MainAbility/pages/Qrcode.ets b/telephony/telephonyjstest/contact_function/entry/src/main/ets/MainAbility/pages/Qrcode.ets new file mode 100644 index 000000000..5c0dd84ef --- /dev/null +++ b/telephony/telephonyjstest/contact_function/entry/src/main/ets/MainAbility/pages/Qrcode.ets @@ -0,0 +1,44 @@ +/* + * 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. + */ + +@Entry +@Component +struct qrcode_textcase { + @State Color: Color = Color.Pink + + onPageShow() { + console.info('Qrcode page show called'); + } + + onBuildDone() { + console.info('Qrcode page build done called'); + } + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Text(`Qrcode page`) + .fontSize(50) + .fontWeight(FontWeight.Bold) + QRCode('hello world') + .color("#FFFFC0CB") + .backgroundColor(this.Color) + .width("200") + .height("100") + .key('qrcode') + } + } +} + + diff --git a/telephony/telephonyjstest/contact_function/entry/src/main/ets/MainAbility/pages/Rating.ets b/telephony/telephonyjstest/contact_function/entry/src/main/ets/MainAbility/pages/Rating.ets new file mode 100644 index 000000000..b29e26a39 --- /dev/null +++ b/telephony/telephonyjstest/contact_function/entry/src/main/ets/MainAbility/pages/Rating.ets @@ -0,0 +1,63 @@ +/* + * 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. + */ + +@Entry +@Component +struct rating_testcase { + @State rating: number = 2 + + onPageShow() { + console.info('Rating page show called'); + } + + onBuildDone() { + console.info('Rating page build done called'); + } + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Column() { + Text(`Rating page`) + .fontSize(50) + .fontWeight(FontWeight.Bold) + Rating({ rating: 2, indicator: false }) + .stepSize(0.5) + .stars(5) + .starStyle({ + backgroundUri: '/resources/rawfile/star-1-1.png', + foregroundUri: '/resources/rawfile/star-1-3.png', + secondaryUri: '/resources/rawfile/star-1-2.png' + }) + .onChange((value: number) => { + this.rating = value + }) + .key('rating1') + Rating({ rating: 2, indicator: true }) + .stepSize(0.5) + .stars(5) + .starStyle({ + backgroundUri: '/resources/rawfile/star-1-1.png', + foregroundUri: '/resources/rawfile/star-1-3.png', + secondaryUri: '/resources/rawfile/star-1-2.png' + }) + .key('rating2') + }.width(300) + .height(300) + .borderColor(Color.Pink) + .borderWidth(2) + } + } +} + diff --git a/telephony/telephonyjstest/contact_function/entry/src/main/ets/MainAbility/pages/RowSplit.ets b/telephony/telephonyjstest/contact_function/entry/src/main/ets/MainAbility/pages/RowSplit.ets new file mode 100644 index 000000000..0f4f397b1 --- /dev/null +++ b/telephony/telephonyjstest/contact_function/entry/src/main/ets/MainAbility/pages/RowSplit.ets @@ -0,0 +1,78 @@ +/* + * 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 router from '@system.router' + +@Entry +@Component +struct rowSplit_testcase { + @State resizeable: boolean = false + private content: string = "rowSplit Page"; + + onPageShow() { + console.info('RowSplit page show called'); + } + + onBuildDone() { + console.info('RowSplit page build done called'); + } + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Text(`${this.content}`) + .fontSize(50) + .fontWeight(FontWeight.Bold) + RowSplit() { + Column() { + Text('Demo1.RowSplit') + .fontSize(15) + .fontWeight(FontWeight.Bold) + } + + Column() { + Text('Demo2.RowSplit') + .fontSize(15) + .fontWeight(FontWeight.Bold) + } + } + .height(100) + .key('rowSplit') + .resizeable(this.resizeable) + .onClick(() => { + router.back() + }) + + RowSplit() { + Column() { + Text('Demo3.RowSplit') + .fontSize(15) + .fontWeight(FontWeight.Bold) + } + + Column() { + Text('Demo4.RowSplit') + .fontSize(15) + .fontWeight(FontWeight.Bold) + } + }.height(100) + .key('rowSplit1') + .resizeable(true) + } + .key('flex') + .width('100%') + .height('100%') + } +} + diff --git a/telephony/telephonyjstest/contact_function/entry/src/main/ets/MainAbility/pages/Scroll.ets b/telephony/telephonyjstest/contact_function/entry/src/main/ets/MainAbility/pages/Scroll.ets new file mode 100644 index 000000000..363089d22 --- /dev/null +++ b/telephony/telephonyjstest/contact_function/entry/src/main/ets/MainAbility/pages/Scroll.ets @@ -0,0 +1,200 @@ +/* + * 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. + */ + +@Entry +@Component +struct scroll_testcase { + @State scrollBarWidth: number = 20 + @State scrollable: ScrollDirection = ScrollDirection.None + @State scrollBarColor: Color = Color.Pink + @State scrollBar: BarState= BarState.On + private value1: Array = [1, 2, 3, 4, 5, 6, 7, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30] + @State edge: Edge= Edge.Top + private content: string = "Scroll Page"; + scroller: Scroller = new Scroller(); + + onPageShow() { + console.info('Button page show called'); + } + + onBuildDone() { + console.info('Button page build done called'); + } + + build() { + + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Text(`${this.content}`) + .fontSize(50) + .fontWeight(FontWeight.Bold) + Scroll(this.scroller) { + Column() { + ForEach( + this.value1, + item => { + Text(`${item}`) + .fontSize(15) + .width(400) + .margin(10) + .height(70) + .backgroundColor(0xfff5deb3) + }, + item => item + ) + } + } + .scrollable(ScrollDirection.Vertical) + .scrollBar(this.scrollBar) + .scrollBarColor(this.scrollBarColor) + .scrollBarWidth(this.scrollBarWidth) + .key('scroll') + .width(400) + .height(200) + .onScroll((xOffset: number, yOffset: number) => { + console.info(` current offset is ${xOffset} ${yOffset}`) + }) + .onScrollEnd(() => { + console.info(` now on scroll end`) + }) + .onScrollEdge((side: Edge) => { + console.info(`To the edge`) + }) + Scroll() { + Row() { + Text('scroll uppppp') + .width(60) + .height(100) + .backgroundColor(Color.Yellow) + .margin({ + right: 5, + left: 5 + }) + .key('text') + + Text('scroll to') + .width(60) + .height(100) + .backgroundColor(Color.Green) + .margin({ + right: 5, + left: 5 + }) + .onClick(() => { + this.scroller.scrollTo({ + xOffset: 100, + yOffset: 100, + }) + }) + Text('scroll page') + .width(60) + .height(100) + .backgroundColor(Color.Blue) + .margin({ + right: 5, + left: 5 + }) + .onClick(() => { + this.scroller.scrollPage({ + next: true + }) + }) + Text('scroll Edge') + .width(60) + .height(100) + .backgroundColor(Color.Blue) + .margin({ + right: 5, + left: 5 + }) + .onClick(() => { + this.scroller.scrollEdge(Edge.Top) + }) + Text('scroll Edge') + .width(60) + .height(100) + .backgroundColor(Color.Blue) + .margin({ + right: 5, + left: 5 + }) + .onClick(() => { + this.scroller.currentOffset() + }) + Text('scroll to index') + .width(60) + .height(100) + .backgroundColor(Color.Blue) + .margin({ + right: 5, + left: 5 + }) + .onClick(() => { + this.scroller.scrollToIndex(0) + console.info(` now on scroll end`) + }) + } + } + .key('scroll1') + .height(100) + .scrollable(ScrollDirection.Horizontal) + + Scroll() { + Column() { + Text("start").fontSize(30) + Text("scrollable1") + Text("scrollable2") + Text("scrollable3") + Text("scrollable4") + Text("scrollable1") + Text("scrollable2") + Text("scrollable3") + Text("scrollable4") + } + } + .padding(10) + .scrollable(ScrollDirection.None) + .scrollBar(BarState.Off) + .scrollBarColor(Color.Red) + .scrollBarWidth(5) + .width(300) + .height(200) + .key('scroll2') + + Scroll() { + Column() { + Text("start").fontSize(30) + Text("scrollable1") + Text("scrollable2") + Text("scrollable3") + Text("scrollable4") + Text("scrollable1") + Text("scrollable2") + Text("scrollable3") + Text("scrollable4") + } + } + .padding(10) + .scrollable(ScrollDirection.Free) + .scrollBar(BarState.Off) + .scrollBarColor(Color.Red) + .scrollBarWidth(5) + .width(300) + .height(200) + .key('scroll3') + } + .key('flex') + + } +} diff --git a/telephony/telephonyjstest/contact_function/entry/src/main/ets/MainAbility/pages/Slider.ets b/telephony/telephonyjstest/contact_function/entry/src/main/ets/MainAbility/pages/Slider.ets new file mode 100644 index 000000000..625cd0287 --- /dev/null +++ b/telephony/telephonyjstest/contact_function/entry/src/main/ets/MainAbility/pages/Slider.ets @@ -0,0 +1,82 @@ +/* + * 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. + */ + +@Entry +@Component +struct slider { + @State inSetValue: number= 40 + @State outSetValue: number= 40 + @State direction: Axis= Axis.Horizontal + @State Begin: number = SliderChangeMode.Begin + + onPageShow() { + console.info('Slider page show called'); + } + + onBuildDone() { + console.info('Slider page build done called'); + } + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Column() { + Text(`Slider page`) + .fontSize(50) + .fontWeight(FontWeight.Bold) + Slider({ + value: this.outSetValue, + min: 0, + max: 100, + step: 1, + direction: Axis.Horizontal, + reverse: false, + style: SliderStyle.OutSet + }) + .blockColor('#FFFF0000') + .selectedColor('#FF0000FF') + .trackColor('#FF808080') + .minLabel('10') + .maxLabel('10') + .showTips(false) + .showSteps(false) + .onChange((value: number, mode: SliderChangeMode) => { + this.outSetValue = value + this.Begin = mode + console.info('value: ' + value + '---mode: ' + mode) + }) + .width("100") + .height("100") + .key('slider1') + Slider({ + value: 40, + min: 0, + max: 100, + step: 1, + style: SliderStyle.InSet + }) + .blockColor(Color.Red) + .selectedColor(Color.Blue) + .trackColor(Color.Gray) + .showTips(true) + .showSteps(true) + .key('slider2') + }.width(300) + .height(300) + .borderColor(Color.Pink) + .borderWidth(2) + } + } +} + diff --git a/telephony/telephonyjstest/contact_function/entry/src/main/ets/MainAbility/pages/Span.ets b/telephony/telephonyjstest/contact_function/entry/src/main/ets/MainAbility/pages/Span.ets new file mode 100644 index 000000000..df5a71043 --- /dev/null +++ b/telephony/telephonyjstest/contact_function/entry/src/main/ets/MainAbility/pages/Span.ets @@ -0,0 +1,64 @@ +/* + * 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. + */ + +@Entry +@Component +struct span_textcase { + + onPageShow() { + console.info('Span page show called'); + } + + onBuildDone() { + console.info('Span page build done called'); + } + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Column() { + Text() { + Span('Test Span demo') + .decoration({ type: TextDecorationType.LineThrough, "color": Color.Red }) + .textCase(TextCase.UpperCase) + .fontColor(Color.Blue) + .fontSize("20fp") + .letterSpacing(5) + .fontFamily("sans-serif") + .fontWeight(FontWeight.Bold) + .fontStyle(FontStyle.Italic) + .key('span1') + Span('The second test Span demo') + .textCase(TextCase.LowerCase) + .fontColor(Color.Black) + .letterSpacing('5') + .fontSize(30) + .key('span2') + Span('The third test Span demo') + .textCase(TextCase.Normal) + .fontColor(Color.Yellow) + .fontSize("30fp") + .key('span3') + } + } + .width(300) + .height(300) + .borderColor(Color.Pink) + .borderWidth(4) + } + } +} + + + diff --git a/telephony/telephonyjstest/contact_function/entry/src/main/ets/MainAbility/pages/Stack.ets b/telephony/telephonyjstest/contact_function/entry/src/main/ets/MainAbility/pages/Stack.ets new file mode 100644 index 000000000..2a694889f --- /dev/null +++ b/telephony/telephonyjstest/contact_function/entry/src/main/ets/MainAbility/pages/Stack.ets @@ -0,0 +1,103 @@ +/* + * 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 router from '@system.router' + +@Entry +@Component +struct stack_testcase { + @State alignContent: Alignment = Alignment.Bottom + private content: string = "Stack Page"; + + onPageShow() { + console.info('Stack page show called'); + } + + onBuildDone() { + console.info('Stack page build done called'); + } + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Text(`${this.content}`) + .fontSize(50) + .fontWeight(FontWeight.Bold) + Stack({ alignContent: this.alignContent }) { + Text('First child, show in bottom').width('90%').height('100%').backgroundColor(0xd2cab3).align(Alignment.Top) + Text('Second child, show in top').width('70%').height('60%').backgroundColor(0xc1cbac).align(Alignment.Top) + } + .width('100%') + .height(80) + .margin({ top: 5 }) + .key('stack') + .onClick(() => { + router.back() + }) + + Stack({ alignContent: Alignment.BottomStart }) { + Text('First child, show in bottom').width('90%').height('100%').backgroundColor(0xd2cab3).align(Alignment.Top) + Text('Second child, show in top').width('70%').height('60%').backgroundColor(0xc1cbac).align(Alignment.Top) + }.width('100%').height(80).margin({ top: 5 }) + .key('stack1') + + Stack({ alignContent: Alignment.BottomEnd }) { + Text('First child, show in bottom').width('90%').height('100%').backgroundColor(0xd2cab3).align(Alignment.Top) + Text('Second child, show in top').width('70%').height('60%').backgroundColor(0xc1cbac).align(Alignment.Top) + }.width('100%').height(80).margin({ top: 5 }) + .key('stack2') + + Stack({ alignContent: Alignment.Start }) { + Text('First child, show in bottom').width('90%').height('100%').backgroundColor(0xd2cab3).align(Alignment.Top) + Text('Second child, show in top').width('70%').height('60%').backgroundColor(0xc1cbac).align(Alignment.Top) + }.width('100%').height(80).margin({ top: 5 }) + .key('stack3') + + Stack({ alignContent: Alignment.Center }) { + Text('First child, show in bottom').width('90%').height('100%').backgroundColor(0xd2cab3).align(Alignment.Top) + Text('Second child, show in top').width('70%').height('60%').backgroundColor(0xc1cbac).align(Alignment.Top) + }.width('100%').height(80).margin({ top: 5 }) + .key('stack4') + + Stack({ alignContent: Alignment.End }) { + Text('First child, show in bottom').width('90%').height('100%').backgroundColor(0xd2cab3).align(Alignment.Top) + Text('Second child, show in top').width('70%').height('60%').backgroundColor(0xc1cbac).align(Alignment.Top) + }.width('100%').height(80).margin({ top: 5 }) + .key('stack5') + + Stack({ alignContent: Alignment.Top }) { + Text('First child, show in bottom').width('90%').height('100%').backgroundColor(0xd2cab3).align(Alignment.Top) + Text('Second child, show in top').width('70%').height('60%').backgroundColor(0xc1cbac).align(Alignment.Top) + }.width('100%').height(60).margin({ top: 5 }) + .key('stack6') + + Stack({ alignContent: Alignment.TopStart }) { + Text('First child, show in bottom').width('90%').height('100%').backgroundColor(0xd2cab3).align(Alignment.Top) + Text('Second child, show in top').width('70%').height('60%').backgroundColor(0xc1cbac).align(Alignment.Top) + }.width('100%').height(60).margin({ top: 5 }) + .key('stack7') + + Stack({ alignContent: Alignment.TopEnd }) { + Text('First child, show in bottom').width('90%').height('100%').backgroundColor(0xd2cab3).align(Alignment.Top) + Text('Second child, show in top').width('70%').height('60%').backgroundColor(0xc1cbac).align(Alignment.Top) + }.width('100%').height(60).margin({ top: 5 }) + .key('stack8') + } + .key('flex') + .width('100%') + .height('100%') + + } +} + diff --git a/telephony/telephonyjstest/contact_function/entry/src/main/ets/MainAbility/pages/Text.ets b/telephony/telephonyjstest/contact_function/entry/src/main/ets/MainAbility/pages/Text.ets new file mode 100644 index 000000000..fbd1415dc --- /dev/null +++ b/telephony/telephonyjstest/contact_function/entry/src/main/ets/MainAbility/pages/Text.ets @@ -0,0 +1,237 @@ +/* + * 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. + */ + +// @ts-nocheck +import router from '@system.router' + +var paramInfo = router.getParams() +console.info("cd paramInfo" + JSON.stringify(paramInfo)) + +@Entry +@Component +struct text_textcase { + @State textAlign: TextAlign= TextAlign.End + @State lineHeight: string= '15fp' + @State overflow: TextOverflow = TextOverflow.Ellipsis + @State textOverflow: textOverflow<{ "overflow": TextOverflow }> = { "overflow": this.overflow } + @State maxLines: number = 2 + @State baselineOffset: number = 0 + @State textCase: TextCase= TextCase.Normal + @State decoration: decoration<{ + type: TextDecorationType, + color: Color + }> = { type: TextDecorationType.Underline, color: Color.Red } + @State color: Color = Color.Red + @State width: string= "200" + @State height: string= "100" + @State size: size = { width: 200, height: 100 } + @State marginBottom: string = "10px" + @State marginTop: string = "10px" + @State marginLeft: string = "10px" + @State marginRingt: string= "10px" + @State paddingBottom: string= "5" + @State paddingTop: string= "5" + @State paddingLeft: string= "5" + @State paddingRingt: string= "5" + @State constraintSize: constraintSize = { minWidth: 20, maxWidth: 200, minHeight: 0, maxHeight: 50 } + @State layoutPriority: string= "9px" + @State layoutWeight: string = "10px" + @State align: Alignment = Alignment.Center + @State direction: Direction = Direction.Auto + @State position: position<{ + x: string, + y: string + }> = { x: "50", y: "50" } + @State markAnchor: markAnchor<{ + x: string, + y: string + }> = { x: "50", y: "50" } + @State offset: offset<{ + x: string, + y: string + }> = { x: "50", y: "50" } + @State flexGrow: number = 5 + @State flexShrink: number = 2 + @State flexBasis: number = 0 + @State alignSelf: ItemAlign = ItemAlign.Auto + @State borderStyle: BorderStyle = BorderStyle.Dashed + @State borderRadius: number = 10 + @State borderWidth: string= "4px" + @State borderColor: Color= Color.Blue + @State backgroundColor: Color = Color.Pink + @State backgroundImageSize: ImageSize = ImageSize.Cover + @State backgroundImagePosition: Alignment= Alignment.Center + @State opacity: number= 1 + @State visibility: Visibility= Visibility.Visible + @State enabled: boolean = false + @State zIndex: number = 1 + @State fontStyle: FontStyle = FontStyle.Italic + @State fontSize: number = 15 + @State minFontSize: number = 15 + @State maxFontSize: number = 15 + @State letterSpacing: number= 10 + @State fontWeight: FontWeight= FontWeight.Bold + @State fontColor: Color= Color.Black + @State active: boolean = false + private content: string = "Text Page"; + + onPageShow() { + console.info('Text page show called'); + } + + onBuildDone() { + console.info('Text page build done called'); + } + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Text(`${this.content}`) + .fontSize(50) + .fontWeight(FontWeight.Bold) + Text('Text Anto test,Text Anto test,Text Anto test,Text Anto test,test,Text Anto test,Text Anto test,Text Anto test,Text Anto test,Text Anto test,Text Anto test') + .width(this.width) + .height(this.height) + .padding({ bottom: this.paddingBottom, top: this.paddingTop, right: this.paddingRingt, left: this.paddingLeft }) + .margin({ bottom: this.marginBottom, top: this.marginTop, right: this.marginRingt, left: this.marginLeft }) + .constraintSize(this.constraintSize) + .layoutWeight(this.layoutWeight) + .align(this.align) + .direction(this.direction) + .position(this.position) + .markAnchor(this.markAnchor) + .offset(this.offset) + .flexBasis(this.flexBasis) + .flexGrow(this.flexGrow) + .flexShrink(this.flexShrink) + .alignSelf(this.alignSelf) + .borderStyle(this.borderStyle) + .borderRadius(this.borderRadius) + .borderWidth(this.borderWidth) + .borderColor(this.borderColor) + .backgroundColor(this.backgroundColor) + .opacity(this.opacity) + .visibility(this.visibility) + .enabled(this.enabled) + .zIndex(this.zIndex) + .fontColor(this.fontColor) + .fontSize(this.fontSize) + .minFontSize(this.minFontSize) + .letterSpacing(this.letterSpacing) + .maxFontSize(this.maxFontSize) + .fontWeight(this.fontWeight) + .fontStyle(this.fontStyle) + .fontFamily("sans-serif") + .textAlign(this.textAlign) + .textOverflow(this.textOverflow) + .lineHeight(this.lineHeight) + .baselineOffset(this.baselineOffset) + .maxLines(2) + .textCase(this.textCase) + .decoration(this.decoration) + .aspectRatio(1) + .fontColor(Color.Black) + .key('Text') + Text('Text Anto test,Text Anto test,Text Anto test,Text Anto test,Text Anto test,Text Anto test,Text Anto test,Text Anto test') + .size({ width: 100, height: 50 }) + .padding({ bottom: 5, top: 5, right: 5, left: 10 }) + .margin({ bottom: 15, top: 10, right: 10, left: 10 }) + .fontSize('13') + .textAlign(TextAlign.Start) + .align(Alignment.Start) + .direction(Direction.Ltr) + .alignSelf(ItemAlign.Start) + .borderStyle(BorderStyle.Dotted) + .borderWidth(2) + .visibility(Visibility.Hidden) + .enabled(true) + .fontWeight(FontWeight.Normal) + .textAlign(TextAlign.Start) + .textOverflow(TextOverflow.Clip) + .maxLines(2) + .textCase(TextCase.LowerCase) + .decoration({ "type": TextDecorationType.LineThrough, "color": Color.Red }) + .fontColor(Color.White) + .key('Text1') + Text('Text Anto test,Text Anto test,Text Anto test,Text Anto test,Text Anto test,Text Anto test,Text Anto test,Text Anto test,Text Anto test') + .fontSize(13) + .width('100%') + .textAlign(TextAlign.Center) + .align(Alignment.TopEnd) + .direction(Direction.Rtl) + .alignSelf(ItemAlign.Center) + .borderStyle(BorderStyle.Solid) + .borderWidth(2) + .visibility(Visibility.None) + .fontWeight(FontWeight.Bolder) + .textAlign(TextAlign.Center) + .textOverflow(TextOverflow.None) + .textCase(TextCase.UpperCase) + .decoration({ "type": TextDecorationType.None, "color": Color.Red }) + .fontColor(Color.Blue) + .key('Text2') + Text('Text Anto test,Text Anto test,Text Anto test,Text Anto test') + .fontSize(13) + .align(Alignment.Top) + .alignSelf(ItemAlign.End) + .borderWidth(2) + .width('100%') + .fontWeight(FontWeight.Lighter) + .decoration({ type: TextDecorationType.Overline, color: Color.Red }) + .fontColor(Color.Gray) + .key('Text3') + Text('Text Anto test,Text Anto test') + .fontSize(13) + .align(Alignment.TopStart) + .alignSelf(ItemAlign.Baseline) + .borderWidth(2) + .width('100%') + .fontWeight(FontWeight.Medium) + .fontColor(Color.Brown) + .key('Text4') + Text('Text Anto test,Text Anto test,Text Anto test') + .fontSize(13) + .align(Alignment.End) + .alignSelf(ItemAlign.Stretch) + .borderWidth(2) + .width('100%') + .fontWeight(FontWeight.Regular) + .fontColor(Color.Grey) + .key('Text5') + Text('Text Anto test,Text Anto test,Text Anto test') + .fontSize(13) + .align(Alignment.BottomEnd) + .width('100%') + .fontColor(Color.Orange) + .key('Text6') + Text('Text Anto test,Text Anto test,Text Anto test') + .fontSize(13) + .align(Alignment.Bottom) + .width('100%') + .fontColor(Color.Yellow) + .key('Text7') + Text('Text Anto test,Text Anto test,Text Anto test') + .fontSize(13) + .align(Alignment.BottomStart) + .width('100%') + .key('Text8') + + } + .key('flex') + .width('100%') + .height('100%') + } +} + + diff --git a/telephony/telephonyjstest/contact_function/entry/src/main/ets/MainAbility/pages/index.ets b/telephony/telephonyjstest/contact_function/entry/src/main/ets/MainAbility/pages/index.ets new file mode 100644 index 000000000..10359134d --- /dev/null +++ b/telephony/telephonyjstest/contact_function/entry/src/main/ets/MainAbility/pages/index.ets @@ -0,0 +1,65 @@ +// @ts-nocheck +/** + * 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 file from '@system.file'; + +import {Core, ExpectExtend, InstrumentLog, ReportExtend} from "deccjsunit/index.ets"; +import testsuite from "../test/List.test.ets"; +import featureAbility from "@ohos.ability.featureAbility"; + +@Entry +@Component +struct MyComponent { + aboutToAppear() { + console.info("start run testcase!!!!") + featureAbility.getWant() + .then((Want) => { + const core = Core.getInstance(); + const expectExtend = new ExpectExtend({ + 'id': 'extend' + }); + core.addService('expect', expectExtend); + const reportExtend = new ReportExtend(file); + core.addService('report', reportExtend); + core.init(); + core.subscribeEvent('task', reportExtend); + const configService = core.getDefaultService('config'); + Want.parameters['timeout'] = 100000 + console.info('parameters---->' + JSON.stringify(Want.parameters)); + configService.setConfig(Want.parameters); + testsuite(); + core.execute(); + console.info('Operation successful. Data: ' + JSON.stringify(Want)); + }) + .catch((error) => { + console.error('Operation failed. Cause: ' + JSON.stringify(error)); + }) + } + + build() { + Flex({ + direction: FlexDirection.Column, + alignItems: ItemAlign.Center, + justifyContent: FlexAlign.Center + }) { + Text('ACE ETS TEST') + .fontSize(50) + .fontWeight(FontWeight.Bold) + } + .width('100%') + .height('100%') + } +} + diff --git a/telephony/telephonyjstest/contact_function/entry/src/main/ets/MainAbility/test/List.test.ets b/telephony/telephonyjstest/contact_function/entry/src/main/ets/MainAbility/test/List.test.ets new file mode 100644 index 000000000..0da9c5410 --- /dev/null +++ b/telephony/telephonyjstest/contact_function/entry/src/main/ets/MainAbility/test/List.test.ets @@ -0,0 +1,38 @@ +/** + * 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. + */ + +//contact import +import CalllogTest from './contact/Calllog_test.js' +import ContactCardTest from './contact/ContactCard_test.js' +import ContactsTest from './contact/Contacts_test.js' +import GroupsTest from './contact/Groups_test.js' +import ObjectInterfaceTest from './contact/ObjectInterface_test.js' +import RecoveryTest from './contact/recovery_test.js' +import VoicemailTest from './contact/Voicemail_test.js' +import ContactClassTest from './contact/ContactClass_test.js' +import ContacterTest from './contact/ContacterJsunit.ets' + +export default function testsuite() { + //contact + ContactClassTest(); + ContacterTest(); + CalllogTest(); + ContactCardTest(); + ContactsTest(); + GroupsTest(); + ObjectInterfaceTest(); + RecoveryTest(); + VoicemailTest(); +} \ No newline at end of file diff --git a/telephony/telephonyjstest/contact_function/entry/src/main/ets/MainAbility/test/Utils.ets b/telephony/telephonyjstest/contact_function/entry/src/main/ets/MainAbility/test/Utils.ets new file mode 100644 index 000000000..65f70088d --- /dev/null +++ b/telephony/telephonyjstest/contact_function/entry/src/main/ets/MainAbility/test/Utils.ets @@ -0,0 +1,119 @@ +// @ts-nocheck +/** + * 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 class Utils { + static rect_left; + static rect_top; + static rect_right; + static rect_bottom; + static rect_value; + static notCheck = true; + + static sleep(time) { + return new Promise((resolve, reject) => { + setTimeout(() => { + resolve() + }, time) + }).then(() => { + console.info(`sleep ${time} over...`) + }) + } + + static getComponentRect(key) { + let strJson = getInspectorByKey(key); + let obj = JSON.parse(strJson); + console.info("[getInspectorByKey] current component obj is: " + JSON.stringify(obj)); + let rectInfo = JSON.parse('[' + obj.$rect + ']') + console.info("[getInspectorByKey] rectInfo is: " + rectInfo); + this.rect_left = JSON.parse('[' + rectInfo[0] + ']')[0] + this.rect_top = JSON.parse('[' + rectInfo[0] + ']')[1] + this.rect_right = JSON.parse('[' + rectInfo[1] + ']')[0] + this.rect_bottom = JSON.parse('[' + rectInfo[1] + ']')[1] + return this.rect_value = { + "left": this.rect_left, "top": this.rect_top, "right": this.rect_right, "bottom": this.rect_bottom + } + } + + static async swipe(downX, downY, upX, upY, steps) { + console.info('start to swipe') + this.drags(downX, downY, upX, upY, steps, false) + } + + static async drag(downX, downY, upX, upY, steps) { + console.info('start to drag') + this.drags(downX, downY, upX, upY, steps, true) + } + + static async drags(downX, downY, upX, upY, steps, drag) { + var xStep; + var yStep; + var swipeSteps; + var ret; + xStep = 0; + yStep = 0; + ret = false; + swipeSteps = steps; + if (swipeSteps == 0) { + swipeSteps = 1; + } + xStep = (upX - downX) / swipeSteps; + yStep = (upY - downY) / swipeSteps; + console.info('move step is: ' + 'xStep: ' + xStep + ' yStep: ' + yStep) + var downPonit: TouchObject = { + id: 1, + x: downX, + y: downY, + type: TouchType.Down, + } + console.info('down touch started: ' + JSON.stringify(downPonit)) + sendTouchEvent(downPonit); + console.info('start to move') + if (drag) { + await this.sleep(500) + } + for (var i = 1;i <= swipeSteps; i++) { + var movePoint: TouchObject = { + id: 1, + x: downX + (xStep * i), + y: downY + (yStep * i), + type: TouchType.Move + } + console.info('move touch started: ' + JSON.stringify(movePoint)) + ret = sendTouchEvent(movePoint) + if (ret == false) { + break; + } + await this.sleep(5) + } + console.info('start to up') + if (drag) { + await this.sleep(100) + } + var upPoint: TouchObject = { + id: 1, + x: upX, + y: upY, + type: TouchType.Up, + } + console.info('up touch started: ' + JSON.stringify(upPoint)) + sendTouchEvent(upPoint) + await this.sleep(500) + } +} + + + + diff --git a/telephony/telephonyjstest/contact_function/entry/src/main/ets/MainAbility/test/contact/Calllog_test.js b/telephony/telephonyjstest/contact_function/entry/src/main/ets/MainAbility/test/contact/Calllog_test.js new file mode 100644 index 000000000..b1c43b955 --- /dev/null +++ b/telephony/telephonyjstest/contact_function/entry/src/main/ets/MainAbility/test/contact/Calllog_test.js @@ -0,0 +1,1361 @@ +/* + * 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 featureAbility from '@ohos.ability.featureAbility'; +import ohosDataAbility from '@ohos.data.dataability'; +import {afterAll, afterEach, beforeAll, beforeEach, describe, expect, it} from 'deccjsunit/index' + +const URI_CALLLOG = "dataability:///com.ohos.calllogability"; +const calllogUri = "dataability:///com.ohos.calllogability/calls/calllog"; +import common from './common.js'; + +export default function CalllogTest() { + describe('CalllogTest', function () { + console.log("----------CalllogTest is starting!----------"); + + async function calllogQueryForALL(map, tag) { + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CALLLOG); + console.info(tag + ': calllogQueryByInsert start ! DAHelper = ' + DAHelper); + var resultColumns = common.getCallLogResultColumns(); + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("id", map.get("id")); + try { + var resultSet = await DAHelper.query(calllogUri, resultColumns, condition); + if (resultSet.rowCount > 0 && resultSet.goToFirstRow()) { + do { + for (var [key, value] of map) { + var dbresult = resultSet.getString(resultSet.getColumnIndex(key)); + console.info(tag + ' : logMessage calllogQueryByInsert key = ' + key + + ' dbResult :' + dbresult + ' value : ' + value); + console.info(tag + ' : logMessage calllogQueryByInsert value ' + (value == dbresult)); + expect(value == dbresult).assertEqual(true); + } + } while (resultSet.goToNextRow()); + } + console.info(tag + " :logMessage calllogQueryByInsert: end"); + resultSet.close(); + } catch (error) { + console.info(tag + " :logMessage calllogQueryByInsert: error = " + error); + } + } + + async function calllogQueryForDelete(map, tag) { + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CALLLOG); + console.info(tag + ': calllogQueryForDelete start ! DAHelper = ' + DAHelper); + var resultColumns = common.getCallLogResultColumns(); + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("id", map.get("id")); + try { + var resultSet = await DAHelper.query(calllogUri, resultColumns, condition); + expect(resultSet.goToFirstRow() == false).assertTrue(); + console.info(tag + " :logMessage calllogQueryForDelete: goToFirstRow " + resultSet.goToFirstRow()); + resultSet.close(); + } catch (error) { + console.info(tag + " :logMessage calllogQueryForDelete: error = " + error); + } + } + + async function calllogQueryForBatchInsert(array, tag) { + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CALLLOG); + console.info(tag + ': calllogQueryForBatchInsert start ! DAHelper = ' + DAHelper); + var resultColumns = common.getCallLogResultColumns(); + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("phone_number", array[0].get("phone_number")); + try { + var resultSet = await DAHelper.query(calllogUri, resultColumns, condition); + var size = array.size(); + console.info(tag + ' : logMessage calllogQueryForBatchInsert: size' + size); + expect(resultSet.rowCount == size).assertEqual(true); + var i = 0; + if (resultSet.rowCount > 0 && resultSet.goToFirstRow()) { + do { + for (var [key, value] of array[i]) { + var dbresult = resultSet.getString(resultSet.getColumnIndex(key)); + console.info(tag + ' : logMessage calllogQueryForBatchInsert dbresult :' + dbresult + + ' value : ' + value); + console.info(tag + ' : logMessage calllogQueryForBatchInsert value ' + (value == dbresult)); + expect(value == dbresult).assertTrue(); + } + i++; + } while (resultSet.goToNextRow()); + } + + resultSet.close(); + } catch (error) { + console.info(tag + " :logMessage calllogQueryByInsert: error = " + error); + } + } + + async function callLogDelete(tag) { + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CALLLOG); + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.greaterThan("id", "0"); + var deleteCode = await DAHelper.delete(calllogUri, condition); + console.info(tag + ': callLogDelete deleteCode = ' + deleteCode); + expect(deleteCode == 0).assertTrue(); + } + + /** + * @tc.number calllog_insert_test_100 + * @tc.name Insert call log + * @tc.desc Function test + */ + it("calllog_insert_test_100", 0, async function (done) { + console.info("--------logMessage calllog_insert_test_100 is starting!------------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CALLLOG); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + try { + var calllogId = await DAHelper.insert(calllogUri, common.getCallLogInsert()); + console.info("logMessage calllog_insert_test_100: calllogId = " + calllogId); + expect(calllogId > 0).assertTrue(); + var map = common.getCallLogInsertMap() + map.set("id", calllogId.toString()); + await calllogQueryForALL(map, "calllog_insert_test_100"); + await callLogDelete("calllog_insert_test_100"); + done(); + } catch (error) { + console.info("logMessage calllog_insert_test_100: calllog insert error = " + error); + done(); + } + }); + + /** + * @tc.number calllog_update_test_400 + * @tc.name Single call log update + * @tc.desc Function test + */ + it("calllog_update_test_400", 0, async function (done) { + console.info("--------logMessage calllog_update_test_400 is starting!------------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CALLLOG); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + try { + var calllogId = await DAHelper.insert(calllogUri, common.getCallLogInsert()); + console.info("logMessage calllog_update_test_400: calllogId = " + calllogId); + expect(calllogId > 0).assertTrue(); + await updateOneCalllog(); + done(); + } catch (error) { + console.info("logMessage calllog_update_test_400: calllog insert error = " + error); + done(); + } + ; + + async function updateOneCalllog() { + try { + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("id", calllogId.toString()); + var updateCode = await DAHelper.update(calllogUri, common.getCallLogUpdate(), condition); + console.info("logMessage calllog_update_test_400: updateCode = " + updateCode); + expect(updateCode == 0).assertTrue(); + var map = common.getCallLogUpdateMap(); + map.set("id", calllogId.toString()); + await calllogQueryForALL(map, "calllog_update_test_400"); + await callLogDelete("calllog_update_test_400"); + } catch (error) { + console.info("logMessage calllog_update_test_400: update error = " + error); + done(); + } + ; + } + }); + + /** + * @tc.number calllog_update_test_500 + * @tc.name Update all call logs + * @tc.desc Function test + */ + it("calllog_update_test_500", 0, async function (done) { + console.info("--------logMessage calllog_update_test_500 is starting!------------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CALLLOG); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + var insertValues = { + "phone_number": "1122445566", "ring_duration": "500" + }; + try { + var calllogId = await DAHelper.insert(calllogUri, insertValues); + console.info("logMessage calllog_update_test_500: calllogId = " + calllogId); + expect(calllogId > 0).assertTrue(); + await updateAllCalllog(); + done(); + } catch (error) { + console.info("logMessage calllog_update_test_500: calllog insert error = " + error); + done(); + } + ; + async function updateAllCalllog() { + var updateValues = { + "answer_state": "1" + }; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.greaterThan("id", "0"); + try { + var updateCode = await DAHelper.update(calllogUri, updateValues, condition) + console.info("logMessage calllog_update_test_500: updateCode = " + updateCode); + expect(updateCode == 0).assertTrue(); + var map = new Map([["phone_number", "1122445566"], ["ring_duration", "500"]]) + map.set("id", calllogId.toString()); + map.set("answer_state", "1"); + await calllogQueryForALL(map, "calllog_update_test_500"); + await callLogDelete("calllog_update_test_500"); + } catch (error) { + console.info("logMessage calllog_update_test_500: update error = " + error); + done(); + } + } + }); + + /** + * @tc.number calllog_delete_test_1300 + * @tc.name Delete call log + * @tc.desc Function test + */ + it("calllog_delete_test_1300", 0, async function (done) { + console.info("--------logMessage calllog_delete_test_1300 is starting!------------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CALLLOG); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + var insertValues = { + "phone_number": "123456", "ring_duration": "200" + }; + try { + var callLogId = await DAHelper.insert(calllogUri, insertValues); + console.info("logMessage calllog_delete_test_1300: callLogId = " + callLogId); + expect(callLogId > 0).assertTrue(); + await deleteOneCallLog(); + done(); + } catch (error) { + console.info("logMessage calllog_delete_test_1300: calllog insert error = " + error); + done(); + } + + async function deleteOneCallLog() { + try { + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("id", calllogId.toString()); + var deleteCode = await DAHelper.delete(calllogUri, condition); + console.info("logMessage calllog_delete_test_1300: deleteCode = " + deleteCode); + expect(deleteCode == 0).assertTrue(); + var map = new Map(); + map.set("id", calllogId.toString()); + await calllogQueryForDelete(map, "calllog_delete_test_1300"); + } catch (error) { + console.info("logMessage calllog_delete_test_1300: delete error = " + error); + done(); + } + } + }); + + /** + * @tc.number calllog_batchInset_test_1600 + * @tc.name Insert call logs in batches + * @tc.desc Function test + */ + it("calllog_batchInset_test_1600", 0, async function (done) { + console.info("--------logMessage calllog_batchInset_test_1600 is starting!------------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CALLLOG); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + var addBulkValue1 = { + "phone_number": "1600", "ring_duration": "333" + }; + var addBulkValue2 = { + "phone_number": "1600", "ring_duration": "600" + }; + var addBulkValue3 = { + "phone_number": "1600", "ring_duration": "600" + }; + var addBulkValue4 = { + "phone_number": "1600", "ring_duration": "600" + }; + var addBulkValue5 = { + "phone_number": "1600", "ring_duration": "600" + }; + var listAddBluk = []; + listAddBluk[0] = addBulkValue1; + listAddBluk[1] = addBulkValue2; + listAddBluk[2] = addBulkValue3; + listAddBluk[3] = addBulkValue4; + listAddBluk[4] = addBulkValue5; + try { + var batchInsertCode = await DAHelper.batchInsert(calllogUri, listAddBluk); + console.info("logMessage calllog_batchInset_test_1600: batchInsertCode = " + batchInsertCode); + expect(batchInsertCode == 0).assertTrue(); + await calllogQueryForBatchInsert(common.getCallLogBatchInsert(), "calllog_batchInset_test_1600"); + await callLogDelete("calllog_batchInset_test_1600"); + done(); + } catch (error) { + console.info("logMessage calllog_batchInset_test_1600: error = " + error); + done(); + } + }); + + /** + * @tc.number calllog_query_test_1200 + * @tc.name Query all call logs + * @tc.desc Function test + */ + it("calllog_query_test_1200", 0, async function (done) { + console.info("------------calllog_query_test_1200 is starting!-----------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CALLLOG); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + var insertValues = { + "phone_number": "123566456", "ring_duration": "200" + }; + try { + var calllogId = await DAHelper.insert(calllogUri, insertValues); + console.info("logMessage calllog_query_test_1200: calllogId = " + calllogId); + expect(calllogId > 0).assertTrue(); + var map = new Map([["phone_number", "123566456"], ["ring_duration", "200"]]); + map.set("id", calllogId.toString()); + await calllogQueryForALL(map, "calllog_query_test_1200"); + await callLogDelete("calllog_query_test_1200"); + done(); + } catch (error) { + console.info("logMessage calllog_query_test_1200: calllog insert error = " + error); + } + }); + + /** + * @tc.number calllog_query_test_1100 + * @tc.name Query call logs of combined conditions + * @tc.desc Function test + */ + it("calllog_query_test_1100", 0, async function (done) { + console.info("------------calllog_query_test_1100 is starting!-----------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CALLLOG); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + var insertValues = { + "phone_number": "44325008", "ring_duration": "100" + }; + try { + var calllogId = await DAHelper.insert(calllogUri, insertValues); + console.info("logMessage calllog_query_test_1100: calllogId = " + calllogId); + expect(calllogId > 0).assertTrue(); + await queryCalllog(); + await callLogDelete("calllog_query_test_1100"); + done() + } catch (error) { + console.info("logMessage calllog_query_test_1100: calllog insert error = " + error); + done(); + } + + async function queryCalllog() { + var resultColumns = ["id", "phone_number"]; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.greaterThan("id", "0"); + condition.and(); + condition.lessThan("ring_duration", "200").orderByAsc("id"); + try { + var resultSet = await DAHelper.query(calllogUri, resultColumns, condition); + if (resultSet.goToFirstRow()) { + do { + console.info("logMessage calllog_query_test_1100: columnNames:" + resultSet.columnNames); + console.info("logMessage calllog_query_test_1100: columnCount:" + resultSet.columnCount); + console.info('logMessage calllog_query_test_1100: id = ' + resultSet.getString(0)); + expect(resultSet.getString(0) == calllogId.toString()).assertTrue(); + console.info('logMessage calllog_query_test_1100: phone_number = ' + resultSet.getString(1)); + expect(resultSet.getString(1) == "44325008").assertTrue(); + } while (resultSet.goToNextRow()); + } + resultSet.close(); + } catch (error) { + console.info("logMessage calllog_query_test_1100: query error:" + error); + done(); + } + } + }); + + /** + * @tc.number calllog_query_test_800 + * @tc.name Query a single call log + * @tc.desc Function test + */ + it("calllog_query_test_800", 0, async function (done) { + console.info("------------calllog_query_test_800 is starting!-----------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CALLLOG); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + var insertValues = { + "phone_number": "88888888888", "ring_duration": "100" + }; + try { + var callLogId = await DAHelper.insert(calllogUri, insertValues); + console.info("logMessage calllog_query_test_800: callLogId = " + callLogId); + expect(callLogId > 0).assertTrue(); + await queryOneCallLog(); + await callLogDelete("calllog_query_test_800"); + done(); + } catch (error) { + console.info("logMessage calllog_query_test_800: calllog insert error = " + error); + done(); + } + + async function queryOneCallLog() { + var resultColumns = ["id", "phone_number"]; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("id", calllogId.toString()); + try { + var resultSet = await DAHelper.query(calllogUri, resultColumns, condition); + if (resultSet.goToFirstRow()) { + do { + console.info("logMessage calllog_query_test_800: columnNames:" + resultSet.columnNames); + console.info("logMessage calllog_query_test_800: columnCount:" + resultSet.columnCount); + console.info('logMessage calllog_query_test_800: id = ' + resultSet.getString(0)); + expect(resultSet.getString(0) == calllogId.toString()).assertTrue(); + console.info('logMessage calllog_query_test_800: phone_number = ' + resultSet.getString(1)); + expect(resultSet.getString(1) == "88888888888").assertTrue(); + } while (resultSet.goToNextRow()); + } + resultSet.close(); + } catch (error) { + console.info("logMessage calllog_query_test_800: query error = " + error); + done(); + } + } + }); + + /** + * @tc.number calllog_fuzzyquery_test_100 + * @tc.name Fuzzy query ability based on mobile phone number (beginning of a certain field) + * @tc.desc Function test + */ + it("calllog_fuzzyquery_test_100", 0, async function (done) { + console.info("------------calllog_fuzzyquery_test_100 is starting!-----------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CALLLOG); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + var insertValues = { + "phone_number": "196320147" + }; + try { + var calllogId = await DAHelper.insert(calllogUri, insertValues); + console.info("logMessage calllog_fuzzyquery_test_100: calllogId = " + calllogId); + expect(calllogId > 0).assertTrue(); + await queryByStartsWithPhoneNumber(); + await callLogDelete("calllog_fuzzyquery_test_100"); + done(); + } catch (error) { + console.info("logMessage calllog_fuzzyquery_test_100: calllog insert error = " + error); + done(); + } + + async function queryByStartsWithPhoneNumber() { + var resultColumns = ["id", "phone_number"]; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.like("phone_number", "196%"); + try { + var resultSet = await DAHelper.query(calllogUri, resultColumns, condition); + if (resultSet.goToFirstRow()) { + do { + console.info("logMessage calllog_fuzzyquery_test_100: columnNames:" + resultSet.columnNames); + console.info("logMessage calllog_fuzzyquery_test_100: columnCount:" + resultSet.columnCount); + console.info('logMessage calllog_fuzzyquery_test_100: id = ' + resultSet.getString(0)); + expect(resultSet.getString(0) == calllogId.toString()).assertTrue(); + console.info( + 'logMessage calllog_fuzzyquery_test_100: phone_number = ' + resultSet.getString(1)); + expect(resultSet.getString(1) == "196320147").assertTrue(); + } while (resultSet.goToNextRow()); + } + resultSet.close(); + } catch (error) { + console.info("logMessage calllog_fuzzyquery_test_100: query error = " + error); + done(); + } + } + }); + + /** + * @tc.number calllog_fuzzyquery_test_200 + * @tc.name Fuzzy query ability based on mobile phone number (at the end of a certain field) + * @tc.desc Function test + */ + it("calllog_fuzzyquery_test_200", 0, async function (done) { + console.info("------------calllog_fuzzyquery_test_200 is starting!-----------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CALLLOG); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + var insertValues = { + "phone_number": "126467821" + }; + try { + var calllogId = await DAHelper.insert(calllogUri, insertValues); + console.info("logMessage calllog_fuzzyquery_test_200: calllogId = " + calllogId); + expect(calllogId > 0).assertTrue(); + await queryByEndWithPhoneNumber(); + await callLogDelete("calllog_fuzzyquery_test_200"); + done(); + } catch (error) { + console.info("logMessage calllog_fuzzyquery_test_200: calllog insert error = " + error); + done(); + } + + async function queryByEndWithPhoneNumber() { + var resultColumns = ["id", "phone_number"]; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.like("phone_number", "%821"); + try { + var resultSet = await DAHelper.query(calllogUri, resultColumns, condition); + if (resultSet.goToFirstRow()) { + do { + console.info("logMessage calllog_fuzzyquery_test_200: columnNames:" + resultSet.columnNames); + console.info("logMessage calllog_fuzzyquery_test_200: columnCount:" + resultSet.columnCount); + console.info('logMessage calllog_fuzzyquery_test_200: id = ' + resultSet.getString(0)); + expect(resultSet.getString(0) == calllogId.toString()).assertTrue(); + console.info( + 'logMessage calllog_fuzzyquery_test_200: phone_number = ' + resultSet.getString(1)); + expect(resultSet.getString(1) == "126467821").assertTrue(); + } while (resultSet.goToNextRow()); + } + resultSet.close(); + } catch (error) { + console.info("logMessage calllog_fuzzyquery_test_200: query error = " + error); + done(); + } + } + }); + + /** + * @tc.number calllog_fuzzyquery_test_300 + * @tc.name Fuzzy query ability based on mobile phone number (including a certain field) + * @tc.desc Function test + */ + it("calllog_fuzzyquery_test_300", 0, async function (done) { + console.info("------------calllog_fuzzyquery_test_300 is starting!-----------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CALLLOG); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + var insertValues = { + "phone_number": "1234567855557568" + }; + try { + var calllogId = await DAHelper.insert(calllogUri, insertValues); + console.info("logMessage calllog_fuzzyquery_test_300: calllogId = " + calllogId); + expect(calllogId > 0).assertTrue(); + await queryByPhoneNumberContainsField(); + await callLogDelete("calllog_fuzzyquery_test_300"); + done(); + } catch (error) { + console.info("logMessage calllog_fuzzyquery_test_300: calllog insert error = " + error); + done(); + } + + async function queryByPhoneNumberContainsField() { + var resultColumns = ["id", "phone_number"]; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.like("phone_number", "%555%"); + try { + var resultSet = await DAHelper.query(calllogUri, resultColumns, condition); + if (resultSet.goToFirstRow()) { + do { + console.info("logMessage calllog_fuzzyquery_test_300: columnNames:" + resultSet.columnNames); + console.info("logMessage calllog_fuzzyquery_test_300: columnCount:" + resultSet.columnCount); + console.info('logMessage calllog_fuzzyquery_test_300: id = ' + resultSet.getString(0)); + expect(resultSet.getString(0) == calllogId.toString()).assertTrue(); + console.info( + 'logMessage calllog_fuzzyquery_test_300: phone_number = ' + resultSet.getString(1)); + expect(resultSet.getString(1) == "1234567855557568").assertTrue(); + } while (resultSet.goToNextRow()); + } + resultSet.close(); + } catch (error) { + console.info("logMessage calllog_fuzzyquery_test_300: query error = " + error); + done(); + } + } + }); + + /** + * @tc.number abnormal_calllog_insert_test_200 + * @tc.name Abnormal use case, an incorrect field is passed in when inserting data + * @tc.desc Function test + */ + it("abnormal_calllog_insert_test_200", 0, async function (done) { + console.info("------------abnormal_calllog_insert_test_200 is starting!-----------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CALLLOG); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + var insertValues = { + "phone_numbers": "1111111111" + }; + try { + var calllogId = await DAHelper.insert(calllogUri, insertValues); + console.info("logMessage abnormal_calllog_insert_test_200: calllogId = " + calllogId); + expect(calllogId == -1).assertTrue(); + done(); + } catch (error) { + console.info("logMessage abnormal_calllog_insert_test_200: calllog insert error = " + error); + done(); + } + }); + + /** + * @tc.number abnormal_calllog_insert_test_300 + * @tc.name Abnormal use case, an incorrect table name is passed in when inserting data + * @tc.desc Function test + */ + it("abnormal_calllog_insert_test_300", 0, async function (done) { + console.info("------------abnormal_calllog_insert_test_300 is starting!-----------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CALLLOG); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + var errorUri = "dataability:///com.ohos.calllogability/calls/calllogs"; + + var insertValues = { + "phone_number": "456789410" + }; + try { + var calllogId = await DAHelper.insert(errorUri, insertValues); + console.info("logMessage abnormal_calllog_insert_test_300: calllogId = " + calllogId); + expect(calllogId == -1).assertTrue(); + done(); + } catch (error) { + console.info("logMessage abnormal_calllog_insert_test_300: calllog insert error = " + error); + done(); + } + }); + + /** + * @tc.number abnormal_calllog_update_test_600 + * @tc.name Abnormal use case, passing in a wrong field when updating data + * @tc.desc Function test + */ + it("abnormal_calllog_update_test_600", 0, async function (done) { + console.info("------------abnormal_calllog_update_test_600 is starting!-----------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CALLLOG); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + var insertValues = { + "phone_number": "1020202020" + }; + try { + var calllogId = await DAHelper.insert(calllogUri, insertValues); + console.info("logMessage abnormal_calllog_update_test_600: calllogId = " + calllogId); + expect(calllogId > 0).assertTrue(); + await abnormalUpdate(); + await callLogDelete("abnormal_calllog_update_test_600"); + done(); + } catch (error) { + console.info("logMessage abnormal_calllog_update_test_600: calllog insert error = " + error); + done(); + } + + async function abnormalUpdate() { + var updateValues = { + "phone_numbers": "22001122" + }; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("ids", calllogId.toString()); + try { + var updataCode = await DAHelper.update(calllogUri, updateValues, condition); + console.info("logMessage abnormal_calllog_update_test_600: updataCode = " + updataCode); + expect(updataCode == -1).assertTrue(); + var map = new Map(); + map.set("id", calllogId.toString()); + map.set("phone_number", "1020202020"); + await calllogQueryForALL(map, "abnormal_calllog_update_test_600"); + } catch (error) { + console.info("logMessage abnormal_calllog_update_test_600: update error = " + error); + done(); + } + } + }); + + /** + * @tc.number abnormal_calllog_update_test_700 + * @tc.name Abnormal use case, an incorrect table name is passed in when updating data + * @tc.desc Function test + */ + it("abnormal_calllog_update_test_700", 0, async function (done) { + console.info("------------abnormal_calllog_update_test_700 is starting!-----------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CALLLOG); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + var errorUri = "dataability:///com.ohos.calllogability/calls/calllogs"; + + var insertValues = { + "phone_number": "9952364" + }; + try { + var calllogId = await DAHelper.insert(calllogUri, insertValues); + console.info("logMessage abnormal_calllog_update_test_700: calllogId = " + calllogId); + expect(calllogId > 0).assertTrue(); + await abnormalUpdate(); + await callLogDelete("abnormal_calllog_update_test_700"); + done(); + } catch (error) { + console.info("logMessage abnormal_calllog_update_test_700: calllog insert error = " + error); + done(); + } + + async function abnormalUpdate() { + var updateValues = { + "phone_numbers": "22001122" + }; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("id", calllogId.toString()); + try { + var updataCode = await DAHelper.update(errorUri, updateValues, condition); + console.info("logMessage abnormal_calllog_update_test_700: updataCode = " + updataCode); + expect(updataCode == -1).assertTrue(); + var map = new Map(); + map.set("id", calllogId.toString()); + map.set("phone_number", "9952364"); + await calllogQueryForALL(map, "abnormal_calllog_update_test_700"); + done(); + } catch (error) { + console.info("logMessage abnormal_calllog_update_test_700: update error = " + error); + done(); + } + } + }); + + /** + * @tc.number abnormal_calllog_delete_test_1400 + * @tc.name Abnormal use case, passing in a wrong field when deleting data + * @tc.desc Function test + */ + it("abnormal_calllog_delete_test_1400", 0, async function (done) { + console.info("------------abnormal_calllog_delete_test_1400 is starting!-----------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CALLLOG); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + var insertValues = { + "phone_number": "789130" + }; + try { + var calllogId = await DAHelper.insert(calllogUri, insertValues); + console.info("logMessage abnormal_calllog_delete_test_1400: calllogId = " + calllogId); + expect(calllogId > 0).assertTrue(); + await abnormalDelete(); + await callLogDelete("abnormal_calllog_delete_test_1400"); + done(); + } catch (error) { + console.info("logMessage abnormal_calllog_delete_test_1400: calllog insert error = " + error); + done(); + } + + async function abnormalDelete() { + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("ids", calllogId.toString()); + try { + var deleteCode = await DAHelper.delete(calllogUri, condition); + console.info("logMessage abnormal_calllog_delete_test_1400: deleteCode = " + deleteCode); + expect(deleteCode == -1).assertTrue(); + var map = new Map(); + map.set("id", calllogId.toString()); + map.set("phone_number", "789130"); + await calllogQueryForALL(map, "abnormal_calllog_delete_test_1400"); + } catch (error) { + console.info("logMessage abnormal_calllog_delete_test_1400: delete error = " + error); + done(); + } + } + }); + + /** + * @tc.number abnormal_calllog_delete_test_1500 + * @tc.name Abnormal use case, passing in an incorrect table name when deleting data + * @tc.desc Function test + */ + it("abnormal_calllog_delete_test_1500", 0, async function (done) { + console.info("------------abnormal_calllog_delete_test_1500 is starting!-----------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CALLLOG); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + var errorUri = "dataability:///com.ohos.calllogability/calls/calllogs"; + + var insertValues = { + "phone_number": "1564721" + }; + try { + var calllogId = await DAHelper.insert(calllogUri, insertValues); + console.info("logMessage abnormal_calllog_delete_test_1500: calllogId = " + calllogId); + expect(calllogId > 0).assertTrue(); + await abnormalDelete(); + await callLogDelete("abnormal_calllog_delete_test_1500"); + done(); + } catch (error) { + console.info("logMessage abnormal_calllog_delete_test_1500: calllog insert error = " + error); + done(); + } + + async function abnormalDelete() { + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("id", calllogId.toString()); + try { + var deleteCode = await DAHelper.delete(errorUri, condition); + console.info("logMessage abnormal_calllog_delete_test_1500: deleteCode = " + deleteCode); + expect(deleteCode == -1).assertTrue(); + done() + var map = new Map(); + map.set("id", calllogId.toString()); + map.set("phone_number", "1564721"); + await calllogQueryForALL(map, "abnormal_calllog_delete_test_1500"); + } catch (error) { + console.info("logMessage abnormal_calllog_delete_test_1500: delete error = " + error); + done(); + } + } + }); + + /** + * @tc.number abnormal_calllog_query_test_900 + * @tc.name Abnormal use case, an incorrect field is passed in when querying + * @tc.desc Function test + */ + it("abnormal_calllog_query_test_900", 0, async function (done) { + console.info("------------abnormal_calllog_query_test_900 is starting!-----------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CALLLOG); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + var insertValues = { + "phone_number": "1564721" + }; + try { + var calllogId = await DAHelper.insert(calllogUri, insertValues); + console.info("logMessage abnormal_calllog_query_test_900: calllogId = " + calllogId); + expect(calllogId > 0).assertTrue(); + await abnormalQuery(); + await callLogDelete("abnormal_calllog_query_test_900"); + done(); + } catch (error) { + console.info("logMessage abnormal_calllog_query_test_900: calllog insert error = " + error); + done(); + } + + async function abnormalQuery() { + var resultColumns = ["id", "phone_number"]; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("ids", calllogId.toString()); + try { + var resultSet = await DAHelper.query(calllogUri, resultColumns, condition); + console.info('logMessage abnormal_calllog_query_test_900: goToFirstRow' + resultSet.goToFirstRow()); + expect(resultSet.goToFirstRow()).assertEqual(false); + resultSet.close(); + } catch (error) { + console.info("logMessage abnormal_calllog_query_test_900:query error = " + error); + done(); + } + } + }); + + /** + * @tc.number abnormal_calllog_batchinsert_test_1700 + * @tc.name abnormal_batchinsert + * @tc.desc Function test + */ + it("abnormal_calllog_batchinsert_test_1700", 0, async function (done) { + console.info("--------logMessage abnormal_calllog_batchinsert_test_1700 is starting!------------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CALLLOG); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + var addBulkValue1 = { + "phone_number": "5555555555", "ring_duration": "500" + }; + var addBulkValue2 = { + "phone_number": "1511002", "ring_duration": "100" + }; + var addBulkValue3 = { + "phone_numbers": "1521003", "ring_duration": "100" + }; + var addBulkValue4 = { + "phone_number": "1521004", "ring_durations": "100" + }; + var addBulkValue5 = { + "phone_number": "1521005", "ring_duration": "100" + }; + var listAddBluk = []; + listAddBluk[0] = addBulkValue1; + listAddBluk[1] = addBulkValue2; + listAddBluk[2] = addBulkValue3; + listAddBluk[3] = addBulkValue4; + listAddBluk[4] = addBulkValue5; + try { + var batchInsertCode = await DAHelper.batchInsert(calllogUri, listAddBluk); + console.info("logMessage abnormal_calllog_batchinsert_test_1700: batchInsertCode = " + batchInsertCode); + expect(batchInsertCode == -1).assertTrue(); + done(); + } catch (error) { + console.info("logMessage abnormal_calllog_batchinsert_test_1700: batchInsert error = " + error); + done(); + } + }); + + /** + * @tc.number calllog_delete_test_1800 + * @tc.name batchDelete + * @tc.desc Function test + */ + it("calllog_delete_test_1800", 0, async function (done) { + console.info("--------logMessage calllog_delete_test_1800 is starting!------------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CALLLOG); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + try { + var calllogId = await DAHelper.insert(calllogUri, common.getCallLogInsert()); + console.info("logMessage calllog_delete_test_1800: calllogId = " + calllogId); + expect(calllogId > 0).assertTrue(); + var map = common.getCallLogInsertMap() + map.set("id", calllogId.toString()); + await calllogQueryForALL(map, "calllog_delete_test_1800"); + await executeBatch(); + } catch (error) { + console.info("logMessage calllog_delete_test_1800: calllog insert error = " + error); + done(); + } + + async function executeBatch() { + console.info("logMessage calllog_delete_test_1800: executeBatch start "); + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("id", calllogId.toString()); + DAHelper.executeBatch(URI_CALLLOG, [{ + uri: calllogUri, + type: featureAbility.DataAbilityOperationType.TYPE_DELETE, + predicates: condition, + expectedCount: 0, + PredicatesBackReferences: {}, + interrupted: true, + }], + (error, data) => { + console.info("logMessage calllog_delete_test_1800: executeBatch data = " + JSON.stringify(data)); + console.info("logMessage calllog_delete_test_1800: data_3 = " + data); + console.info("logMessage calllog_delete_test_1800: data_1= " + data[0].count); + expect(data[0].count == 0).assertTrue(); + done(); + }); + }; + }); + + /** + * @tc.number calllog_update_test_1900 + * @tc.name batchUpdate + * @tc.desc Function test + */ + it("calllog_update_test_1900", 0, async function (done) { + console.info("--------logMessage calllog_update_test_1900 is starting!------------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CALLLOG); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + try { + var calllogId = await DAHelper.insert(calllogUri, common.getCallLogInsert()); + console.info("logMessage calllog_update_test_1900: calllogId = " + calllogId); + expect(calllogId > 0).assertTrue(); + var map = common.getCallLogInsertMap() + map.set("id", calllogId.toString()); + await calllogQueryForALL(map, "calllog_update_test_1900"); + await executeBatch(); + } catch (error) { + console.info("logMessage calllog_update_test_1900: calllog insert error = " + error); + done(); + } + + async function executeBatch() { + var updateValues = { + "phone_number": "123456789" + }; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("id", calllogId.toString()); + DAHelper.executeBatch(URI_CALLLOG, [{ + uri: calllogUri, + type: featureAbility.DataAbilityOperationType.TYPE_UPDATE, + valuesBucket: updateValues, + predicates: condition, + expectedCount: 0, + PredicatesBackReferences: {}, + interrupted: true, + }], + (error, data) => { + console.info("logMessage calllog_update_test_1900: executeBatch data = " + JSON.stringify(data)); + console.info("logMessage calllog_update_test_1900: data_3 = " + data); + console.info("logMessage calllog_update_test_1900: data_1= " + data[0].count); + expect(data[0].count == 0).assertTrue(); + done(); + }); + }; + }); + + /** + * @tc.number calllog_Delete_test_2000 + * @tc.name calllog Delete + * @tc.desc Function test + */ + it("calllog_Delete_test_2000", 0, async function (done) { + console.info("--------logMessage calllog_Delete_test_2000 is starting!------------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CALLLOG); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + var insertValues = { + "phone_number": "123456", "ring_duration": "200" + }; + try { + var calllogId = await DAHelper.insert(calllogUri, insertValues); + var calllogIdTwo = await DAHelper.insert(calllogUri, insertValues); + var calllogIdThree = await DAHelper.insert(calllogUri, insertValues); + expect(calllogId > 0).assertTrue(); + expect(calllogIdTwo > 0).assertTrue(); + expect(calllogIdThree > 0).assertTrue(); + await deleteCalllog(); + done(); + } catch (error) { + console.info("logMessage calllog_Delete_test_2000: calllog insert error = " + error); + done(); + } + + async function deleteCalllog() { + try { + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("id", calllogId.toString()); + condition.or(); + condition.equalTo("id", calllogIdTwo.toString()); + condition.or(); + condition.equalTo("id", calllogIdThree.toString()); + var deleteCode = await DAHelper.delete(calllogUri, condition); + console.info("logMessage calllog_Delete_test_2000: deleteCode = " + deleteCode); + expect(deleteCode == 0).assertTrue(); + var resultColumns = []; + var resultSet = await DAHelper.query(calllogUri, resultColumns, condition); + expect(resultSet.rowCount == 0).assertTrue(); + resultSet.close(); + } catch (error) { + console.info("logMessage calllog_Delete_test_2000: delete error = " + error); + done(); + } + } + }); + + /** + * @tc.number calllog_Delete_test_2100 + * @tc.name calllog Delete + * @tc.desc Function test + */ + it("calllog_Delete_test_2100", 0, async function (done) { + console.info("--------logMessage calllog_Delete_test_2100 is starting!------------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CALLLOG); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + try { + var calllogId = await DAHelper.insert(calllogUri, common.getCallLogInsert()); + console.info("logMessage calllog_Delete_test_2100: calllogId = " + calllogId); + expect(calllogId > 0).assertTrue(); + var map = common.getCallLogInsertMap() + map.set("id", calllogId.toString()); + await calllogQueryForALL(map, "calllog_Delete_test_2100"); + await callLogDelete("calllog_Delete_test_2100"); + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("id", calllogId); + var resultColumns = []; + var resultSet = await DAHelper.query(calllogUri, resultColumns, condition); + expect(resultSet.rowCount == 0).assertTrue(); + resultSet.close(); + done(); + } catch (error) { + console.info("logMessage calllog_Delete_test_2100: calllog insert error = " + error); + done(); + } + }); + + /** + * @tc.number calllog_queryContains_test_2200 + * @tc.name calllog Delete + * @tc.desc Function test + */ + it("calllog_queryContains_test_2200", 0, async function (done) { + console.info("--------logMessage calllog_queryContains_test_2200 is starting!------------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CALLLOG); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + var insertValues = { + "phone_number": "123456789220099999" + } + try { + var calllogId = await DAHelper.insert(calllogUri, insertValues); + console.info("logMessage calllog_queryContains_test_2200: calllogId = " + calllogId); + expect(calllogId > 0).assertTrue(); + + var resultColumns = ["phone_number"]; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.contains("phone_number", "99999"); + var resultSet = await DAHelper.query(calllogUri, resultColumns, condition); + if (resultSet.rowCount > 0) { + if (resultSet.goToFirstRow()) { + do { + var phone = resultSet.getString(resultSet.getColumnIndex("phone_number")); + console.info("logMessage calllog_queryContains_test_2200: phone is = " + phone); + expect(phone == "123456789220099999").assertEqual(true); + } while (resultSet.goToNextRow()); + } + } + resultSet.close(); + await callLogDelete(); + done(); + } catch (error) { + console.info("logMessage calllog_queryContains_test_2200: calllog insert error = " + error); + done(); + } + }); + + /** + * @tc.number abnormal_calllog_update_test_2300 + * @tc.name Update all call records, pass in a field that does not exist + * @tc.desc Function test + */ + it("abnormal_calllog_update_test_2300", 0, async function (done) { + console.info("--------logMessage abnormal_calllog_update_test_2300 is starting!------------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CALLLOG); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + var insertValues = { + phone_number: "15748646546", display_name: "name2300" + } + try { + var calllogId = await DAHelper.insert(calllogUri, insertValues); + var calllogIdTwo = await DAHelper.insert(calllogUri, insertValues); + expect(calllogId > 0).assertTrue(); + expect(calllogIdTwo > 0).assertTrue(); + await updateOneCalllog(); + done(); + } catch (error) { + console.info("logMessage abnormal_calllog_update_test_2300: calllog insert error = " + error); + done(); + } + ; + async function updateOneCalllog() { + try { + var insertValues = { + phone_number: "15748646546", display_names: "nameUpdateError2300" + }; + var condition = + new ohosDataAbility.DataAbilityPredicates(); + var updateCode = await DAHelper.update(calllogUri, insertValues, condition); + console.info("logMessage abnormal_calllog_update_test_2300: updateCode = " + updateCode); + expect(updateCode == -1).assertTrue(); + var map = new Map(); + map.set("id", calllogId.toString()); + map.set("display_name", "name2300"); + await calllogQueryForALL(map, "abnormal_calllog_update_test_2300"); + map.set("id", calllogIdTwo.toString()); + await calllogQueryForALL(map, "abnormal_calllog_update_test_2300"); + await callLogDelete("calllog_update_test_2300"); + } catch (error) { + console.info("logMessage abnormal_calllog_update_test_2300: update error = " + error); + done(); + } + ; + } + }); + + /** + * @tc.number abnormal_calllog_query_test_2400 + * @tc.name When querying call records based on combined conditions, incorrect field + * names and non-existent data are passed in + * @tc.desc Function test + */ + it("abnormal_calllog_query_test_2400", 0, async function (done) { + console.info("--------logMessage abnormal_calllog_query_test_2400 is starting!------------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CALLLOG); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + var insertValues = { + phone_number: "15748646546", display_name: "name2300" + } + try { + var calllogId = await DAHelper.insert(calllogUri, insertValues); + var calllogIdTwo = await DAHelper.insert(calllogUri, insertValues); + expect(calllogId > 0).assertTrue(); + expect(calllogIdTwo > 0).assertTrue(); + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("id", calllogId.toString() + "ksks"); + var resultColumns = ["display_names"]; + var resultSet = await DAHelper.query(calllogUri, resultColumns, condition); + console.info("abnormal_calllog_query_test_2400: resultSet.rowCount = " + resultSet.rowCount); + expect(resultSet.rowCount == -1).assertTrue(); + resultSet.close(); + await callLogDelete("abnormal_calllog_query_test_2400"); + done(); + } catch (error) { + console.info("logMessage abnormal_calllog_query_test_2400: calllog insert error = " + error); + done(); + } + ; + }); + + /** + * @tc.number abnormal_calllog_query_test_2500 + * @tc.name When querying all call records based on combined conditions, incorrect field + * names and non-existent data are passed in + * @tc.desc Function test + */ + it("abnormal_calllog_query_test_2500", 0, async function (done) { + console.info("--------logMessage abnormal_calllog_query_test_2500 is starting!------------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CALLLOG); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + var insertValues = { + phone_number: "15748646546", display_name: "name2300" + } + try { + var calllogId = await DAHelper.insert(calllogUri, insertValues); + console.info('abnormal_calllog_query_test_2500 calllogId = ' + calllogId); + var calllogIdTwo = await DAHelper.insert(calllogUri, insertValues); + console.info('abnormal_calllog_query_test_2500 calllogIdTwo = ' + calllogIdTwo); + expect(calllogId > 0).assertTrue(); + expect(calllogIdTwo > 0).assertTrue(); + var condition = new ohosDataAbility.DataAbilityPredicates(); + var resultColumns = ["display_names"]; + var resultSet = await DAHelper.query(calllogUri, resultColumns, condition); + console.info('abnormal_calllog_query_test_2500 resultSet.goToFirstRow() = ' + resultSet.goToFirstRow()); + console.info('abnormal_calllog_query_test_2500 resultSet.rowCount = ' + resultSet.rowCount); + expect(resultSet.goToFirstRow() == false).assertTrue(); + resultSet.close(); + await callLogDelete("abnormal_calllog_query_test_2500"); + done(); + } catch (error) { + console.info("logMessage abnormal_calllog_query_test_2500: calllog insert error = " + error); + done(); + } + ; + }); + + /** + * @tc.number abnormal_calllog_delete_test_2600 + * @tc.name Batch call records are added, and some of them fail, depending on the processing logic + * @tc.desc Function test + */ + it("abnormal_calllog_delete_test_2600", 0, async function (done) { + console.info("--------logMessage abnormal_calllog_delete_test_2600 is starting!------------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CALLLOG); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + var insertValues = { + phone_number: "15748646546", display_name: "name2300" + } + try { + var calllogId = await DAHelper.insert(calllogUri, insertValues); + var calllogIdTwo = await DAHelper.insert(calllogUri, insertValues); + expect(calllogId > 0).assertTrue(); + expect(calllogIdTwo > 0).assertTrue(); + } catch (error) { + console.info("logMessage abnormal_calllog_delete_test_2600: calllog insert error = " + error); + done(); + } + ; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("ids", calllogIdTwo.toString()); + condition.or(); + condition.equalTo("id", calllogId.toString()); + var code = await DAHelper.delete(calllogUri, condition); + console.info("logMessage abnormal_calllog_delete_test_2600: code = " + code); + expect(code == -1).assertTrue(); + condition.clear(); + var resultColumns = []; + var resultSet = await DAHelper.query(calllogUri, resultColumns, condition); + var count = 2; + expect(resultSet.rowCount == count).assertTrue(); + resultSet.close(); + await callLogDelete("abnormal_calllog_delete_test_2600"); + done(); + }); + + /** + * @tc.number abnormal_calllog_update_test_2700 + * @tc.name When batch call records are modified, the wrong field or table name is passed in + * @tc.desc Function test + */ + it("abnormal_calllog_delete_test_2700", 0, async function (done) { + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CALLLOG); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + var insertValues = { + phone_number: "270015748646546", display_name: "name2700" + } + try { + var calllogId = await DAHelper.insert(calllogUri, insertValues); + var calllogIdTwo = await DAHelper.insert(calllogUri, insertValues); + expect(calllogId > 0).assertTrue(); + expect(calllogIdTwo > 0).assertTrue(); + await updateOneCalllog(); + done(); + } catch (error) { + console.info("logMessage abnormal_calllog_delete_test_2700: calllog insert error = " + error); + done(); + } + ; + async function updateOneCalllog() { + try { + var insertValues = { + phone_number: "270015748646546", display_names: "nameUpdateError2700" + }; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("ids", calllogIdTwo.toString()); + condition.or(); + condition.equalTo("id", calllogId.toString()); + var updateCode = await DAHelper.update(calllogUri, insertValues, condition); + console.info("logMessage abnormal_calllog_delete_test_2700: updateCode = " + updateCode); + expect(updateCode == -1).assertTrue(); + var map = new Map(); + map.set("id", calllogId.toString()); + map.set("display_name", "name2700"); + await calllogQueryForALL(map, "abnormal_calllog_delete_test_2700"); + map.set("id", calllogIdTwo.toString()); + await calllogQueryForALL(map, "abnormal_calllog_delete_test_2700"); + await callLogDelete("abnormal_calllog_delete_test_2700"); + } catch (error) { + console.info("logMessage abnormal_calllog_delete_test_2700: update error = " + error); + done(); + } + ; + } + }); + + /** + * @tc.number abnormal_calllog_query_test_2800 + * @tc.name Fuzzy search query based on mobile phone number + * @tc.desc Function test + */ + it("abnormal_calllog_query_test_2800", 0, async function (done) { + console.info("------------abnormal_calllog_query_test_2800 is starting!-----------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CALLLOG); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + var insertValues = { + "phone_number": "196320147" + }; + try { + var calllogId = await DAHelper.insert(calllogUri, insertValues); + console.info("logMessage abnormal_calllog_query_test_2800: calllogId = " + calllogId); + expect(calllogId > 0).assertTrue(); + await queryByStartsWithPhoneNumberError(); + await callLogDelete("abnormal_calllog_query_test_2800"); + done(); + } catch (error) { + console.info("logMessage abnormal_calllog_query_test_2800: calllog insert error = " + error); + done(); + } + + async function queryByStartsWithPhoneNumberError() { + var resultColumns = ["id", "phone_number"]; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.like("phone_numbers", "196%"); + try { + var resultSet = await DAHelper.query(calllogUri, resultColumns, condition); + console.info("logMessage abnormal_calllog_query_test_2800: resultSet.rowCount = " + resultSet.rowCount); + expect(resultSet.rowCount == -1).assertTrue(); + resultSet.close(); + } catch (error) { + console.info("logMessage abnormal_calllog_query_test_2800: query error = " + error); + done(); + } + } + }); + + afterAll(async function () { + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CALLLOG); + console.info('callllog afterAll logMessage get DAHelper success! DAHelper = ' + DAHelper); + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.greaterThan("id", "0"); + var deleteCode = await DAHelper.delete(calllogUri, condition); + console.info('callllog afterAll end logMessage deleteCode = ' + deleteCode); + }); + }) +} diff --git a/telephony/telephonyjstest/contact_function/entry/src/main/ets/MainAbility/test/contact/ContactCard_test.js b/telephony/telephonyjstest/contact_function/entry/src/main/ets/MainAbility/test/contact/ContactCard_test.js new file mode 100644 index 000000000..70c1ba5e4 --- /dev/null +++ b/telephony/telephonyjstest/contact_function/entry/src/main/ets/MainAbility/test/contact/ContactCard_test.js @@ -0,0 +1,5441 @@ +/* + * 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 featureAbility from '@ohos.ability.featureAbility'; +import ohosDataAbility from '@ohos.data.dataability'; +import {afterAll, afterEach, beforeAll, beforeEach, describe, expect, it} from 'deccjsunit/index' +import common from './common.js'; + +const URI_CONTACTS = "dataability:///com.ohos.contactsdataability"; +const profilecontactUri = "dataability:///com.ohos.contactsdataability/profile/contact"; +const profileRawContactUri = "dataability:///com.ohos.contactsdataability/profile/raw_contact"; +const profileContactDataUri = "dataability:///com.ohos.contactsdataability/profile/contact_data"; +const profileGroupUri = "dataability:///com.ohos.contactsdataability/profile/groups"; +const profileBlocklistUri = "dataability:///com.ohos.contactsdataability/profile/contact_blocklist"; +const profilesearchContactUri = "dataability:///com.ohos.contactsdataability/profile/search_contact"; +const profileDeletedContactsUri = "dataability:///com.ohos.contactsdataability/profile/deleted_raw_contact"; +const profileDeletedRawContactRecord = + "dataability:///com.ohos.contactsdataability/profile/deleted_raw_contact_record"; + +export default function ContactCardTest() { + describe('ContactCardTest', function () { + console.info("-------ContactsTest is starting!--------"); + + function sleep(numberMillis) { + var now = new Date(); + var exitTime = now.getTime() + numberMillis; + while (true) { + now = new Date(); + if (now.getTime() > exitTime) + return; + } + } + + async function contactsQuery(map, tag, uri) { + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info(tag + ': contactsQuery start ! DAHelper = ' + DAHelper); + var resultColumns = []; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("id", map.get("id")); + try { + var resultSet = await DAHelper.query(uri, resultColumns, condition); + sleep(2000); + if (resultSet.rowCount > 0 && resultSet.goToFirstRow()) { + do { + for (var [key, value] of map) { + var dbresult = resultSet.getString(resultSet.getColumnIndex(key)); + console.info(tag + ':logMessage contactsQuery key = ' + key + ' dbresult :' + dbresult + + ' value : ' + value); + expect(value == dbresult).assertEqual(true); + } + } while (resultSet.goToNextRow()); + } + + resultSet.close(); + } catch (error) { + console.info(tag + "logMessage contactsQuery: error = " + error); + } + } + + async function queryBatch(map, tag, size) { + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info(tag + ': queryBatch start ! DAHelper = ' + DAHelper); + var resultColumns = []; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("raw_contact_id", map.get("raw_contact_id")); + try { + var resultSet = await DAHelper.query(profileRawContactUri, resultColumns, condition); + sleep(1000); + console.info(tag + ': queryBatch start ! resultSet.rowCount = ' + resultSet.rowCount); + expect(resultSet.rowCount == size).assertEqual(true); + resultSet.close(); + } catch (error) { + console.info(tag + "logMessage resultSet.rowCount: error = " + error); + } + } + + async function queryIdForDelete(map, tag, uri) { + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info(tag + ': queryIdForDelete start ! DAHelper = ' + DAHelper); + var resultColumns = common.getCallLogResultColumns(); + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("id", map.get("id")); + try { + var resultSet = await DAHelper.query(uri, resultColumns, condition); + sleep(1000); + expect(resultSet.goToFirstRow() == false).assertTrue(); + console.info(tag + " :logMessage queryIdForDelete: goToFirstRow " + resultSet.goToFirstRow()); + resultSet.close(); + } catch (error) { + console.info(tag + " :logMessage queryIdForDelete: error = " + error); + } + } + + async function deleteAll(uri, tag) { + try { + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.greaterThan("id", "0"); + var deleteCode = await DAHelper.delete(uri, condition); + console.info(tag + ': deleteAll deleteCode = ' + deleteCode); + expect(deleteCode == 0).assertTrue(); + } catch (error) { + console.info(tag + ': deleteAll error = ' + error); + } + } + + async function deleteRawContact(tag) { + try { + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.greaterThan("id", "0"); + condition.and(); + condition.equalTo("is_deleted", "0"); + var deleteCode = await DAHelper.delete(profileRawContactUri, condition); + console.info(tag + ': deleteRawContact deleteCode = ' + deleteCode); + expect(deleteCode == 0).assertTrue(); + sleep(1000); + var conditionAll = new ohosDataAbility.DataAbilityPredicates(); + conditionAll.greaterThan("id", "0"); + var code = await DAHelper.delete(profileDeletedContactsUri, conditionAll); + console.info(tag + ': Completely delete code = ' + code); + expect(code == 0).assertTrue(); + } catch (error) { + console.info(tag + ': deleteRawContact error = ' + error); + } + } + + async function insertData(rawContactId, type, value, position) { + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + var contactDataValues1 = + { + "raw_contact_id": rawContactId, "content_type": type, "detail_info": value, "position": position + }; + try { + var contactDataId = await DAHelper.insert(profileContactDataUri, contactDataValues1); + console.info("logMessage : contactDataId " + contactDataId); + expect(contactDataId > 0).assertTrue(); + } catch (error) { + console.info("logMessage : contact_data name insert error = " + error); + } + return contactDataId; + } + + /** + * @tc.number contactCard_insert_test_100 + * @tc.name Insert contact data + * @tc.desc Function test + */ + it("contactCard_insert_test_100", 0, async function (done) { + console.info("------logMessage contactCard_insert_test_100 is starting!-----"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + try { + var rawContactId = await DAHelper.insert(profileRawContactUri, common.getProfileRawContact()); + sleep(1000); + console.info('logMessage contactCard_insert_test_100: rawContactId = ' + rawContactId); + expect(rawContactId > 0).assertTrue(); + var map = common.getProfileRawContactMap(); + map.set("id", rawContactId.toString()); + await contactsQuery(map, "contactCard_insert_test_100", profileRawContactUri); + await deleteRawContact("contactCard_insert_test_100"); + done(); + } catch (error) { + console.info('logMessage contactCard_insert_test_100: insert error = ' + error); + done(); + } + }); + + /** + * @tc.number contactCard_insert_test_400 + * @tc.name Insert contact details (name, company, position, mobile phone number) + * @tc.desc Function test + */ + it("contactCard_insert_test_400", 0, async function (done) { + console.info("------logMessage contactCard_insert_test_400 is starting!-----"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + var insertRawContactValues = { + "display_name": "xiaocheng", + }; + try { + var rawContactId = await DAHelper.insert(profileRawContactUri, insertRawContactValues); + console.info("logMessage contactCard_insert_test_400: rawContactId = " + rawContactId); + expect(rawContactId > 0).assertTrue(); + await dataNameInsert(DAHelper, rawContactId); + await dataCompanyInsert(DAHelper, rawContactId); + await dataPhoneInsert(DAHelper, rawContactId); + await deleteRawContact("contactCard_insert_test_400"); + await deleteAll(profileContactDataUri, "contactCard_insert_test_400"); + done(); + } catch (error) { + console.info("logMessage contactCard_insert_test_400: raw_contact insert error = " + error); + done(); + } + }); + + async function dataNameInsert(DAHelper, rawContactId) { + var contactDataValues1 = { + "raw_contact_id": rawContactId, + "content_type": "name", + "detail_info": "xiaocheng" + }; + try { + var contactDataId1 = await DAHelper.insert(profileContactDataUri, contactDataValues1); + console.info("logMessage contactCard_insert_test_400: contactDataId1 " + contactDataId1); + expect(contactDataId1 > 0).assertTrue(); + var map = new Map(); + map.set("id", contactDataId1.toString()); + map.set("detail_info", "xiaocheng"); + map.set("raw_contact_id", rawContactId.toString()); + await contactsQuery(map, "contactCard_insert_test_400", profileContactDataUri); + } catch (error) { + console.info("logMessage contactCard_insert_test_400: contact_data name insert error = " + error); + done(); + } + } + + async function dataCompanyInsert(DAHelper, rawContactId) { + var contactDataValues2 = { + "raw_contact_id": rawContactId, + "content_type": "organization", + "detail_info": "TT", + "position": "developer" + }; + try { + var contactDataId2 = await DAHelper.insert(profileContactDataUri, contactDataValues2); + console.info("logMessage contactCard_insert_test_400: contactDataId2 " + contactDataId2); + expect(contactDataId2 > 0).assertTrue(); + var map = new Map(); + map.set("id", contactDataId2.toString()); + map.set("detail_info", "TT"); + map.set("position", "developer"); + contactsQuery(map, "contactCard_insert_test_400", profileContactDataUri); + } catch (error) { + console.info("logMessage contactCard_insert_test_400: contact_data company insert error = " + error); + done(); + } + } + + async function dataPhoneInsert(DAHelper, rawContactId) { + var contactDataValues3 = { + "raw_contact_id": rawContactId, + "content_type": "phone", + "detail_info": "12345678" + }; + try { + var contactDataId3 = await DAHelper.insert(profileContactDataUri, contactDataValues3); + sleep(1000); + console.info("logMessage contactCard_insert_test_400: contactDataId3 " + contactDataId3); + expect(contactDataId3 > 0).assertTrue(); + var map = new Map(); + map.set("id", contactDataId3.toString()); + map.set("detail_info", "12345678"); + await contactsQuery(map, "contactCard_insert_test_400", profileContactDataUri); + } catch (error) { + console.info("logMessage contactCard_insert_test_400: contact_data phone insert error = " + error); + done(); + } + } + + /** + * @tc.number contactCard_insert_test_500 + * @tc.name Insert contact details (nickname, email, home) + * @tc.desc Function test + */ + it("contactCard_insert_test_500", 0, async function (done) { + console.info("------logMessage contactCard_insert_test_500 is starting!-----"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + var insertRawContactValues = { + "display_name": "xiaocheng", + }; + try { + var rawContactId = await DAHelper.insert(profileRawContactUri, insertRawContactValues); + console.info("logMessage contactCard_insert_test_500: rawContactId = " + rawContactId); + expect(rawContactId > 0).assertTrue(); + await dataEmailInsert(DAHelper, rawContactId); + await dataNickNameInsert(DAHelper, rawContactId); + await dataPostalAddressInsert(DAHelper, rawContactId); + await deleteRawContact("contactCard_insert_test_500"); + await deleteAll(profileContactDataUri, "contactCard_insert_test_500"); + done(); + } catch (error) { + console.info("logMessage contactCard_insert_test_500: raw_contact insert error = " + error); + done(); + } + }); + + async function dataEmailInsert(DAHelper, rawContactId) { + var contactDataValues1 = { + "raw_contact_id": rawContactId, + "content_type": "email", + "detail_info": "166@163.com" + }; + try { + var contactDataId1 = await DAHelper.insert(profileContactDataUri, contactDataValues1); + sleep(1000); + console.info("logMessage contactCard_insert_test_500: contactDataId1 " + contactDataId1); + expect(contactDataId1 > 0).assertTrue(); + var map = new Map(); + map.set("id", contactDataId1.toString()); + map.set("detail_info", "166@163.com"); + await contactsQuery(map, "contactCard_insert_test_500_1", profileContactDataUri); + } catch (error) { + console.info("logMessage contactCard_insert_test_500: contact_data email insert error = " + error); + } + } + + async function dataNickNameInsert(DAHelper, rawContactId) { + var contactDataValues2 = { + "raw_contact_id": rawContactId, + "content_type": "nickname", + "detail_info": "xiaocheng" + }; + try { + var contactDataId2 = await DAHelper.insert(profileContactDataUri, contactDataValues2); + console.info("logMessage contactCard_insert_test_500: contactDataId2 " + contactDataId2); + expect(contactDataId2 > 0).assertTrue(); + var map = new Map(); + map.set("id", contactDataId2.toString()); + map.set("detail_info", "xiaocheng"); + await contactsQuery(map, "contactCard_insert_test_500_2", profileContactDataUri); + } catch (error) { + console.info("logMessage contactCard_insert_test_500: contact_data nickname insert error = " + error); + } + } + + async function dataPostalAddressInsert(DAHelper, rawContactId) { + var contactDataValues3 = { + "raw_contact_id": rawContactId, + "content_type": "postal_address", + "detail_info": "NanJingSoftRoad" + }; + try { + var contactDataId3 = await DAHelper.insert(profileContactDataUri, contactDataValues3); + console.info("logMessage contactCard_insert_test_500: contactDataId3 " + contactDataId3); + expect(contactDataId3 > 0).assertTrue(); + var map = new Map(); + map.set("id", contactDataId3.toString()); + map.set("detail_info", "NanJingSoftRoad"); + await contactsQuery(map, "contactCard_insert_test_500_3", profileContactDataUri); + } catch (error) { + console.info("logMessage contactCard_insert_test_500: contact_data postal_address insert error = " + error); + } + } + + /** + * @tc.number contactCard_insert_test_600 + * @tc.name Insert contact details (remarks, AIM, birthday) + * @tc.desc Function test + */ + it("contactCard_insert_test_600", 0, async function (done) { + console.info("------logMessage contactCard_insert_test_600 is starting!-----"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + var insertRawContactValues = { + "display_name": "xiaocheng", + }; + try { + var rawContactId = await DAHelper.insert(profileRawContactUri, insertRawContactValues) + console.info("logMessage contactCard_insert_test_600: rawContactId = " + rawContactId); + expect(rawContactId > 0).assertTrue(); + await dataNoteInsert(DAHelper, rawContactId); + await dataAimInsert(DAHelper, rawContactId); + await dataEventInsert(DAHelper, rawContactId); + await deleteRawContact("contactCard_insert_test_600"); + await deleteAll(profileContactDataUri, "contactCard_insert_test_600"); + done(); + } catch (error) { + console.info("logMessage contactCard_insert_test_600: raw_contact insert error = " + error); + done(); + } + }); + + async function dataNoteInsert(DAHelper, rawContactId) { + var contactDataValues1 = { + "raw_contact_id": rawContactId, + "content_type": "note", + "detail_info": "javaGangster" + }; + try { + var contactDataId1 = await DAHelper.insert(profileContactDataUri, contactDataValues1); + console.info("logMessage contactCard_insert_test_600: contactDataId1 " + contactDataId1); + expect(contactDataId1 > 0).assertTrue(); + var map = new Map(); + map.set("id", contactDataId1.toString()); + map.set("detail_info", "javaGangster"); + await contactsQuery(map, "contactCard_insert_test_600_1", profileContactDataUri); + } catch (error) { + console.info("logMessage contactCard_insert_test_600: contact_data note insert error = " + error); + done(); + } + } + + async function dataAimInsert(DAHelper, rawContactId) { + var contactDataValues2 = { + "raw_contact_id": rawContactId, "content_type": "im", "detail_info": "aaaaa" + }; + try { + var contactDataId2 = await DAHelper.insert(profileContactDataUri, contactDataValues2); + console.info("logMessage contactCard_insert_test_600: contactDataId2 " + contactDataId2); + expect(contactDataId2 > 0).assertTrue(); + var map = new Map(); + map.set("id", contactDataId1.toString()); + map.set("detail_info", "aaaaa"); + await contactsQuery(map, "contactCard_insert_test_600_2", profileContactDataUri); + } catch (error) { + console.info("logMessage contactCard_insert_test_600: contact_data aim insert error = " + error); + } + } + + async function dataEventInsert(DAHelper, rawContactId) { + var contactDataValues3 = { + "raw_contact_id": rawContactId, + "content_type": "contact_event", + "detail_info": "19960229" + }; + try { + var contactDataId3 = await DAHelper.insert(profileContactDataUri, contactDataValues3); + console.info("logMessage contactCard_insert_test_600: contactDataId3 " + contactDataId3); + expect(contactDataId3 > 0).assertTrue(); + var map = new Map(); + map.set("id", contactDataId1.toString()); + map.set("detail_info", "19960229"); + await contactsQuery(map, "contactCard_insert_test_600_3", profileContactDataUri); + } catch (error) { + console.info("logMessage contactCard_insert_test_600: contact_data event insert error = " + error); + } + } + + /** + * @tc.number contactCard_insert_test_700 + * @tc.name Insert contact details (URL, assistant, group) + * @tc.desc Function test + */ + it("contactCard_insert_test_700", 0, async function (done) { + console.info("------logMessage contactCard_insert_test_700 is starting!-----"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + var insertRawContactValues = { + "display_name": "xiaocheng", + }; + try { + var rawContactId = await DAHelper.insert(profileRawContactUri, insertRawContactValues); + console.info("logMessage contactCard_insert_test_700: rawContactId = " + rawContactId); + expect(rawContactId > 0).assertTrue(); + await dataWebsiteInsert(DAHelper, rawContactId); + await dataRelationInsert(DAHelper, rawContactId); + await dataWebsiteInsert(DAHelper, rawContactId); + await deleteRawContact("contactCard_insert_test_700"); + await deleteAll(profileContactDataUri, "contactCard_insert_test_700"); + done(); + } catch (error) { + console.info("logMessage contactCard_insert_test_700: raw_contact insert error = " + error); + done(); + } + }); + + async function dataWebsiteInsert(DAHelper, rawContactId) { + var contactDataValues1 = { + "raw_contact_id": rawContactId, + "content_type": "website", + "detail_info": "www.com" + }; + try { + var contactDataId1 = await DAHelper.insert(profileContactDataUri, contactDataValues1); + sleep(1000); + console.info("logMessage contactCard_insert_test_700: contactDataId1 " + contactDataId1); + expect(contactDataId1 > 0).assertTrue(); + var map = new Map(); + map.set("id", contactDataId1.toString()); + map.set("detail_info", "www.com"); + await contactsQuery(map, "contactCard_insert_test_700_1", profileContactDataUri); + await contactDataRelationInsert(); + } catch (error) { + console.info("logMessage contactCard_insert_test_700: contact_data website insert error = " + error); + } + } + + async function dataRelationInsert(DAHelper, rawContactId) { + var contactDataValues2 = { + "raw_contact_id": rawContactId, + "content_type": "relation", + "detail_info": "Secretary" + }; + try { + var contactDataId2 = await DAHelper.insert(profileContactDataUri, contactDataValues2); + sleep(1000); + console.info("logMessage contactCard_insert_test_700: contactDataId2 " + contactDataId2); + expect(contactDataId2 > 0).assertTrue(); + var map = new Map(); + map.set("id", contactDataId2.toString()); + map.set("detail_info", "Secretary"); + await contactsQuery(map, "contactCard_insert_test_700_2", profileContactDataUri); + await contactDataGroupInsert(); + } catch (error) { + console.info("logMessage contactCard_insert_test_700: contact_data relation insert error = " + error); + } + } + + async function dataGroupInsert(DAHelper, rawContactId) { + var contactDataValues3 = { + "raw_contact_id": rawContactId, + "content_type": "group_membership", + "detail_info": "1" + }; + try { + var contactDataId3 = await DAHelper.insert(profileContactDataUri, contactDataValues3); + sleep(1000); + console.info("logMessage contactCard_insert_test_700: contactDataId3 " + contactDataId3); + expect(contactDataId3 > 0).assertTrue(); + var map = new Map(); + map.set("id", contactDataId3.toString()); + map.set("detail_info", "1"); + await contactsQuery(map, "contactCard_insert_test_700_3", profileContactDataUri); + done(); + } catch (error) { + console.info("logMessage contactCard_insert_test_700: contact_data group insert error = " + error); + } + } + + /** + * @tc.number contactCard_insert_test_800 + * @tc.name Insert contact details (phone ringtone) + * @tc.desc Function test + */ + it("contactCard_insert_test_800", 0, async function (done) { + console.info("------logMessage contactCard_insert_test_800 is starting!-----"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + var insertRawContactValues = { + "display_name": "xiaocheng", + }; + try { + var rawContactId = await DAHelper.insert(profileRawContactUri, insertRawContactValues); + console.info("logMessage contactCard_insert_test_800: rawContactId = " + rawContactId); + expect(rawContactId > 0).assertTrue(); + await dataMiscInsert(DAHelper, rawContactId); + await deleteRawContact("contactCard_insert_test_800"); + await deleteAll(profileContactDataUri, "contactCard_insert_test_800"); + done(); + } catch (error) { + console.info("logMessage contactCard_insert_test_800: raw_contact insert error = " + error); + done(); + } + }); + + async function dataMiscInsert(DAHelper, rawContactId) { + var contactDataValues1 = { + "raw_contact_id": rawContactId, + "content_type": "contact_misc", + "detail_info": "1234" + }; + try { + var contactDataId1 = await DAHelper.insert(profileContactDataUri, contactDataValues1); + sleep(1000); + console.info("logMessage contactCard_insert_test_800: contactDataId1 " + contactDataId1); + expect(contactDataId1 > 0).assertTrue(); + var map = new Map(); + map.set("id", contactDataId1.toString()); + map.set("detail_info", "1234"); + await contactsQuery(map, "contactCard_insert_test_800_1", profileContactDataUri); + } catch (error) { + console.info("logMessage contactCard_insert_test_800: contact_data misc insert error = " + error); + } + } + + /** + * @tc.number contactCard_update_test_900 + * @tc.name Update contact data + * @tc.desc Function test + */ + it("contactCard_update_test_900", 0, async function (done) { + console.info("------logMessage contactCard_update_test_900 is starting!-----"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + var insertRawContactValues = { + "display_name": "licheng", + "company": "TT", + "position": "developer", + "favorite": 1, + "phonetic_name": "licheng||lc" + }; + try { + var rawContactId = await DAHelper.insert(profileRawContactUri, insertRawContactValues); + console.info("logMessage contactCard_update_test_900: rawContactId = " + rawContactId); + expect(rawContactId > 0).assertTrue(); + await rawContactUpdate(DAHelper, rawContactId); + await deleteRawContact("contactCard_update_test_900"); + await deleteAll(profileContactDataUri, "contactCard_update_test_900"); + done(); + } catch (error) { + console.info("logMessage contactCard_update_test_900: raw_contact insert error = " + error); + done(); + } + }); + + async function rawContactUpdate(DAHelper, rawContactId) { + var updateValues = { + "display_name": "dacheng", + "company": "oo", + "position": "Testers", + "favorite": 0, + "phonetic_name": "dacheng||dc" + }; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("id", rawContactId.toString()); + try { + var updateCode = await DAHelper.update(profileRawContactUri, updateValues, condition); + sleep(1000); + console.info('logMessage contactCard_update_test_900: updateCode = ' + updateCode); + expect(updateCode == 0).assertTrue(); + var map = new Map(); + map.set("id", rawContactId.toString()); + map.set("display_name", "dacheng"); + map.set("company", "oo"); + map.set("position", "Testers"); + map.set("favorite", "0"); + map.set("phonetic_name", "dacheng||dc"); + await contactsQuery(map, "contactCard_update_test_900", profileRawContactUri); + } catch (error) { + console.info('logMessage contactCard_update_test_900: raw_contact update error = ' + error); + } + } + + /** + * @tc.number contactCard_update_test_1200 + * @tc.name Update contact details (name) + * @tc.desc Function test + */ + it("contactCard_update_test_1200", 0, async function (done) { + console.info("------logMessage contactCard_update_test_1200 is starting!-----"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + var insertRawContactValues = { + "display_name": "xiaoyuan" + }; + try { + var rawContactId = await DAHelper.insert(profileRawContactUri, insertRawContactValues); + console.info("logMessage contactCard_update_test_1200: rawContactId = " + rawContactId); + expect(rawContactId > 0).assertTrue(); + await beforedataNameInsert(DAHelper, rawContactId); + await dataNameUpdate(DAHelper, rawContactId); + await deleteRawContact("contactCard_update_test_1200"); + await deleteAll(profileContactDataUri, "contactCard_update_test_1200"); + done(); + } catch (error) { + console.info('logMessage contactCard_update_test_1200: raw_contact insert error = ' + error); + done(); + } + }); + + async function beforedataNameInsert(DAHelper, rawContactId) { + var contactDataValues = { + "raw_contact_id": rawContactId, "content_type": "name", "detail_info": "xiaoyuan" + }; + try { + var contactDataId = await DAHelper.insert(profileContactDataUri, contactDataValues); + sleep(1000); + console.info('logMessage contactCard_update_test_1200: contactDataId = ' + contactDataId); + expect(contactDataId > 0).assertTrue(); + } catch (error) { + console.info('logMessage contactCard_update_test_1200: contact_data insert error = ' + error); + } + } + + async function dataNameUpdate(DAHelper, rawContactId) { + var updateValues = { + "detail_info": "dayuan" + }; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("raw_contact_id", rawContactId.toString()); + try { + var updateCode = await DAHelper.update(profileContactDataUri, updateValues, condition); + sleep(1000); + console.info('logMessage contactCard_update_test_1200: updateCode = ' + updateCode); + expect(updateCode == 0).assertTrue(); + var map = new Map(); + map.set("id", rawContactId.toString()); + map.set("display_name", "dayuan"); + await contactsQuery(map, "contactCard_update_test_1200", profileRawContactUri); + } catch (error) { + console.info('logMessage contactCard_update_test_1200: contact_data update error = ' + error); + } + } + + /** + * @tc.number contactCard_update_test_1300 + * @tc.name Update contact details (company, position) + * @tc.desc Function test + */ + it("contactCard_update_test_1300", 0, async function (done) { + console.info("------logMessage contactCard_update_test_1300 is starting!-----"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + var insertRawContactValues = { + "display_name": "xiaoyuan" + }; + try { + var rawContactId = await DAHelper.insert(profileRawContactUri, insertRawContactValues); + console.info("logMessage contactCard_update_test_1300: rawContactId = " + rawContactId); + expect(rawContactId > 0).assertTrue(); + await beforedataCompanyInsert(DAHelper, rawContactId); + await dataCompanyUpdate(DAHelper, rawContactId); + await deleteRawContact("contactCard_update_test_1300"); + await deleteAll(profileContactDataUri, "contactCard_update_test_1300"); + done(); + } catch (error) { + console.info('logMessage contactCard_update_test_1300: raw_contact insert error = ' + error); + done(); + } + }); + + async function beforedataCompanyInsert(DAHelper, rawContactId) { + var contactDataValues = { + "raw_contact_id": rawContactId, + "content_type": "organization", + "detail_info": "TT", + "position": "Testers", + }; + try { + var contactDataId = await DAHelper.insert(profileContactDataUri, contactDataValues); + sleep(1000); + console.info('logMessage contactCard_update_test_1300: contactDataId = ' + contactDataId); + expect(contactDataId > 0).assertTrue(); + } catch (error) { + console.info('logMessage contactCard_update_test_1300: contact_data insert error = ' + error); + } + } + + async function dataCompanyUpdate(DAHelper, rawContactId) { + var updateValues = { + "detail_info": "OOOO", "position": "developer" + }; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("raw_contact_id", rawContactId.toString()); + try { + var updateCode = await DAHelper.update(profileContactDataUri, updateValues, condition); + sleep(1000); + console.info('logMessage contactCard_update_test_1300: updateCode = ' + updateCode); + expect(updateCode == 0).assertTrue(); + var map = new Map(); + map.set("id", rawContactId.toString()); + map.set("company", "OOOO"); + map.set("position", "developer"); + await contactsQuery(map, "contactCard_update_test_1300", profileRawContactUri); + } catch (error) { + console.info('logMessage contactCard_update_test_1300: contact_data update error = ' + error); + } + } + + /** + * @tc.number contactCard_update_test_1400 + * @tc.name Update contact details (mobile phone number) + * @tc.desc Function test + */ + it("contactCard_update_test_1400", 0, async function (done) { + console.info("------logMessage contactCard_update_test_1400 is starting!-----"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + var insertRawContactValues = { + "display_name": "xiaoyuan" + }; + try { + var rawContactId = await DAHelper.insert(profileRawContactUri, insertRawContactValues); + console.info("logMessage contactCard_update_test_1400: rawContactId = " + rawContactId); + expect(rawContactId > 0).assertTrue(); + await beforeDataPhoneInsert(DAHelper, rawContactId); + await dataPhoneUpdate(DAHelper, rawContactId); + await deleteRawContact("contactCard_update_test_1400"); + await deleteAll(profileContactDataUri, "contactCard_update_test_1400"); + done(); + } catch (error) { + console.info('logMessage contactCard_update_test_1400: raw_contact insert error = ' + error); + done(); + } + }); + + async function beforeDataPhoneInsert(DAHelper, rawContactId) { + var contactDataValues = { + "raw_contact_id": rawContactId, "content_type": "phone", "detail_info": "123456" + }; + try { + var contactDataId = await DAHelper.insert(profileContactDataUri, contactDataValues); + sleep(1000); + console.info('logMessage contactCard_update_test_1400: contactDataId = ' + contactDataId); + expect(contactDataId > 0).assertTrue(); + } catch (error) { + console.info('logMessage contactCard_update_test_1400: contact_data insert error = ' + error); + } + } + + async function dataPhoneUpdate(DAHelper, rawContactId) { + var updateValues = { + "detail_info": "99663355" + }; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("raw_contact_id", rawContactId.toString()); + try { + var updateCode = await DAHelper.update(profileContactDataUri, updateValues, condition); + sleep(1000); + console.info('logMessage contactCard_update_test_1400: updateCode = ' + updateCode); + expect(updateCode == 0).assertTrue(); + var map = new Map(); + map.set("id", contactDataId.toString()); + map.set("detail_info", "99663355"); + await contactsQuery(map, "contactCard_update_test_1400", profileContactDataUri); + } catch (error) { + console.info('logMessage contactCard_update_test_1400: contact_data update error = ' + error); + } + } + + /** + * @tc.number contactCard_update_test_1500 + * @tc.name Update contact details (nickname) + * @tc.desc Function test + */ + it("contactCard_update_test_1500", 0, async function (done) { + console.info("------logMessage contactCard_update_test_1500 is starting!-----"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + var insertRawContactValues = { + "display_name": "xiaoyuan" + }; + try { + var rawContactId = await DAHelper.insert(profileRawContactUri, insertRawContactValues); + console.info("logMessage contactCard_update_test_1500: rawContactId = " + rawContactId); + expect(rawContactId > 0).assertTrue(); + await beforedataNickNameInsert(DAHelper, rawContactId); + await dataNickNameUpdate(DAHelper, rawContactId); + await deleteRawContact("contactCard_update_test_1500"); + await deleteAll(profileContactDataUri, "contactCard_update_test_1500"); + done(); + } catch (error) { + console.info('logMessage contactCard_update_test_1500: raw_contact insert error = ' + error); + done(); + } + }); + + async function beforedataNickNameInsert(DAHelper, rawContactId) { + var contactDataValues = { + "raw_contact_id": rawContactId, + "content_type": "nickname", + "detail_info": "xiaoyuan" + }; + try { + var contactDataId = await DAHelper.insert(profileContactDataUri, contactDataValues); + sleep(1000); + console.info('logMessage contactCard_update_test_1500: contactDataId = ' + contactDataId); + expect(contactDataId > 0).assertTrue(); + } catch (error) { + console.info('logMessage contactCard_update_test_1500: contact_data insert error = ' + error); + } + } + + async function dataNickNameUpdate(DAHelper, rawContactId) { + var updateValues = { + "detail_info": "fengyuan" + }; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("raw_contact_id", rawContactId.toString()); + try { + var updateCode = await DAHelper.update(profileContactDataUri, updateValues, condition); + sleep(1000); + console.info('logMessage contactCard_update_test_1500: updateCode = ' + updateCode); + expect(updateCode == 0).assertTrue(); + var map = new Map(); + map.set("id", contactDataId.toString()); + map.set("detail_info", "fengyuan"); + await contactsQuery(map, "contactCard_update_test_1500", profileContactDataUri); + } catch (error) { + console.info('logMessage contactCard_update_test_1500: contact_data update error = ' + error); + } + } + + /** + * @tc.number contactCard_update_test_1600 + * @tc.name Update contact details (email) + * @tc.desc Function test + */ + it("contactCard_update_test_1600", 0, async function (done) { + console.info("------logMessage contactCard_update_test_1600 is starting!-----"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + var insertRawContactValues = { + "display_name": "xiaoyuan" + }; + try { + var rawContactId = await DAHelper.insert(profileRawContactUri, insertRawContactValues); + console.info("logMessage contactCard_update_test_1600: rawContactId = " + rawContactId); + expect(rawContactId > 0).assertTrue(); + await beforeDataEmailInsert(DAHelper, rawContactId); + await dataEmailUpdate(DAHelper, rawContactId); + await deleteRawContact("contactCard_update_test_1600"); + await deleteAll(profileContactDataUri, "contactCard_update_test_1600"); + done(); + } catch (error) { + console.info("logMessage contactCard_update_test_1600: raw_contact insert error = " + error); + done(); + } + }); + + async function beforeDataEmailInsert(DAHelper, rawContactId) { + var contactDataValues = { + "raw_contact_id": rawContactId, + "content_type": "email", + "detail_info": "166@163.com" + }; + try { + var contactDataId = await DAHelper.insert(profileContactDataUri, contactDataValues); + sleep(1000); + console.info('logMessage contactCard_update_test_1600: contactDataId = ' + contactDataId); + expect(contactDataId > 0).assertTrue(); + } catch (error) { + console.info('logMessage contactCard_update_test_1600: contact_data insert error = ' + error); + } + } + + async function dataEmailUpdate(DAHelper, rawContactId) { + var updateValues = { + "detail_info": "199@163.com" + }; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("raw_contact_id", rawContactId.toString()); + try { + var updateCode = await DAHelper.update(profileContactDataUri, updateValues, condition) + sleep(1000); + console.info('logMessage contactCard_update_test_1600: updateCode = ' + updateCode); + expect(updateCode == 0).assertTrue(); + var map = new Map(); + map.set("id", contactDataId.toString()); + map.set("detail_info", "199@163.com"); + await contactsQuery(map, "contactCard_update_test_1600", profileContactDataUri); + } catch (error) { + console.info('logMessage contactCard_update_test_1600: update error = ' + error); + } + } + + /** + * @tc.number contactCard_update_test_1700 + * @tc.name Update Contact Details (Residential) + * @tc.desc Function test + */ + it("contactCard_update_test_1700", 0, async function (done) { + console.info("------logMessage contactCard_update_test_1700 is starting!-----"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + var insertRawContactValues = { + "display_name": "xiaoyuan" + }; + try { + var rawContactId = await DAHelper.insert(profileRawContactUri, insertRawContactValues); + console.info("logMessage contactCard_update_test_1700: rawContactId = " + rawContactId); + expect(rawContactId > 0).assertTrue(); + await beforeDataPostalInsert(DAHelper, rawContactId); + await dataPostalUpdate(); + await deleteRawContact("contactCard_update_test_1700"); + await deleteAll(profileContactDataUri, "contactCard_update_test_1700"); + done(); + } catch (error) { + console.info("logMessage contactCard_update_test_1700: raw_contact insert error = " + error); + done(); + } + }); + + async function beforeDataPostalInsert(DAHelper, rawContactId) { + var contactDataValues = { + "raw_contact_id": rawContactId, + "content_type": "postal_address", + "detail_info": "NanJing" + }; + try { + var contactDataId = await DAHelper.insert(profileContactDataUri, contactDataValues); + sleep(1000); + console.info('logMessage contactCard_update_test_1700: contactDataId = ' + contactDataId); + expect(contactDataId > 0).assertTrue(); + } catch (error) { + console.info("logMessage contactCard_update_test_1700: contact_data insert error = " + error); + } + } + + async function dataPostalUpdate(DAHelper, rawContactId) { + var updateValues = { + "detail_info": "BeiJing" + }; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("raw_contact_id", rawContactId.toString()); + try { + var updateCode = await DAHelper.update(profileContactDataUri, updateValues, condition); + sleep(1000); + console.info('logMessage contactCard_update_test_1700: updateCode = ' + updateCode); + expect(updateCode == 0).assertTrue(); + var map = new Map(); + map.set("id", contactDataId.toString()); + map.set("detail_info", "BeiJing"); + await contactsQuery(map, "contactCard_update_test_1700", profileContactDataUri); + } catch (error) { + console.info('logMessage contactCard_update_test_1700: update error = ' + error); + } + } + + /** + * @tc.number contactCard_update_test_1800 + * @tc.name Update contact details (remarks) + * @tc.desc Function test + */ + it("contactCard_update_test_1800", 0, async function (done) { + console.info("------logMessage contactCard_update_test_1800 is starting!-----"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + var insertRawContactValues = { + "display_name": "xiaoyuan" + }; + try { + var rawContactId = await DAHelper.insert(profileRawContactUri, insertRawContactValues); + console.info("logMessage contactCard_update_test_1800: rawContactId = " + rawContactId); + expect(rawContactId > 0).assertTrue(); + await beforedataNoteInsert(DAHelper, rawContactId); + await dataNoteUpdate(DAHelper, rawContactId); + await deleteRawContact("contactCard_update_test_1800"); + await deleteAll(profileContactDataUri, "contactCard_update_test_1800"); + done(); + } catch (error) { + console.info("logMessage contactCard_update_test_1800: raw_contact insert error = " + error); + done(); + } + }); + + async function beforedataNoteInsert(DAHelper, rawContactId) { + var contactDataValues = { + "raw_contact_id": rawContactId, "content_type": "note", "detail_info": "Gangster" + }; + try { + var contactDataId = await DAHelper.insert(profileContactDataUri, contactDataValues); + sleep(1000); + console.info('logMessage contactCard_update_test_1800: contactDataId = ' + contactDataId); + expect(contactDataId > 0).assertTrue(); + } catch (error) { + console.info('logMessage contactCard_update_test_1800: contact_data insert error = ' + error); + } + } + + async function dataNoteUpdate(DAHelper, rawContactId) { + var updateValues = { + "detail_info": "God" + }; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("raw_contact_id", rawContactId.toString()); + try { + var updateCode = await DAHelper.update(profileContactDataUri, updateValues, condition); + sleep(1000); + console.info('logMessage contactCard_update_test_1800: updateCode = ' + updateCode); + expect(updateCode == 0).assertTrue(); + var map = new Map(); + map.set("id", contactDataId.toString()); + map.set("detail_info", "God"); + await contactsQuery(map, "contactCard_update_test_1800", profileContactDataUri); + } catch (error) { + console.info('logMessage contactCard_update_test_1800: update error = ' + error); + } + } + + /** + * @tc.number contactCard_update_test_1900 + * @tc.name Update Contact Details (AIM) + * @tc.desc Function test + */ + it("contactCard_update_test_1900", 0, async function (done) { + console.info("------logMessage contactCard_update_test_1900 is starting!-----"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + var insertRawContactValues = { + "display_name": "xiaoyuan" + }; + try { + var rawContactId = await DAHelper.insert(profileRawContactUri, insertRawContactValues) + console.info("logMessage contactCard_update_test_1900: rawContactId = " + rawContactId); + expect(rawContactId > 0).assertTrue(); + await beforeDataAimInsert(DAHelper, rawContactId); + await dataAimUpdate(DAHelper, rawContactId); + await deleteRawContact("contactCard_update_test_1900"); + await deleteAll(profileContactDataUri, "contactCard_update_test_1900"); + done(); + } catch (error) { + console.info("logMessage contactCard_update_test_1900: raw_contact insert error = " + error); + done(); + } + }); + + async function beforeDataAimInsert(DAHelper, rawContactId) { + var contactDataValues = { + "raw_contact_id": rawContactId, "content_type": "im", "detail_info": "aaaaa" + }; + try { + var contactDataId = await DAHelper.insert(profileContactDataUri, contactDataValues); + sleep(1000); + console.info('logMessage contactCard_update_test_1900: contactDataId = ' + contactDataId); + expect(contactDataId > 0).assertTrue(); + } catch (error) { + console.info("logMessage contactCard_update_test_1900: contact_data insert error = " + error); + } + } + + async function dataAimUpdate(DAHelper, rawContactId) { + var updateValues = { + "detail_info": "bbbbb" + }; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("raw_contact_id", rawContactId.toString()); + try { + var updateCode = await DAHelper.update(profileContactDataUri, updateValues, condition); + sleep(1000); + console.info('logMessage contactCard_update_test_1900: updateCode = ' + updateCode); + expect(updateCode == 0).assertTrue(); + var map = new Map(); + map.set("id", contactDataId.toString()); + map.set("detail_info", "bbbbb"); + await contactsQuery(map, "contactCard_update_test_1900", profileContactDataUri); + } catch (error) { + console.info('logMessage contactCard_update_test_1900: update error = ' + error); + } + } + + /** + * @tc.number contactCard_update_test_2000 + * @tc.name Update Contact Details (Birthday) + * @tc.desc Function test + */ + it("contactCard_update_test_2000", 0, async function (done) { + console.info("------logMessage contactCard_update_test_2000 is starting!-----"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + var insertRawContactValues = { + "display_name": "xiaoyuan" + }; + try { + var rawContactId = await DAHelper.insert(profileRawContactUri, insertRawContactValues); + console.info("logMessage contactCard_update_test_2000: rawContactId = " + rawContactId); + expect(rawContactId > 0).assertTrue(); + await beforeDataEventInsert(DAHelper, rawContactId); + await dataEventUpdate(DAHelper, rawContactId); + await deleteRawContact("contactCard_update_test_2000"); + await deleteAll(profileContactDataUri, "contactCard_update_test_2000"); + done(); + } catch (error) { + console.info("logMessage contactCard_update_test_2000: raw_contact insert error = " + error); + done(); + } + }); + + async function beforeDataEventInsert(DAHelper, rawContactId) { + var contactDataValues1 = { + "raw_contact_id": rawContactId, + "content_type": "contact_event", + "detail_info": "19960229" + }; + try { + var contactDataId = await DAHelper.insert(profileContactDataUri, contactDataValues1); + sleep(1000); + console.info('logMessage contactCard_update_test_2000: contactDataId = ' + contactDataId); + expect(contactDataId > 0).assertTrue(); + } catch (error) { + console.info('logMessage contactCard_update_test_2000: contact_data insert error = ' + error); + } + } + + async function dataEventUpdate(DAHelper, rawContactId) { + var updateValues = { + "detail_info": "19971021" + }; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("raw_contact_id", rawContactId.toString()); + try { + var updateCode = await DAHelper.update(profileContactDataUri, updateValues, condition); + sleep(1000); + console.info('logMessage contactCard_update_test_2000: updateCode = ' + updateCode); + expect(updateCode == 0).assertTrue(); + var map = new Map(); + map.set("id", contactDataId.toString()); + map.set("detail_info", "19971021"); + await contactsQuery(map, "contactCard_update_test_2000", profileContactDataUri); + } catch (error) { + console.info('logMessage contactCard_update_test_2000: update error = ' + error); + } + } + + /** + * @tc.number contactCard_update_test_2100 + * @tc.name Update contact details (website) + * @tc.desc Function test + */ + it("contactCard_update_test_2100", 0, async function (done) { + console.info("------logMessage contactCard_update_test_2100 is starting!-----"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + var insertRawContactValues = { + "display_name": "xiaoyuan" + }; + try { + var rawContactId = await DAHelper.insert(profileRawContactUri, insertRawContactValues); + console.info("logMessage contactCard_update_test_2100: rawContactId = " + rawContactId); + expect(rawContactId > 0).assertTrue(); + await beforeDataWebsiteInsert(DAHelper, rawContactId); + await dataWebsiteUpdate(DAHelper, rawContactId); + await deleteRawContact("contactCard_update_test_2100"); + await deleteAll(profileContactDataUri, "contactCard_update_test_2100"); + done(); + } catch (error) { + console.info("logMessage contactCard_update_test_2100: raw_contact insert error = " + error); + done(); + } + }); + + async function beforeDataWebsiteInsert(DAHelper, rawContactId) { + var contactDataValues1 = { + "raw_contact_id": rawContactId, + "content_type": "website", + "detail_info": "www.com" + }; + try { + var contactDataId = await DAHelper.insert(profileContactDataUri, contactDataValues1); + sleep(1000); + console.info('logMessage contactCard_update_test_2100: contactDataId = ' + contactDataId); + expect(contactDataId > 0).assertTrue(); + } catch (error) { + console.info('logMessage contactCard_update_test_2100: contact_data insert error = ' + error); + } + } + + async function dataWebsiteUpdate(DAHelper, rawContactId) { + var updateValues = { + "detail_info": "www.123.com" + }; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("raw_contact_id", rawContactId.toString()); + try { + var updateCode = await DAHelper.update(profileContactDataUri, updateValues, condition); + sleep(1000); + console.info('logMessage contactCard_update_test_2100: updateCode = ' + updateCode); + expect(updateCode == 0).assertTrue(); + var map = new Map(); + map.set("id", contactDataId.toString()); + map.set("detail_info", "www.123.com"); + await contactsQuery(map, "contactCard_update_test_2100", profileContactDataUri); + } catch (error) { + console.info('logMessage contactCard_update_test_2100: update error = ' + error); + } + } + + /** + * @tc.number contactCard_update_test_2200 + * @tc.name Update contact details (assistant) + * @tc.desc Function test + */ + it("contactCard_update_test_2200", 0, async function (done) { + console.info("------logMessage contactCard_update_test_2200 is starting!-----"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + var insertRawContactValues = { + "display_name": "xiaoyuan" + }; + try { + var rawContactId = await DAHelper.insert(profileRawContactUri, insertRawContactValues); + console.info("logMessage contactCard_update_test_2200: rawContactId = " + rawContactId); + expect(rawContactId > 0).assertTrue(); + await beforeDataRelationInsert(DAHelper, rawContactId); + await dataRelationUpdate(DAHelper, rawContactId); + await deleteRawContact("contactCard_update_test_2200"); + await deleteAll(profileContactDataUri, "contactCard_update_test_2200"); + done(); + } catch (error) { + console.info("logMessage contactCard_update_test_2200: raw_contact insert error = " + error); + done(); + } + }); + + async function beforeDataRelationInsert(DAHelper, rawContactId) { + var contactDataValues = { + "raw_contact_id": rawContactId, + "content_type": "relation", + "detail_info": "Secretary" + }; + try { + var contactDataId = await DAHelper.insert(profileContactDataUri, contactDataValues); + console.info('logMessage contactCard_update_test_2200: contactDataId = ' + contactDataId); + expect(contactDataId > 0).assertTrue(); + } catch (error) { + console.info('logMessage contactCard_update_test_2200: contact_data insert error = ' + error); + } + } + + async function dataRelationUpdate(DAHelper, rawContactId) { + var updateValues = { + "detail_info": "spouse" + }; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("raw_contact_id", rawContactId.toString()); + try { + var updateCode = await DAHelper.update(profileContactDataUri, updateValues, condition); + sleep(1000); + console.info('logMessage contactCard_update_test_2200: updateCode = ' + updateCode); + expect(updateCode == 0).assertTrue(); + var map = new Map(); + map.set("id", contactDataId.toString()); + map.set("detail_info", "spouse"); + await contactsQuery(map, "contactCard_update_test_2200", profileContactDataUri); + } catch (error) { + console.info('logMessage contactCard_update_test_2200: update error = ' + error); + } + } + + /** + * @tc.number contactCard_update_test_2300 + * @tc.name Update contact detail data table (group) + * @tc.desc Function test + */ + it("contactCard_update_test_2300", 0, async function (done) { + console.info("------logMessage contactCard_update_test_2300 is starting!-----"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + var insertRawContactValues = { + "display_name": "xiaoyuan" + }; + try { + var rawContactId = await DAHelper.insert(profileRawContactUri, insertRawContactValues); + console.info("logMessage contactCard_update_test_2300: rawContactId = " + rawContactId); + expect(rawContactId > 0).assertTrue(); + await beforeDataGroupInsert(DAHelper, rawContactId); + await dataGroupUpdate(DAHelper, rawContactId); + await deleteRawContact("contactCard_update_test_2300"); + await deleteAll(profileContactDataUri, "contactCard_update_test_2300"); + done(); + } catch (error) { + console.info("logMessage contactCard_update_test_2300: raw_contact insert error = " + error); + done(); + } + }); + + async function beforeDataGroupInsert(DAHelper, rawContactId) { + var contactDataValues = { + "raw_contact_id": rawContactId, + "content_type": "group_membership", + "detail_info": "2" + }; + try { + var contactDataId = await DAHelper.insert(profileContactDataUri, contactDataValues); + sleep(1000); + console.info('logMessage contactCard_update_test_2300: contactDataId = ' + contactDataId); + expect(contactDataId > 0).assertTrue(); + } catch (error) { + console.info('logMessage contactCard_update_test_2300: contact_data insert error = ' + error); + } + } + + async function dataGroupUpdate(DAHelper, rawContactId) { + var updateValues = { + "detail_info": "7" + }; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("raw_contact_id", rawContactId.toString()); + try { + var updateCode = await DAHelper.update(profileContactDataUri, updateValues, condition); + sleep(1000); + console.info('logMessage contactCard_update_test_2300: updateCode = ' + updateCode); + expect(updateCode == 0).assertTrue(); + var map = new Map(); + map.set("id", contactDataId.toString()); + map.set("detail_info", "3"); + await contactsQuery(map, "contactCard_update_test_2300", profileContactDataUri); + } catch (error) { + console.info('logMessage contactCard_update_test_2300: update error = ' + error); + } + } + + /** + * @tc.number contactCard_update_test_2400 + * @tc.name Update contact detail data table (phone ringtone) + * @tc.desc Function test + */ + it("contactCard_update_test_2400", 0, async function (done) { + console.info("------logMessage contactCard_update_test_2400 is starting!-----"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + var insertRawContactValues = { + "display_name": "xiaoyuan" + }; + try { + var rawContactId = await DAHelper.insert(profileRawContactUri, insertRawContactValues); + sleep(1000); + console.info("logMessage contactCard_update_test_2400: rawContactId = " + rawContactId); + expect(rawContactId > 0).assertTrue(); + await beforeDataMiscInsert(DAHelper, rawContactId); + await dataMiscUpdate(DAHelper, rawContactId); + await deleteRawContact("contactCard_update_test_2400"); + await deleteAll(profileContactDataUri, "contactCard_update_test_2400"); + done(); + } catch (error) { + console.info("logMessage contactCard_update_test_2400: raw_contact insert error = " + error); + done(); + } + }); + + async function beforeDataMiscInsert(DAHelper, rawContactId) { + var contactDataValues1 = { + "raw_contact_id": rawContactId, + "content_type": "contact_misc", + "detail_info": "1234" + }; + try { + var contactDataId = await DAHelper.insert(profileContactDataUri, contactDataValues1); + sleep(1000); + console.info('logMessage contactCard_update_test_2400: contactDataId = ' + contactDataId); + expect(contactDataId > 0).assertTrue(); + } catch (error) { + console.info('logMessage contactCard_update_test_2400: contact_data insert error = ' + error); + } + } + + async function dataMiscUpdate(DAHelper, rawContactId) { + var updateValues = { + "detail_info": "999" + }; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("raw_contact_id", rawContactId.toString()); + try { + var updateCode = await DAHelper.update(profileContactDataUri, updateValues, condition); + sleep(1000); + console.info('logMessage contactCard_update_test_2400: updateCode = ' + updateCode); + expect(updateCode == 0).assertTrue(); + var map = new Map(); + map.set("id", contactDataId.toString()); + map.set("detail_info", "999"); + await contactsQuery(map, "contactCard_update_test_2300", profileContactDataUri); + } catch (error) { + console.info('logMessage contactCard_update_test_2400: update error = ' + error); + } + } + + /** + * @tc.number contactCard_favorite_test_2500 + * @tc.name Favorite contacts + * @tc.desc Function test + */ + it("contactCard_favorite_test_2500", 0, async function (done) { + console.info("-------logMessage contactCard_favorite_test_2500 is starting!------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + var rawContactValues = { + "display_name": "xiaocai", "company": "TT", "position": "Testers" + }; + try { + var rawContactId = await DAHelper.insert(profileRawContactUri, rawContactValues) + console.info('logMessage contactCard_favorite_test_2500: rawContactId = ' + rawContactId); + expect(rawContactId > 0).assertTrue(); + await updateFavorite(DAHelper, rawContactId); + await deleteRawContact("contactCard_favorite_test_2500"); + done(); + } catch (error) { + console.info('logMessage contactCard_favorite_test_2500: raw_contact insert error = ' + error); + done(); + } + }); + + async function updateFavorite(DAHelper, rawContactId) { + var updateValues = { + "favorite": 1 + }; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("id", rawContactId.toString()); + try { + var updateCode = await DAHelper.update(profileRawContactUri, updateValues, condition); + sleep(1000); + console.info("logMessage contactCard_favorite_test_2500: updateCode = " + updateCode); + expect(updateCode == 0).assertTrue(); + var map = new Map(); + map.set("id", rawContactId.toString()); + map.set("display_name", "xiaocai"); + map.set("company", "TT"); + map.set("position", "Testers"); + map.set("favorite", "1"); + await contactsQuery(map, "contactCard_favorite_test_2500", profileRawContactUri); + } catch (error) { + console.info('logMessage contactCard_favorite_test_2500: update error = ' + error); + } + } + + /** + * @tc.number contactCard_unfavorite_test_2600 + * @tc.name Unfavorite contacts + * @tc.desc Function test + */ + it("contactCard_unfavorite_test_2600", 0, async function (done) { + console.info("-------logMessage contactCard_unfavorite_test_2600 is starting!------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + var rawContactValues = { + "display_name": "xiaohong", "company": "TT", "position": "Testers", "favorite": 1 + }; + try { + var rawContactId = await DAHelper.insert(profileRawContactUri, rawContactValues); + console.info('logMessage contactCard_unfavorite_test_2600: rawContactId = ' + rawContactId); + expect(rawContactId > 0).assertTrue(); + await updateUnFavorite(DAHelper, rawContactId); + await deleteRawContact("contactCard_unfavorite_test_2600"); + done(); + } catch (error) { + console.info('logMessage contactCard_unfavorite_test_2600: raw_contact insert error = ' + error); + done(); + } + }); + + async function updateUnFavorite(DAHelper, rawContactId) { + var updateValues = { + "favorite": 0 + }; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("id", rawContactId.toString()); + try { + var updateCode = await DAHelper.update(profileRawContactUri, updateValues, condition); + sleep(1000); + console.info("logMessage contactCard_unfavorite_test_2600: updateCode = " + updateCode); + expect(updateCode == 0).assertTrue(); + var map = new Map(); + map.set("id", rawContactId.toString()); + map.set("display_name", "xiaohong"); + map.set("company", "TT"); + map.set("position", "Testers"); + map.set("favorite", "0"); + await contactsQuery(map, "contactCard_favorite_test_2500", profileRawContactUri); + } catch (error) { + console.info("logMessage contactCard_unfavorite_test_2600: update error = " + error); + } + } + + /** + * @tc.number contactCard_insert_test_2700 + * @tc.name Insert contact black list + * @tc.desc Function test + */ + it("contactCard_insert_test_2700", 0, async function (done) { + console.info("-------logMessage contactCard_insert_test_2700 is starting!------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + try { + var blocklistId = await DAHelper.insert(profileBlocklistUri, common.getProfileBlockList()); + sleep(1000); + console.info('logMessage contactCard_insert_test_2700: blocklistId = ' + blocklistId); + expect(blocklistId > 0).assertTrue(); + var map = common.getProfileBlockListMap(); + map.set("id", blocklistId.toString()); + await contactsQuery(map, "contactCard_insert_test_2700", profileBlocklistUri); + await deleteAll(profileBlocklistUri, "contactCard_insert_test_2700"); + done(); + } catch (error) { + console.info('logMessage contactCard_insert_test_2700: blocklist insert error = ' + error); + done(); + } + }); + + /** + * @tc.number contactCard_delete_test_2800 + * @tc.name Delete contact black list + * @tc.desc Function test + */ + it("contactCard_delete_test_2800", 0, async function (done) { + console.info("-------logMessage contactCard_delete_test_2800 is starting!------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + try { + var blocklistId = await DAHelper.insert(profileBlocklistUri, common.getProfileBlockList()); + sleep(1000); + console.info('logMessage contactCard_delete_test_2800: blocklistId = ' + blocklistId); + expect(blocklistId > 0).assertTrue(); + await blocklistDelete(); + done(); + } catch (error) { + console.info('logMessage contactCard_delete_test_2800: blocklist insert error = ' + error); + done(); + } + + async function blocklistDelete() { + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("id", blocklistId.toString()); + try { + var deleteCode = await DAHelper.delete(profileBlocklistUri, condition); + sleep(1000); + console.info("logMessage contactCard_delete_test_2800: deleteCode = " + deleteCode); + expect(deleteCode == 0).assertTrue(); + var map = new Map(); + map.set("id", blocklistId.toString()); + await queryIdForDelete(map, "contactCard_delete_test_2800", profileBlocklistUri); + } catch (error) { + console.info('logMessage contactCard_delete_test_2800: delete error = ' + error); + done(); + } + } + }); + + /** + * @tc.number contactCard_insert_test_2900 + * @tc.name Insert contact group + * @tc.desc Function test + */ + it("contactCard_insert_test_2900", 0, async function (done) { + console.info("-------logMessage contactCard_insert_test_2900 is starting!-------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + var groupValues = { + "group_name": "TestersThird" + }; + try { + var groupId = await DAHelper.insert(profileGroupUri, groupValues); + sleep(1000); + console.info("logMessage contactCard_insert_test_2900: groupId =" + groupId); + expect(groupId > 0).assertTrue(); + await groupRawContactInsert(DAHelper); + await deleteRawContact("contactCard_insert_test_2900"); + await deleteAll(profileGroupUri, "contactCard_insert_test_2900"); + await deleteAll(profileContactDataUri, "contactCard_insert_test_2900"); + done(); + } catch (error) { + console.info("logMessage contactCard_insert_test_2900: group insert error =" + error); + done(); + } + }); + + async function groupRawContactInsert(DAHelper) { + var rawContactValues = { + "display_name": "liyu" + }; + try { + var rawContactId = await DAHelper.insert(profileRawContactUri, rawContactValues); + sleep(1000); + console.info("logMessage contactCard_insert_test_2900: rawContactId =" + rawContactId); + expect(rawContactId > 0).assertTrue(); + await groupDataInsert(DAHelper, rawContactId); + } catch (error) { + console.info("logMessage contactCard_insert_test_2900: raw_contact insert error =" + error); + } + } + + async function groupDataInsert(DAHelper, rawContactId) { + var contactDataValues = { + "raw_contact_id": rawContactId, + "content_type": "group_membership", + "detail_info": groupId.toString() + }; + try { + var contactDataId = await DAHelper.insert(profileContactDataUri, contactDataValues) + sleep(1000); + console.info("logMessage contactCard_insert_test_2900: contactDataId =" + contactDataId); + expect(contactDataId > 0).assertTrue(); + var map = new Map(); + map.set("id", contactDataId); + map.set("raw_contact_id", rawContactId.toString()); + map.set("detail_info", groupId.toString()); + await contactsQuery(map, "contactCard_insert_test_2900", profileContactDataUri); + } catch (error) { + console.info("logMessage contactCard_insert_test_2900: contact_data insert error =" + error); + } + } + + /** + * @tc.number contactCard_delete_test_3000 + * @tc.name Delete contact group + * @tc.desc Function test + */ + it("contactCard_delete_test_3000", 0, async function (done) { + console.info("-------logMessage contactCard_delete_test_3000 is starting!-------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + var groupValues = { + "group_name": "TestersFourth" + }; + try { + var groupId = await DAHelper.insert(profileGroupUri, groupValues); + sleep(1000); + console.info("logMessage contactCard_delete_test_3000: groupId =" + groupId); + expect(groupId > 0).assertTrue(); + await groupAfterRawContactInsert(DAHelper); + await deleteRawContact("contactCard_delete_test_3000"); + await deleteAll(profileGroupUri, "contactCard_delete_test_3000"); + await deleteAll(profileContactDataUri, "contactCard_delete_test_3000"); + done(); + } catch (error) { + console.info("logMessage contactCard_delete_test_3000: group insert error =" + error); + done(); + } + }); + + async function groupAfterRawContactInsert(DAHelper) { + var rawContactValues = { + "display_name": "liyuchen" + }; + try { + var rawContactId = await DAHelper.insert(profileRawContactUri, rawContactValues); + sleep(1000); + console.info("logMessage contactCard_delete_test_3000: rawContactId =" + rawContactId); + expect(rawContactId > 0).assertTrue(); + await deleteGroupContactDataInsert(DAHelper, rawContactId); + } catch (error) { + console.info("logMessage contactCard_delete_test_3000: raw_contact insert error =" + error); + } + } + + async function deleteGroupContactDataInsert(DAHelper, rawContactId) { + var contactDataValues = { + "raw_contact_id": rawContactId, + "content_type": "group_membership", + "detail_info": groupId.toString() + }; + try { + var contactDataId = await DAHelper.insert(profileContactDataUri, contactDataValues); + console.info("logMessage contactCard_delete_test_3000: contactDataId =" + contactDataId); + expect(contactDataId > 0).assertTrue(); + await deleteGroup(DAHelper, contactDataId); + } catch (error) { + console.info("logMessage contactCard_delete_test_3000: contact_data insert error =" + error); + } + } + + async function deleteGroup(DAHelper, contactDataId) { + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("id", contactDataId.toString()); + try { + var deleteCode = await DAHelper.delete(profileContactDataUri, condition); + sleep(1000); + console.info("logMessage contactCard_delete_test_3000: deleteCode =" + deleteCode); + expect(deleteCode == 0).assertTrue(); + var map = new Map(); + map.set("id", contactDataId.toString()); + await queryIdForDelete(map, "contactCard_delete_test_3000", profileContactDataUri); + } catch (error) { + console.info("logMessage contactCard_delete_test_3000: delete error =" + error); + } + } + + /** + * @tc.number contactCard_query_test_3100 + * @tc.name Query basic information of a single contact + * @tc.desc Function test + */ + it("contactCard_query_test_3100", 0, async function (done) { + console.info("-----------logMessage contactCard_query_test_3100 is starting!------------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + var rawContactValues = { + "display_name": "xiaoyu" + }; + try { + var rawContactId = await DAHelper.insert(profileRawContactUri, rawContactValues); + sleep(1000); + console.info("logMessage contactCard_query_test_3100: rawContactId = " + rawContactId); + expect(rawContactId > 0).assertTrue(); + await rawContactQuery(DAHelper, rawContactId); + await deleteRawContact("contactCard_query_test_3100"); + done(); + } catch (error) { + console.info("logMessage contactCard_query_test_3100: raw_contact insert error = " + error); + done(); + } + }); + + async function rawContactQuery(DAHelper, rawContactId) { + var resultColumns = ["id", "display_name"]; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("id", rawContactId.toString()); + try { + var resultSet = await DAHelper.query(profileRawContactUri, resultColumns, condition); + sleep(2000); + if (resultSet.goToFirstRow()) { + do { + console.info('logMessage contactCard_query_test_3100: id = ' + resultSet.getString(0)); + expect(resultSet.getString(0) == rawContactId).assertEqual(true); + console.info('logMessage contactCard_query_test_3100: displayName = ' + resultSet.getString(1)); + expect(resultSet.getString(1) == "xiaoyu").assertEqual(true); + } while (resultSet.goToNextRow()); + } + resultSet.close(); + } catch (error) { + console.info("logMessage contactCard_query_test_3100: query error = " + error); + } + } + + /** + * @tc.number contactCard_query_test_3200 + * @tc.name Query basic information of multiple contacts + * @tc.desc Function test + */ + it("contactCard_query_test_3200", 0, async function (done) { + console.info("-----------logMessage contactCard_query_test_3200 is starting!------------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + var rawContactValues1 = { + "display_name": "xiaoyu" + }; + try { + var rawContactIdFirst = await DAHelper.insert(profileRawContactUri, rawContactValues1); + sleep(1000); + console.info("logMessage contactCard_query_test_3200: rawContactId = " + rawContactIdFirst); + expect(rawContactIdFirst > 0).assertTrue(); + } catch (error) { + console.info("logMessage contactCard_query_test_3200: raw_contact_1 insert error = " + error); + done(); + } + + var rawContactValues2 = { + "display_name": "xiaohong" + }; + try { + var rawContactIdSecond = await DAHelper.insert(profileRawContactUri, rawContactValues2); + sleep(1000); + console.info("logMessage contactCard_query_test_3200: rawContactId = " + rawContactIdSecond); + expect(rawContactIdSecond > 0).assertTrue(); + await queryTwoRaw(DAHelper, rawContactIdFirst, rawContactIdSecond); + await deleteRawContact("contactCard_query_test_3200"); + done(); + } catch (error) { + console.info("logMessage contactCard_query_test_3200: raw_contact_2 insert error = " + error); + done(); + } + }); + + async function queryTwoRaw(DAHelper, rawContactIdFirst, rawContactIdSecond) { + var resultColumns = ["id", "display_name"]; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("id", rawContactIdFirst.toString()); + condition.or(); + condition.equalTo("id", rawContactIdSecond.toString()); + try { + var resultSet = await DAHelper.query(profileRawContactUri, resultColumns, condition); + sleep(1000); + console.info('logMessage contactCard_query_test_3200: goToFirstRow' + resultSet.goToFirstRow()); + expect(resultSet.goToFirstRow()).assertEqual(true); + if (resultSet.goToFirstRow()) { + do { + console.info("logMessage contactCard_query_test_3200: columnNames :" + resultSet.columnNames); + console.info("logMessage contactCard_query_test_3200: columnCount:" + resultSet.columnCount); + console.info('logMessage contactCard_query_test_3200: id = ' + resultSet.getString(0)); + console.info('logMessage contactCard_query_test_3200: displayName = ' + resultSet.getString(1)); + } while (resultSet.goToNextRow()); + } + resultSet.close(); + } catch (error) { + console.info('logMessage contactCard_query_test_3200: query error' + error); + } + } + + /** + * @tc.number contactCard_query_test_3300 + * @tc.name Query basic information of all contacts + * @tc.desc Function test + */ + it("contactCard_query_test_3300", 0, async function (done) { + console.info("-----------logMessage contactCard_query_test_3300 is starting!------------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + var rawContactValues1 = { + "display_name": "xiaoyu" + }; + try { + var rawContactId = await DAHelper.insert(profileRawContactUri, rawContactValues1); + sleep(1000); + console.info("logMessage contactCard_query_test_3300: rawContactId = " + rawContactId); + expect(rawContactId > 0).assertTrue(); + } catch (error) { + console.info("logMessage contactCard_query_test_3300: raw_contact_1 insert error = " + error); + done(); + } + var resultColumns = ["id", "display_name"]; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.greaterThan("id", "0"); + try { + var resultSet = await DAHelper.query(profileRawContactUri, resultColumns, condition); + sleep(1000); + if (resultSet.goToFirstRow()) { + do { + console.info('logMessage contactCard_query_test_3300: id = ' + resultSet.getString(0)); + expect(resultSet.getString(0) == rawContactId.toString()).assertEqual(true); + console.info('logMessage contactCard_query_test_3300: displayName = ' + resultSet.getString(1)); + expect(resultSet.getString(1) == "xiaoyu").assertEqual(true); + } while (resultSet.goToNextRow()); + } + resultSet.close(); + await deleteRawContact("contactCard_query_test_3300"); + done(); + } catch (error) { + console.info("logMessage contactCard_query_test_3300: query error = " + error); + done(); + } + }); + + /** + * @tc.number contactCard_query_test_3400 + * @tc.name Query all information of a single contact + * @tc.desc Function test + */ + it("contactCard_query_test_3400", 0, async function (done) { + console.info("-----------logMessage contactCard_query_test_3400 is starting!------------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + var rawContactValues = { + "display_name": "xiaoyuzhou", + "company": "TT", + "position": "Testers", + "favorite": 1, + "phonetic_name": "xiaoyu||xy" + }; + try { + var rawContactId = await DAHelper.insert(profileRawContactUri, rawContactValues); + sleep(1000); + console.info("logMessage contactCard_query_test_3400: rawContactId = " + rawContactId); + expect(rawContactId > 0).assertTrue(); + await queryAllInformation(DAHelper, rawContactId); + await deleteRawContact("contactCard_query_test_3400"); + done(); + } catch (error) { + console.info("logMessage contactCard_query_test_3400: raw_contact insert error = " + error); + done(); + } + }); + + async function queryAllInformation(DAHelper, rawContactId) { + var resultColumns = []; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("id", rawContactId.toString()); + try { + var resultSet = await DAHelper.query(profileRawContactUri, resultColumns, condition); + sleep(1000); + if (resultSet.goToFirstRow()) { + do { + var id = resultSet.getString(resultSet.getColumnIndex("id")); + console.info('logMessage contactCard_query_test_3400: id = ' + id); + expect(id == rawContactId).assertEqual(true); + var favorite = resultSet.getString(resultSet.getColumnIndex("favorite")); + console.info('logMessage contactCard_query_test_3400: favorite = ' + favorite); + expect(favorite == "1").assertEqual(true); + var phoneticName = resultSet.getString(resultSet.getColumnIndex("phonetic_name")); + console.info('logMessage contactCard_query_test_3400: phoneticName = ' + phonetic_name); + expect(phoneticName == "xiaoyu||xy").assertEqual(true); + var company = resultSet.getString(resultSet.getColumnIndex("company")); + console.info('logMessage contactCard_query_test_3400: company = ' + company); + expect(company == "TT").assertEqual(true); + var displayName = resultSet.getString(resultSet.getColumnIndex("display_name")); + console.info('logMessage contactCard_query_test_3400: displayName = ' + displayName); + expect(displayName == "xiaoyuzhou").assertEqual(true); + } while (resultSet.goToNextRow()); + } + resultSet.close(); + } catch (error) { + console.info('logMessage contactCard_query_test_3400: query error = ' + error); + } + } + + /** + * @tc.number contactCard_query_test_3500 + * @tc.name Query group member ability + * @tc.desc Function test + */ + it("contactCard_query_test_3500", 0, async function (done) { + console.info("-----------logMessage contactCard_query_test_3500 is starting!------------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + var rawContactValues = { + "display_name": "xiaoyuzhou" + }; + try { + var rawContactId = await DAHelper.insert(profileRawContactUri, rawContactValues); + sleep(1000); + console.info("logMessage contactCard_query_test_3500: rawContactId = " + rawContactId); + expect(rawContactId > 0).assertTrue(); + } catch (error) { + console.info("logMessage contactCard_query_test_3500: raw_contact insert error = " + error); + done(); + } + var groupValues = { + "group_name": "BossBoard3500" + }; + try { + var groupId = await DAHelper.insert(profileGroupUri, groupValues); + sleep(1000); + console.info("logMessage contactCard_query_test_3500: groupId = " + groupId); + expect(groupId > 0).assertTrue(); + } catch (error) { + console.info("logMessage contactCard_query_test_3500: group insert error = " + error); + done(); + } + await groupBossBoardInsert(DAHelper, rawContactId, groupId); + await deleteRawContact("contactCard_query_test_3500"); + await deleteAll(profileGroupUri, "contactCard_query_test_3500"); + await deleteAll(profileContactDataUri, "contactCard_query_test_3500"); + done(); + }); + + async function groupBossBoardInsert(DAHelper, rawContactId, groupId) { + var contactDataValues = { + "raw_contact_id": rawContactId, + "content_type": "group_membership", + "detail_info": groupId.toString() + }; + try { + var contactDataId = await DAHelper.insert(profileContactDataUri, contactDataValues); + sleep(1000); + console.info("logMessage contactCard_query_test_3500: contactDataId = " + contactDataId); + expect(contactDataId > 0).assertTrue(); + await groupBossBoardQuery(DAHelper, rawContactId, groupId); + } catch (error) { + console.info("logMessage contactCard_query_test_3500: query error = " + error); + } + } + + async function groupBossBoardQuery(DAHelper, rawContactId, groupId) { + var resultColumns = ["raw_contact_id", "detail_info"]; + var condition = new ohosDataAbility.DataAbilityPredicates(); + // type_id = 9 data is group + condition.equalTo("type_id", "9"); + condition.and(); + condition.equalTo("detail_info", groupId.toString()); + try { + var resultSet = await DAHelper.query(profileContactDataUri, resultColumns, condition); + sleep(1000); + if (resultSet.goToFirstRow()) { + do { + console.info('logMessage contactCard_query_test_3500: raw_contact_id = ' + resultSet.getString(0)); + expect(resultSet.getString(0) == rawContactId).assertEqual(true); + console.info('logMessage contactCard_query_test_3500: detail_info = ' + resultSet.getString(1)); + expect(resultSet.getString(1) == groupId.toString()).assertEqual(true); + } while (resultSet.goToNextRow()); + } + resultSet.close(); + } catch (error) { + console.info("logMessage contactCard_query_test_3500: query error :" + error); + } + } + + /** + * @tc.number contactCard_query_test_3600 + * @tc.name Query favorite contacts + * @tc.desc Function test + */ + it("contactCard_query_test_3600", 0, async function (done) { + console.info("-----------logMessage contactCard_query_test_3600 is starting!------------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + var rawContactValues = { + "display_name": "xiaoyuzhou", "favorite": 1 + }; + try { + var rawContactId = await DAHelper.insert(profileRawContactUri, rawContactValues); + sleep(1000); + console.info("logMessage contactCard_query_test_3600: rawContactId = " + rawContactId); + expect(rawContactId > 0).assertTrue(); + await queryFavorite(); + await deleteRawContact("contactCard_query_test_3600"); + done(); + } catch (error) { + console.info("logMessage contactCard_query_test_3600: raw_contact insert error = " + error); + done(); + } + + async function queryFavorite() { + var resultColumns = ["id", "display_name"]; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("favorite", "1"); + condition.and(); + condition.equalTo("is_deleted", "0"); + try { + var resultSet = await DAHelper.query(profileRawContactUri, resultColumns, condition); + sleep(1000); + if (resultSet.goToFirstRow()) { + do { + console.info('logMessage contactCard_query_test_3600: id = ' + resultSet.getString(0)); + expect(resultSet.getString(0) == rawContactId.toString()).assertTrue(); + console.info( + 'logMessage contactCard_query_test_3600: displayName = ' + resultSet.getString(1)); + expect(resultSet.getString(1) == "xiaoyuzhou").assertTrue(); + } while (resultSet.goToNextRow()); + } + resultSet.close(); + } catch (error) { + console.info("logMessage contactCard_query_test_3600: query error :" + error); + done(); + } + } + }); + + /** + * @tc.number contactCard_query_test_3700 + * @tc.name Query recent contact ability + * @tc.desc Function test + */ + it("contactCard_query_test_3700", 0, async function (done) { + console.info("-----------logMessage contactCard_query_test_3700 is starting!------------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + var rawContactValues = { + "display_name": "xiaoyuzhou", "lastest_contacted_time": 60 + }; + try { + var rawContactId = await DAHelper.insert(profileRawContactUri, rawContactValues); + sleep(1000); + console.info("logMessage contactCard_query_test_3700: rawContactId = " + rawContactId); + expect(rawContactId > 0).assertTrue(); + await queryContacted(); + await deleteRawContact("contactCard_query_test_3700"); + done(); + } catch (error) { + console.info("logMessage contactCard_query_test_3700: raw_contact insert error = " + error); + done(); + } + + async function queryContacted() { + var resultColumns = ["id", "display_name"]; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.lessThan("lastest_contacted_time", "100"); + condition.and(); + condition.equalTo("is_deleted", "0"); + try { + var resultSet = await DAHelper.query(profileRawContactUri, resultColumns, condition); + sleep(1000); + if (resultSet.goToFirstRow()) { + do { + console.info('logMessage contactCard_query_test_3700: id = ' + resultSet.getString(0)); + expect(resultSet.getString(0) == rawContactId.toString()).assertTrue(); + console.info( + 'logMessage contactCard_query_test_3700: displayName = ' + resultSet.getString(1)); + expect(resultSet.getString(1) == "xiaoyuzhou").assertTrue(); + } while (resultSet.goToNextRow()); + } + resultSet.close(); + } catch (error) { + console.info('logMessage contactCard_query_test_3700: query error' + error); + done(); + } + } + }); + + /** + * @tc.number contactCard_query_test_3800 + * @tc.name Query recently deleted contacts + * @tc.desc Function test + */ + it("contactCard_query_test_3800", 0, async function (done) { + console.info("-----------logMessage contactCard_query_test_3800 is starting!------------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + var rawContactValues = { + "display_name": "xiaocai" + }; + try { + var rawContactId = await DAHelper.insert(profileRawContactUri, rawContactValues); + sleep(1000); + console.info("logMessage contactCard_query_test_3800: rawContactId = " + rawContactId); + expect(rawContactId > 0).assertTrue(); + await rawContactDelete(DAHelper, rawContactId); + await deletedRawContactQuery(DAHelper, rawContactId); + await deleteAll(profileDeletedContactsUri, "contactCard_query_test_3800") + done(); + } catch (error) { + console.info("logMessage contactCard_query_test_3800: raw_contact insert error = " + error); + done(); + } + }); + + async function rawContactDelete(DAHelper, rawContactId) { + var condition1 = new ohosDataAbility.DataAbilityPredicates(); + condition1.equalTo("id", rawContactId.toString()); + try { + var deleteCode = await DAHelper.delete(profileRawContactUri, condition1); + sleep(1000); + console.info('logMessage contactCard_query_test_3800: deleteCode = ' + deleteCode); + expect(deleteCode == 0).assertTrue(); + } catch (error) { + console.info("logMessage contactCard_query_test_3800: raw_contact delete error = " + error); + done(); + } + } + + async function deletedRawContactQuery(DAHelper, rawContactId) { + var resultColumns = ["id", "raw_contact_id", "display_name", "is_deleted"]; + var condition2 = new ohosDataAbility.DataAbilityPredicates(); + condition2.equalTo("raw_contact_id", rawContactId.toString()); + try { + var resultSet = await DAHelper.query(deletedprofileRawContactUri, resultColumns, condition2); + sleep(1000); + if (resultSet.goToFirstRow()) { + console.info('logMessage contactCard_query_test_3800: id = ' + resultSet.getString(0)); + console.info('logMessage contactCard_query_test_3800: raw_contact_id = ' + resultSet.getString(1)); + expect(resultSet.getString(1) == rawContactId.toString()).assertTrue(); + console.info('logMessage contactCard_query_test_3800: displayName = ' + resultSet.getString(2)); + expect(resultSet.getString(2) == "xiaocai").assertTrue(); + console.info('logMessage contactCard_query_test_3800: is_deleted = ' + resultSet.getString(3)); + expect(resultSet.getString(3) == "1").assertTrue(); + } + resultSet.close(); + } catch (error) { + console.info("logMessage contactCard_query_test_3800: query error :" + error); + done(); + } + } + + /** + * @tc.number contactCard_query_test_3900 + * @tc.name Query all mobile phone numbers + * @tc.desc Function test + */ + it("contactCard_query_test_3900", 0, async function (done) { + console.info("-----------logMessage contactCard_query_test_3900 is starting!------------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + var rawContactValues = { + "display_name": "xiaocai" + }; + try { + var rawContactId = await DAHelper.insert(profileRawContactUri, rawContactValues); + sleep(1000); + console.info("logMessage contactCard_query_test_3900: rawContactId = " + rawContactId); + expect(rawContactId > 0).assertTrue(); + await queryPhoneInsert(); + await phoneQuery(rawContactId); + await deleteRawContact("contactCard_query_test_3900"); + await deleteAll(profileContactDataUri, "contactCard_query_test_3900"); + done(); + } catch (error) { + console.info("logMessage contactCard_query_test_3900: raw_contact insert error = " + error); + done(); + } + }); + + async function queryPhoneInsert(DAHelper, rawContactId) { + var contactDataValues = { + "raw_contact_id": rawContactId, + "content_type": "phone", + "detail_info": "1853696321" + }; + try { + var contactDataId = await DAHelper.insert(profileContactDataUri, contactDataValues); + sleep(1000); + console.info("logMessage contactCard_query_test_3900: contactDataId = " + contactDataId); + expect(contactDataId > 0).assertTrue(); + } catch (error) { + console.info("logMessage contactCard_query_test_3900: contact_data insert error = " + error); + } + } + + async function phoneQuery(DAHelper, rawContactId) { + var resultColumns = ["raw_contact_id", "detail_info"]; + var condition = new ohosDataAbility.DataAbilityPredicates(); + // type_id = 5 data is phone + condition.equalTo("content_type", "phone"); + try { + var resultSet = await DAHelper.query(profileContactDataUri, resultColumns, condition); + sleep(1000); + if (resultSet.goToFirstRow()) { + do { + console.info('logMessage contactCard_query_test_3900: raw_contact_id = ' + resultSet.getString(0)); + expect(resultSet.getString(0) == rawContactId.toString()).assertTrue(); + console.info('logMessage contactCard_query_test_3900: detail_info = ' + resultSet.getString(1)); + expect(resultSet.getString(1) == "1853696321").assertTrue(); + } while (resultSet.goToNextRow()); + } + resultSet.close(); + } catch (error) { + console.info('logMessage contactCard_query_test_3900: query error' + error); + } + } + + /** + * @tc.number contactCard_query_test_4000 + * @tc.name Query all mailbox capabilities + * @tc.desc Function test + */ + it("contactCard_query_test_4000", 0, async function (done) { + console.info("-----------logMessage contactCard_query_test_4000 is starting!------------"); + + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + var rawContactValues = { + "display_name": "xiaoyu" + }; + try { + var rawContactId = await DAHelper.insert(profileRawContactUri, rawContactValues); + sleep(1000); + console.info("logMessage contactCard_query_test_4000: rawContactId = " + rawContactId); + expect(rawContactId > 0).assertTrue(); + await queryEmailInsert(DAHelper, rawContactId); + await emailQuery(DAHelper, contactDataId, rawContactId); + await deleteRawContact("contactCard_query_test_4000"); + await deleteAll(profileContactDataUri, "contactCard_query_test_4000"); + done(); + } catch (error) { + console.info("logMessage contactCard_query_test_4000: raw_contact insert error = " + error); + done(); + } + }); + + async function queryEmailInsert(DAHelper, rawContactId) { + var contactDataValues = { + "raw_contact_id": rawContactId, + "content_type": "email", + "detail_info": "16658@163.com" + }; + try { + var contactDataId = await DAHelper.insert(profileContactDataUri, contactDataValues); + sleep(1000); + console.info("logMessage contactCard_query_test_4000: contactDataId = " + contactDataId); + expect(contactDataId > 0).assertTrue(); + } catch (error) { + console.info("logMessage contactCard_query_test_4000: contact_data insert error = " + error); + } + } + + async function emailQuery(DAHelper, contactDataId, rawContactId) { + var resultColumns = ["id", "raw_contact_id", "detail_info"]; + var condition = new ohosDataAbility.DataAbilityPredicates(); + // type_id = 1 data content_type is email + condition.equalTo("type_id", "1").limitAs(3).orderByDesc("id"); + try { + var resultSet = await DAHelper.query(profileContactDataUri, resultColumns, condition); + sleep(1000); + if (resultSet.goToFirstRow()) { + do { + console.info('logMessage contactCard_query_test_4000: id = ' + resultSet.getString(0)); + expect(resultSet.getString(0) == contactDataId.toString()).assertTrue(); + console.info('logMessage contactCard_query_test_4000: raw_contact_id = ' + resultSet.getString(1)); + expect(resultSet.getString(1) == rawContactId.toString()).assertTrue(); + console.info('logMessage contactCard_query_test_4000: detail_info = ' + resultSet.getString(2)); + expect(resultSet.getString(2) == "16658@163.com").assertTrue(); + } while (resultSet.goToNextRow()); + } + resultSet.close(); + } catch (error) { + console.info("logMessage contactCard_query_test_4000: query error :" + error); + } + } + + /** + * @tc.number contactCard_query_test_4100 + * @tc.name Query data information of a single contact + * @tc.desc Function test + */ + it("contactCard_query_test_4100", 0, async function (done) { + console.info("-----------logMessage contactCard_query_test_4100 is starting!------------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + var rawContactValues = { + "display_name": "xiaoyu" + }; + try { + var rawContactId = await DAHelper.insert(profileRawContactUri, rawContactValues); + sleep(1000); + console.info("logMessage contactCard_query_test_4100: rawContactId = " + rawContactId); + expect(rawContactId > 0).assertTrue(); + await queryTwoDataInsert(DAHelper, rawContactId); + await queryTwoDataInsertCompany(DAHelper, rawContactId); + await queryTwo(DAHelper, rawContactId); + await deleteRawContact("contactCard_query_test_4100"); + await deleteAll(profileContactDataUri, "contactCard_query_test_4100"); + del + done(); + } catch (error) { + console.info("logMessage contactCard_query_test_4100: raw_contact insert error = " + error); + done(); + } + }); + + async function queryTwoDataInsert(DAHelper, rawContactId) { + var contactDataValues = { + "raw_contact_id": rawContactId, "content_type": "name", "detail_info": "xiaoyu" + }; + try { + var contactDataId1 = await DAHelper.insert(profileContactDataUri, contactDataValues); + sleep(1000); + console.info("logMessage contactCard_query_test_4100: contactDataId = " + contactDataId1); + expect(contactDataId1 > 0).assertTrue(); + } catch (error) { + console.info("logMessage contactCard_query_test_4100: contact_data name insert error = " + error); + } + } + + async function queryTwoDataInsertCompany(DAHelper, rawContactId) { + var contactDataValues = { + "raw_contact_id": rawContactId, + "content_type": "organization", + "detail_info": "OOOO", + "position": "Testers" + }; + try { + var contactDataId2 = await DAHelper.insert(profileContactDataUri, contactDataValues); + console.info("logMessage contactCard_query_test_4100: contactDataId = " + contactDataId2); + expect(contactDataId2 > 0).assertTrue(); + } catch (error) { + console.info("logMessage contactCard_query_test_4100: contact_data company insert error = " + error); + } + } + + async function queryTwo(DAHelper, rawContactId) { + var resultColumns = ["id", "raw_contact_id", "detail_info", "position"]; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("raw_contact_id", rawContactId.toString()); + try { + var resultSet = await DAHelper.query(profileContactDataUri, resultColumns, condition); + sleep(1000); + var array = [{ + detail_info: "xiaoyu", position: "" + }, { + detail_info: "OOOO", position: "Testers" + }]; + var i = 0; + if (resultSet.goToFirstRow()) { + do { + console.info("logMessage contactCard_query_test_4100: columnNames :" + resultSet.columnNames); + console.info("logMessage contactCard_query_test_4100: columnCount:" + resultSet.columnCount); + console.info('logMessage contactCard_query_test_4100: id = ' + resultSet.getString(0)); + console.info('logMessage contactCard_query_test_4100: raw_contact_id = ' + resultSet.getString(1)); + expect(resultSet.getString(1) == rawContactId.toString()).assertEqual(true); + console.info('logMessage contactCard_query_test_4100: detail_info = ' + resultSet.getString(2)); + expect(resultSet.getString(2) == array[i].detail_info).assertEqual(true); + console.info('logMessage contactCard_query_test_4100: position = ' + resultSet.getString(3)); + expect(resultSet.getString(3) == array[i].position).assertEqual(true); + i++; + } while (resultSet.goToNextRow()); + } + resultSet.close(); + } catch (error) { + console.info("logMessage contactCard_query_test_4100: query error :" + error); + } + } + + /** + * @tc.number contactCard_delete_test_4400 + * @tc.name Delete the basic raw data of the contact and record the deleted basic raw data + * @tc.desc Function test + */ + it("contactCard_delete_test_4400", 0, async function (done) { + console.info("-------logMessage contactCard_delete_test_4400 is starting!-------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + var insertRawContactValues = { + "display_name": "xiaoming" + }; + try { + var rawContactId = await DAHelper.insert(profileRawContactUri, insertRawContactValues); + sleep(1000); + console.info("logMessage contactCard_delete_test_4400: rawContactId = " + rawContactId); + expect(rawContactId > 0).assertTrue(); + await deleteRaw(DAHelper, rawContactId); + await queryDelete(DAHelper, rawContactId); + done(); + } catch (error) { + console.info("logMessage contactCard_delete_test_4400: raw_contact insert error :" + error); + done(); + } + }); + + async function deleteRaw(DAHelper, rawContactId) { + var condition1 = new ohosDataAbility.DataAbilityPredicates(); + condition1.equalTo("id", rawContactId.toString()); + try { + var deleteCode = await DAHelper.delete(profileRawContactUri, condition1); + sleep(1000); + console.info("logMessage contactCard_delete_test_4400: deleteCode = " + deleteCode); + expect(deleteCode == 0).assertTrue(); + } catch (error) { + console.info("logMessage contactCard_delete_test_4400: delete error = " + error); + } + } + + async function queryDelete(DAHelper, rawContactId) { + var resultColumns = ["id", "delete_time", "display_name"]; + var condition2 = new ohosDataAbility.DataAbilityPredicates(); + condition2.equalTo("raw_contact_id", rawContactId.toString()); + try { + var resultSet = await DAHelper.query(deletedprofileRawContactUri, resultColumns, condition2); + sleep(1000); + if (resultSet.goToFirstRow()) { + console.info("logMessage contactCard_delete_test_4400: columnNames:" + resultSet.columnNames); + console.info("logMessage contactCard_delete_test_4400: columnCount:" + resultSet.columnCount); + console.info('logMessage contactCard_delete_test_4400: id = ' + resultSet.getString(0)); + console.info('logMessage contactCard_delete_test_4400: delete_time = ' + resultSet.getString(1)); + console.info('logMessage contactCard_delete_test_4400: displayName = ' + resultSet.getString(2)); + expect(resultSet.getString(2) == "xiaoming").assertTrue(); + } + resultSet.close(); + } catch (error) { + console.info("logMessage contactCard_delete_test_4400: query error:" + error); + } + } + + /** + * @tc.number contactCard_delete_test_4700 + * @tc.name Delete detailed contact data and record detailed data + * @tc.desc Function test + */ + it("contactCard_delete_test_4700", 0, async function (done) { + console.info("-------logMessage contactCard_delete_test_4700 is starting!-------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + var insertRawContactValues = { + "display_name": "xiaozhang", "company": "OOOO", "position": "TestManager" + }; + try { + var rawContactId = await DAHelper.insert(profileRawContactUri, insertRawContactValues); + sleep(1000); + console.info("logMessage contactCard_delete_test_4700: rawContactId = " + rawContactId); + expect(rawContactId > 0).assertTrue(); + await queryDeleteCompanyData(DAHelper, rawContactId); + await rawContactDelete(DAHelper, rawContactId); + await companyRawContactDeleteQuery(DAHelper, rawContactId); + await deleteAll(profileContactDataUri, "contactCard_delete_test_4700"); + done(); + } catch (error) { + console.info("logMessage contactCard_delete_test_4700: raw_contact insert error:" + error); + done(); + } + }); + + async function queryDeleteCompanyData(DAHelper, rawContactId) { + var contactDataValues = { + "raw_contact_id": rawContactId, + "content_type": "organization", + "detail_info": "OOOO", + "position": "TestManager" + }; + try { + var contactDataId = await DAHelper.insert(profileContactDataUri, contactDataValues); + sleep(1000); + console.info("logMessage contactCard_delete_test_4700: contactDataId = " + contactDataId); + expect(contactDataId > 0).assertTrue(); + } catch (error) { + console.info("logMessage contactCard_delete_test_4700: contact_data insert error:" + error); + } + } + + async function rawContactDelete(DAHelper, rawContactId) { + var condition1 = new ohosDataAbility.DataAbilityPredicates(); + condition1.equalTo("id", rawContactId.toString()); + try { + var deleteCode = await DAHelper.delete(profileRawContactUri, condition1); + sleep(1000); + console.info("logMessage contactCard_delete_test_4700: deleteCode = " + deleteCode); + expect(deleteCode == 0).assertTrue(); + } catch (error) { + console.info("logMessage contactCard_delete_test_4700: delete error = " + error); + done(); + } + } + + async function companyRawContactDeleteQuery(DAHelper, rawContactId) { + var resultColumns = ["id", "display_name", "backup_data"]; + var condition2 = new ohosDataAbility.DataAbilityPredicates(); + condition2.equalTo("raw_contact_id", rawContactId.toString()); + try { + var resultSet = await DAHelper.query(deletedprofileRawContactUri, resultColumns, condition2); + sleep(1000); + if (resultSet.goToFirstRow()) { + console.info("logMessage contactCard_delete_test_4700: columnNames:" + resultSet.columnNames); + console.info("logMessage contactCard_delete_test_4700: columnCount:" + resultSet.columnCount); + console.info('logMessage contactCard_delete_test_4700: id = ' + resultSet.getString(0)); + console.info('logMessage contactCard_delete_test_4700: displayName = ' + resultSet.getString(1)); + expect(resultSet.getString(1) == "xiaozhang").assertEqual(true); + console.info('logMessage contactCard_delete_test_4700: backup_data = ' + resultSet.getString(2)); + } + resultSet.close(); + } catch (error) { + console.info("logMessage contactCard_delete_test_4700: query error:" + error); + } + } + + /** + * @tc.number contactCard_delete_test_4800 + * @tc.name Delete and record basic data of a single contact + * @tc.desc Function test + */ + it("contactCard_delete_test_4800", 0, async function (done) { + console.info("-------logMessage contactCard_delete_test_4800 is starting!-------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + var insertRawContactValues = { + "display_name": "xiaopeng" + }; + try { + var rawContactId = await DAHelper.insert(profileRawContactUri, insertRawContactValues); + sleep(1000); + console.info("logMessage contactCard_delete_test_4800: rawContactId = " + rawContactId); + expect(rawContactId > 0).assertTrue(); + await contactDelete(DAHelper, rawContactId); + await deletedRawContactQuery(DAHelper, rawContactId) + await deleteAll(profileContactDataUri, "contactCard_delete_test_4800"); + done(); + } catch (error) { + console.info("logMessage contactCard_delete_test_4800: raw_contact insert error:" + error); + done(); + } + }); + + async function contactDelete(DAHelper, rawContactId) { + var condition1 = new ohosDataAbility.DataAbilityPredicates(); + condition1.equalTo("name_raw_contact_id", rawContactId.toString()); + try { + var deleteCode = await DAHelper.delete(profilecontactUri, condition1); + sleep(1000); + console.info("logMessage contactCard_delete_test_4800: deleteCode = " + deleteCode); + expect(deleteCode == 0).assertTrue(); + } catch (error) { + console.info("logMessage contactCard_delete_test_4800: delete error = " + error); + } + } + + async function deletedRawContactQuery(DAHelper, rawContactId) { + var resultColumns = ["id", "delete_time", "display_name"]; + var condition2 = new ohosDataAbility.DataAbilityPredicates(); + condition2.equalTo("raw_contact_id", rawContactId.toString()); + try { + var resultSet = await DAHelper.query(deletedprofileRawContactUri, resultColumns, condition2); + sleep(1000) + if (resultSet.goToFirstRow()) { + console.info("logMessage contactCard_delete_test_4800: columnNames:" + resultSet.columnNames); + console.info("logMessage contactCard_delete_test_4800: columnCount:" + resultSet.columnCount); + console.info('logMessage contactCard_delete_test_4800: id = ' + resultSet.getString(0)); + console.info('logMessage contactCard_delete_test_4800: delete_time = ' + resultSet.getString(1)); + console.info('logMessage contactCard_delete_test_4800: displayName = ' + resultSet.getString(2)); + expect(resultSet.getString(2) == "xiaopeng").assertTrue(); + } + resultSet.close(); + } catch (error) { + console.info("logMessage contactCard_delete_test_4800: query error:" + error); + } + } + + /** + * @tc.number contactCard_batchinsert_test_4900 + * @tc.name Insert contacts in batches(raw_contact) + * @tc.desc Function test + */ + it("contactCard_batchinsert_test_4900", 0, async function (done) { + console.info("--------logMessage contactCard_batchinsert_test_4900 is starting!-------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + try { + var batchInsertCode = await DAHelper.batchInsert(profileRawContactUri, common.getContactBatchCompany()); + sleep(1000); + console.info("logMessage contactCard_batchinsert_test_4900: batchInsertCode = " + batchInsertCode); + expect(batchInsertCode == 0).assertTrue(); + var resultColumns = []; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("company", "TT4900"); + var resultSet = await DAHelper.query(profileRawContactUri, resultColumns, condition); + console.info( + 'contactCard_batchinsert_test_4900 : queryBatch start ! resultSet.rowCount = ' + resultSet.rowCount); + expect(resultSet.rowCount == 5).assertEqual(true); + resultSet.close(); + await deleteRawContact("contactCard_batchinsert_test_4900"); + done(); + } catch (error) { + console.info("logMessage contactCard_batchinsert_test_4900: batchInsert error = " + error); + done(); + } + }); + + /** + * @tc.number contactCard_batchinsert_test_5000 + * @tc.name Insert contact_data in batches of address book + * @tc.desc Function test + */ + it("contactCard_batchinsert_test_5000", 0, async function (done) { + console.info("--------logMessage contactCard_batchinsert_test_5000 start!-------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + var rawContactValues = { + "display_name": "xiaozhi" + }; + try { + var rawContactId = await DAHelper.insert(profileRawContactUri, rawContactValues); + sleep(1000); + console.info("logMessage contactCard_batchinsert_test_5000: rawContactId = " + rawContactId); + expect(rawContactId > 0).assertTrue(); + await contactDataBatchInsert(rawContactId); + done(); + } catch (error) { + console.info("logMessage contactCard_batchinsert_test_5000: raw_contact insert error = " + error); + done(); + } + async function contactDataBatchInsert(rawContactId) { + try { + var batchInsertCode = + await DAHelper.batchInsert(profileContactDataUri, common.getContactBatchCompanyTwo()); + sleep(1000); + console.info("logMessage contactCard_batchinsert_test_5000: batchInsertCode = " + batchInsertCode); + expect(batchInsertCode == 0).assertTrue(); + var map = new Map(); + map.set("raw_contact_id", rawContactId.toString()); + await queryBatch(map, "contactCard_batchinsert_test_5000", 5); + await deleteRawContact("contactCard_batchinsert_test_5000"); + done(); + } catch (error) { + console.info("logMessage contactCard_batchinsert_test_5000: batchInsert error = " + error); + done(); + } + } + }); + + /** + * @tc.number contactCard_batchinsert_test_5400 + * @tc.name Batch operation of contact black list + * @tc.desc Function test + */ + it("contactCard_batchinsert_test_5400", 0, async function (done) { + console.info("--------logMessage contactCard_batchinsert_test_5400 is starting!-------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + try { + var batchInsertCode = await DAHelper.batchInsert(profileBlocklistUri, common.getPhoneNumberBatch()); + sleep(1000); + console.info("logMessage contactCard_batchinsert_test_5400: batchInsertCode = " + batchInsertCode); + expect(batchInsertCode == 0).assertTrue(); + await query(5); + await blocklistDelete(); + done(); + } catch (error) { + console.info("logMessage contactCard_batchinsert_test_5400: batchInsert error = " + error); + done(); + } + + async function blocklistDelete() { + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("phone_number", "85525040585400"); + try { + var deleteCode = await DAHelper.delete(profileBlocklistUri, condition); + console.info("logMessage contactCard_batchinsert_test_5400: deleteCode = " + deleteCode); + expect(deleteCode == 0).assertTrue(); + await query(0); + done(); + } catch (error) { + console.info("logMessage contactCard_batchinsert_test_5400: delete error = " + error); + done(); + } + } + + async function query(size) { + var resultColumns = []; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("phone_number", "85525040585400"); + try { + var resultSet = await DAHelper.query(profileBlocklistUri, resultColumns, condition); + sleep(1000); + console.info('contactCard_batchinsert_test_5400 : queryBatch start ! resultSet.rowCount = ' + + resultSet.rowCount); + expect(resultSet.rowCount == size).assertEqual(true); + resultSet.close(); + } catch (error) { + console.info(" contactCard_batchinsert_test_5400 logMessage resultSet.rowCount: error = " + error); + } + } + }); + + /** + * @tc.number contactCard_update_test_5300 + * @tc.name Bulk favorites and unfavorites of contacts + * @tc.desc Function test + */ + it("contactCard_update_test_5300", 0, async function (done) { + console.info("--------logMessage contactCard_update_test_5300 is starting!-------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + var rawContactValuesOne = { + "display_name": "fengyuan", "favorite": 1 + }; + var rawContactValuesTwo = { + "display_name": "xiaoli", "favorite": 1 + }; + var rawContactValuesThree = { + "display_name": "xiaoma", "favorite": 1 + }; + var listAddBluk = [] + listAddBluk[0] = rawContactValuesOne; + listAddBluk[1] = rawContactValuesTwo; + listAddBluk[2] = rawContactValuesThree; + try { + var batchInsertCode = await DAHelper.batchInsert(profileRawContactUri, listAddBluk); + sleep(1000); + console.info("logMessage contactCard_update_test_5300: batchInsertCode = " + batchInsertCode); + expect(batchInsertCode == 0).assertTrue(); + await rawContactUpdateUnFavorites(DAHelper); + await queryUnFavorites(DAHelper); + await deleteRawContact("contactCard_update_test_5300"); + done(); + } catch (error) { + console.info("logMessage contactCard_update_test_5300: batchInsert error = " + error); + done(); + } + }); + + async function rawContactUpdateUnFavorites(DAHelper) { + var updateValues = { + "favorite": 0 + }; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("display_name", "fengyuan"); + condition.or(); + condition.equalTo("display_name", "xiaoma"); + try { + var updateCode = await DAHelper.update(profileRawContactUri, updateValues, condition); + sleep(1000); + console.info("logMessage contactCard_update_test_5300: updateCode = " + updateCode); + expect(updateCode == 0).assertTrue(); + } catch (error) { + console.info("logMessage contactCard_update_test_5300: update error = " + error); + } + } + + async function queryUnFavorites(DAHelper) { + var resultColumns = []; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("display_name", "fengyuan"); + condition.or(); + condition.equalTo("display_name", "xiaoma"); + try { + var resultSet = await DAHelper.query(profileRawContactUri, resultColumns, condition); + sleep(1000); + console.info( + 'contactCard_update_test_5300 : queryBatch start ! resultSet.rowCount = ' + resultSet.rowCount); + expect(resultSet.rowCount == 2).assertEqual(true); + if (resultSet.rowCount > 0) { + if (resultSet.goToFirstRow()) { + do { + var dbresult = resultSet.getString(resultSet.getColumnIndex("favorite")); + console.info(' contactCard_update_test_5300 :logMessage contactsQuery dbresult :' + dbresult + + ' value : ' + value); + expect(dbresult == "0").assertEqual(true); + } while (resultSet.goToNextRow()); + } + } + resultSet.close(); + } catch (error) { + console.info(" contactCard_batchinsert_test_5400 logMessage resultSet.rowCount: error = " + error); + } + } + + /** + * @tc.number contactCard_batchinsert_test_5500 + * @tc.name Contacts are added to and removed from groups in batches + * @tc.desc Function test + */ + it("contactCard_batchinsert_test_5500", 0, async function (done) { + console.info("--------logMessage contactCard_batchinsert_test_5500 is starting!-------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + var groupValues = { + "group_name": "ManagerGroup" + }; + try { + var groupId = await DAHelper.insert(profileGroupUri, groupValues); + console.info("logMessage contactCard_batchinsert_test_5500: groupId = " + groupId); + expect(groupId > 0).assertTrue(); + } catch (error) { + console.info("logMessage contactCard_batchinsert_test_5500: group insert error = " + error); + done(); + } + + try { + var rawContactValues1 = { + "display_name": "xiaohuang" + }; + var rawContactIdFirst = await DAHelper.insert(profileRawContactUri, rawContactValues1); + console.info("logMessage contactCard_batchinsert_test_5500: rawContactIdFirst = " + rawContactIdFirst); + expect(rawContactIdFirst > 0).assertTrue(); + } catch (error) { + console.info("logMessage contactCard_batchinsert_test_5500: raw_contact_1 insert error = " + error); + done(); + } + + try { + var rawContactValues2 = { + "display_name": "xiaolv" + }; + var rawContactIdSecond = await DAHelper.insert(profileRawContactUri, rawContactValues2); + console.info("logMessage contactCard_batchinsert_test_5500: rawContactIdSecond = " + rawContactIdSecond); + expect(rawContactIdSecond > 0).assertTrue(); + } catch (error) { + console.info("logMessage contactCard_batchinsert_test_5500: raw_contact_2 insert error = " + error); + done(); + } + + try { + var rawContactValues3 = { + "display_name": "xiaobai" + }; + var rawContactIdThird = await DAHelper.insert(profileRawContactUri, rawContactValues3); + console.info("logMessage contactCard_batchinsert_test_5500: rawContactIdThird = " + rawContactIdThird); + expect(rawContactIdThird > 0).assertTrue(); + } catch (error) { + console.info("logMessage contactCard_batchinsert_test_5500: raw_contact_3 insert error = " + error); + done(); + } + await threeDataInsert(DAHelper, rawContactIdFirst, rawContactIdSecond, rawContactIdThird, groupId); + await deleteRawContact("contactCard_batchinsert_test_5500"); + await deleteAll(profileGroupUri, "contactCard_batchinsert_test_5500"); + await deleteAll(profileContactDataUri, "contactCard_batchinsert_test_5500"); + done(); + }); + + async function threeDataInsert(DAHelper, rawContactIdFirst, rawContactIdSecond, rawContactIdThird, groupId) { + var contactDataValues1 = { + "raw_contact_id": rawContactIdFirst, + "content_type": "group_membership", + "detail_info": groupId.toString() + }; + var contactDataValues2 = { + "raw_contact_id": rawContactIdSecond, + "content_type": "group_membership", + "detail_info": groupId.toString() + }; + var contactDataValues3 = { + "raw_contact_id": rawContactIdThird, + "content_type": "group_membership", + "detail_info": groupId.toString() + }; + var listAddBluk = []; + listAddBluk[0] = contactDataValues1; + listAddBluk[1] = contactDataValues2; + listAddBluk[2] = contactDataValues3; + try { + var batchInsertCode = await DAHelper.batchInsert(profileContactDataUri, listAddBluk); + sleep(1000); + console.info("logMessage contactCard_batchinsert_test_5500: batchInsertCode = " + batchInsertCode); + expect(batchInsertCode == 0).assertTrue(); + await contactDataDelete(DAHelper, rawContactIdFirst, rawContactIdThird); + } catch (error) { + console.info("logMessage contactCard_batchinsert_test_5500: batchInsert error = " + error); + } + } + + async function contactDataDelete(DAHelper, rawContactIdFirst, rawContactIdThird) { + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("raw_contact_id", rawContactIdFirst.toString()); + condition.or(); + condition.equalTo("raw_contact_id", rawContactIdThird.toString()); + try { + var deleteCode = await DAHelper.delete(profileContactDataUri, condition); + sleep(1000); + console.info("logMessage contactCard_batchinsert_test_5500: deleteCode = " + deleteCode); + expect(deleteCode == 0).assertTrue(); + await queryTwoData(DAHelper, rawContactIdFirst, rawContactIdThird); + } catch (error) { + console.info("logMessage contactCard_batchinsert_test_5500: delete error = " + error); + } + } + + async function queryTwoData(DAHelper, rawContactIdFirst, rawContactIdThird) { + var resultColumns = []; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("raw_contact_id", rawContactIdFirst.toString()); + condition.or(); + condition.equalTo("raw_contact_id", rawContactIdThird.toString()); + try { + var resultSet = await DAHelper.query(profileContactDataUri, resultColumns, condition); + sleep(1000); + console.info( + 'contactCard_batchinsert_test_5500 : queryBatch start ! resultSet.rowCount = ' + resultSet.rowCount); + expect(resultSet.rowCount == 0).assertEqual(true); + resultSet.close(); + } catch (error) { + console.info(" contactCard_batchinsert_test_5400 logMessage resultSet.rowCount: error = " + error); + } + } + + /** + * @tc.number contactCard_pinyin_query_test_200 + * @tc.name Contact name to pinyin (Chinese Simplified) + * @tc.desc Function test + */ + it("contactCard_pinyin_query_test_200", 0, async function (done) { + console.info("--------logMessage contactCard_pinyin_query_test_200 is starting!-------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + var rawContactValues = { + "display_name": "小黄" + }; + try { + var rawContactId = await DAHelper.insert(profileRawContactUri, rawContactValues); + console.info('logMessage contactCard_pinyin_query_test_200 rawContactId = ' + rawContactId); + expect(rawContactId > 0).assertTrue(); + await contactDataInsert(); + await deleteRawContact("contactCard_pinyin_query_test_100"); + await deleteAll(profileContactDataUri, "contactCard_pinyin_query_test_100"); + done(); + } catch (error) { + console.info("logMessage contactCard_pinyin_query_test_200: raw_contact insert error = " + error); + done(); + } + + async function contactDataInsert() { + var contactDataValues = { + "raw_contact_id": rawContactId, + "content_type": "name", + "detail_info": "xiaohuang" + }; + try { + var contactDataId = await DAHelper.insert(profileContactDataUri, contactDataValues); + console.info('logMessage contactCard_pinyin_query_test_200 contactDataId = ' + contactDataId); + expect(contactDataId > 0).assertTrue(); + await searchQuery(DAHelper, rawContactId); + } catch (error) { + console.info('logMessage contactCard_pinyin_query_test_200 contact_data insert error = ' + error); + done(); + } + } + }); + + async function searchQuery(DAHelper, rawContactId) { + var resultColumns = ["id", "search_name"]; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("raw_contact_id", rawContactId.toString()); + try { + var resultSet = await DAHelper.query(profilesearchContactUri, resultColumns, condition); + var map = common.getSearchMap(); + map.set("raw_contact_id", rawContactId.toString()); + if (resultSet.goToFirstRow()) { + do { + for (var [key, value] of map) { + var dbresult = resultSet.getString(resultSet.getColumnIndex(key)); + console.info(tag + ':contactCard_pinyin_query_test_200 key = ' + key + + ' dbresult :' + dbresult + ' value : ' + value); + expect(value == dbresult).assertEqual(true); + } + } while (resultSet.goToNextRow()); + } + resultSet.close(); + } catch (error) { + console.info('logMessage contactCard_pinyin_query_test_200 query error = ' + error); + } + } + + /** + * @tc.number contactCard_pinyin_query_test_100 + * @tc.name Contact name to pinyin (Chinese Traditional) + * @tc.desc Function test + */ + it("contactCard_pinyin_query_test_100", 0, async function (done) { + console.info("--------logMessage contactCard_pinyin_query_test_100 is starting!-------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + var rawContactValues = { + "display_name": "鍵盤" + }; + try { + var rawContactId = await DAHelper.insert(profileRawContactUri, rawContactValues); + sleep(1000); + console.info('logMessage contactCard_pinyin_query_test_100 rawContactId = ' + rawContactId); + expect(rawContactId > 0).assertTrue(); + await contactDataInsert(); + await deleteRawContact("contactCard_pinyin_query_test_100"); + await deleteAll(profileContactDataUri, "contactCard_pinyin_query_test_100"); + done(); + } catch (error) { + console.info('logMessage contactCard_pinyin_query_test_100 raw_contact insert error = ' + error); + done(); + } + + async function contactDataInsert() { + var contactDataValues = { + "raw_contact_id": rawContactId, "content_type": "name", "detail_info": "鍵盤" + }; + try { + var contactDataId = await DAHelper.insert(profileContactDataUri, contactDataValues); + sleep(1000); + console.info('logMessage contactCard_pinyin_query_test_100 contactDataId = ' + contactDataId); + expect(contactDataId > 0).assertTrue(); + await searchContactQueryChinese(DAHelper, rawContactId); + } catch (error) { + console.info('logMessage contactCard_pinyin_query_test_100 contact_data insert error = ' + error); + done(); + } + } + }); + + async function searchContactQueryChinese(DAHelper, rawContactId) { + var resultColumns = ["raw_contact_id", "search_name"]; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("raw_contact_id", rawContactId.toString()); + try { + var resultSet = await DAHelper.query(profilesearchContactUri, resultColumns, condition); + if (resultSet.goToFirstRow()) { + do { + console.info('logMessage contactCard_pinyin_query_test_100: id = ' + resultSet.getString(0)); + expect(resultSet.getString(0) == rawContactId.toString()).assertEqual(true); + console.info( + 'logMessage contactCard_pinyin_query_test_100: search_name = ' + resultSet.getString(1)); + expect(resultSet.getString(1) == "鍵盤||jianpan||jp").assertEqual(true); + } while (resultSet.goToNextRow()); + } + resultSet.close(); + } catch (error) { + console.info('logMessage contactCard_pinyin_query_test_100 query error = ' + error); + } + } + + /** + * @tc.number contactCard_pinyin_query_test_300 + * @tc.name Contact name to pinyin (English) + * @tc.desc Function test + */ + it("contactCard_pinyin_query_test_300", 0, async function (done) { + console.info("--------logMessage contactCard_pinyin_query_test_300 is starting!-------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + var rawContactValues = { + "display_name": "Tom" + }; + try { + var rawContactId = await DAHelper.insert(profileRawContactUri, rawContactValues); + sleep(1000); + console.info('logMessage contactCard_pinyin_query_test_300 rawContactId = ' + rawContactId); + expect(rawContactId > 0).assertTrue(); + await contactDataInsert(); + await deleteRawContact("contactCard_pinyin_query_test_300"); + done(); + } catch (error) { + console.info('logMessage contactCard_pinyin_query_test_300 raw_contact insert error = ' + error); + done(); + } + + async function contactDataInsert() { + var contactDataValues = { + "raw_contact_id": rawContactId, "content_type": "name", "detail_info": "Tom" + }; + try { + var contactDataId = await DAHelper.insert(profileContactDataUri, contactDataValues); + console.info('logMessage contactCard_pinyin_query_test_300 contactDataId = ' + contactDataId); + expect(contactDataId > 0).assertTrue(); + await searchContactQuery(DAHelper, rawContactId); + } catch (error) { + console.info('logMessage contactCard_pinyin_query_test_300 contact_data insert error = ' + error); + done(); + } + } + }); + + async function searchContactQuery(DAHelper, rawContactId) { + var resultColumns = ["raw_contact_id", "search_name"]; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("raw_contact_id", rawContactId.toString()); + try { + var resultSet = await DAHelper.query(profilesearchContactUri, resultColumns, condition); + if (resultSet.goToFirstRow()) { + do { + console.info('logMessage contactCard_pinyin_query_test_300: id = ' + resultSet.getString(0)); + expect(resultSet.getString(0) == rawContactId.toString()).assertTrue(); + console.info( + 'logMessage contactCard_pinyin_query_test_300: search_name = ' + resultSet.getString(1)); + expect(resultSet.getString(1) == "Tom||Tom||Tom").assertTrue(); + } while (resultSet.goToNextRow()); + } + resultSet.close(); + } catch (error) { + console.info('logMessage contactCard_pinyin_query_test_300 query error = ' + error); + } + } + + /** + * @tc.number contactCard_fuzzyquery_test_400 + * @tc.name Contact fuzzy search query interface (name) + * @tc.desc Function test + */ + it("contactCard_fuzzyquery_test_400", 0, async function (done) { + console.info("--------logMessage contactCard_fuzzyquery_test_400 is starting!-------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + var rawContactValues = { + "display_name": "400xiaoming400" + }; + try { + var rawContactId = await DAHelper.insert(profileRawContactUri, rawContactValues); + sleep(1000); + console.info('logMessage contactCard_fuzzyquery_test_400 rawContactId = ' + rawContactId); + expect(rawContactId > 0).assertTrue(); + await rawContactNameQuery(); + await deleteRawContact("contactCard_fuzzyquery_test_400"); + done(); + } catch (error) { + console.info('logMessage contactCard_fuzzyquery_test_400 raw_contact insert error = ' + error); + done(); + } + + async function rawContactNameQuery() { + var resultColumns = ["id", "display_name"]; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.like("display_name", "%xiaoming40%"); + condition.and(); + condition.equalTo("is_deleted", "0"); + try { + var resultSet = await DAHelper.query(profileRawContactUri, resultColumns, condition); + if (resultSet.goToFirstRow()) { + do { + console.info('logMessage contactCard_fuzzyquery_test_400: id = ' + resultSet.getString(0)); + expect(resultSet.getString(0) == rawContactId.toString()).assertEqual(true); + console.info( + 'logMessage contactCard_fuzzyquery_test_400: displayName = ' + resultSet.getString(1)); + expect(resultSet.getString(1) == "400xiaoming400").assertEqual(true); + } while (resultSet.goToNextRow()); + } + resultSet.close(); + } catch (error) { + console.info('logMessage contactCard_fuzzyquery_test_400 query error = ' + error); + done(); + } + } + }); + + /** + * @tc.number contactCard_fuzzyquery_test_500 + * @tc.name Contact fuzzy search query interface (name pinyin, pinyin name) + * @tc.desc Function test + */ + it("contactCard_fuzzyquery_test_500", 0, async function (done) { + console.info("--------logMessage contactCard_fuzzyquery_test_500 is starting!-------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + var rawContactValues = { + "display_name": "500xiaoming500", "phonetic_name": "500xiaoming500||xm" + }; + try { + var rawContactId = await DAHelper.insert(profileRawContactUri, rawContactValues); + sleep(1000); + console.info('logMessage contactCard_fuzzyquery_test_500 rawContactId = ' + rawContactId); + expect(rawContactId > 0).assertTrue(); + await rawContactPhoneticNameQuery(); + await deleteRawContact("contactCard_fuzzyquery_test_500"); + done(); + } catch (error) { + console.info('logMessage contactCard_fuzzyquery_test_500 raw_contact insert error = ' + error); + done(); + } + + async function rawContactPhoneticNameQuery() { + var resultColumns = ["id", "display_name", "phonetic_name"]; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.like("phonetic_name", "%xiaoming%"); + condition.and(); + condition.equalTo("is_deleted", "0"); + condition.or(); + condition.like("phonetic_name", "%xm%"); + condition.and(); + condition.equalTo("is_deleted", "0"); + try { + var resultSet = await DAHelper.query(profileRawContactUri, resultColumns, condition); + if (resultSet.goToFirstRow()) { + do { + console.info('logMessage contactCard_fuzzyquery_test_500: id = ' + resultSet.getString(0)); + expect(resultSet.getString(0) == rawContactId.toString()).assertTrue(); + console.info( + 'logMessage contactCard_fuzzyquery_test_500: displayName = ' + resultSet.getString(1)); + expect(resultSet.getString(1) == "500xiaoming500").assertTrue(); + console.info( + 'logMessage contactCard_fuzzyquery_test_500: phoneticName = ' + resultSet.getString(2)); + expect(resultSet.getString(2) == "500xiaoming500||xm").assertTrue(); + } while (resultSet.goToNextRow()); + } + resultSet.close(); + } catch (error) { + console.info('logMessage contactCard_fuzzyquery_test_500 query error = ' + error); + done(); + } + } + }); + + /** + * @tc.number contactCard_fuzzyquery_test_600 + * @tc.name Contact fuzzy search query interface (company, position) + * @tc.desc Function test + */ + it("contactCard_fuzzyquery_test_600", 0, async function (done) { + console.info("--------logMessage contactCard_fuzzyquery_test_600 is starting!-------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + var rawContactValues = { + "display_name": "xiaoming", "company": "TT600", "position": "Testers600" + }; + try { + var rawContactId = await DAHelper.insert(profileRawContactUri, rawContactValues); + sleep(1000); + console.info('logMessage contactCard_fuzzyquery_test_600 rawContactId = ' + rawContactId); + expect(rawContactId > 0).assertTrue(); + await rawContactCompanyQuery(DAHelper, rawContactId); + await deleteRawContact("contactCard_fuzzyquery_test_600"); + done(); + } catch (error) { + console.info('logMessage contactCard_fuzzyquery_test_600 raw_contact insert error = ' + error); + done(); + } + }); + + async function rawContactCompanyQuery(DAHelper, rawContactId) { + var resultColumns = ["id", "display_name", "company", "position"]; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.like("company", "%TT6%"); + condition.and(); + condition.equalTo("is_deleted", "0"); + condition.or(); + condition.like("position", "%Testers6%"); + condition.and(); + condition.equalTo("is_deleted", "0"); + try { + var resultSet = await DAHelper.query(profileRawContactUri, resultColumns, condition); + if (resultSet.goToFirstRow()) { + do { + console.info('logMessage contactCard_fuzzyquery_test_600: id = ' + resultSet.getString(0)); + expect(resultSet.getString(0) == rawContactId.toString()).assertEqual(true); + console.info( + 'logMessage contactCard_fuzzyquery_test_600: displayName = ' + resultSet.getString(1)); + expect(resultSet.getString(1) == "xiaoming").assertEqual(true); + console.info('logMessage contactCard_fuzzyquery_test_600: company = ' + resultSet.getString(2)); + expect(resultSet.getString(2) == "TT600").assertEqual(true); + console.info('logMessage contactCard_fuzzyquery_test_600: position = ' + resultSet.getString(3)); + expect(resultSet.getString(3) == "Testers600").assertEqual(true); + } while (resultSet.goToNextRow()); + } + resultSet.close(); + } catch (error) { + console.info('logMessage contactCard_fuzzyquery_test_600 query error = ' + error); + } + } + + /** + * @tc.number contactCard_fuzzyquery_test_700 + * @tc.name Contact fuzzy search query interface (mobile phone number) + * @tc.desc Function test + */ + it("contactCard_fuzzyquery_test_700", 0, async function (done) { + console.info("--------logMessage contactCard_fuzzyquery_test_700 is starting!-------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + var rawContactValues = { + "display_name": "xiaoming" + }; + try { + var rawContactId = await DAHelper.insert(profileRawContactUri, rawContactValues); + sleep(1000); + console.info('logMessage contactCard_fuzzyquery_test_700 rawContactId = ' + rawContactId); + expect(rawContactId > 0).assertTrue(); + await contactDataPhoneInsert(); + await deleteRawContact("contactCard_fuzzyquery_test_700"); + await deleteAll(profileContactDataUri, "contactCard_fuzzyquery_test_700"); + done(); + } catch (error) { + console.info('logMessage contactCard_fuzzyquery_test_700 raw_contact insert error = ' + error); + done(); + } + + async function contactDataPhoneInsert() { + var contactDataValues = { + "raw_contact_id": rawContactId, + "content_type": "phone", + "detail_info": "14528963" + }; + try { + var contactDataId = await DAHelper.insert(profileContactDataUri, contactDataValues); + sleep(1000); + console.info('logMessage contactCard_fuzzyquery_test_700 contactDataId = ' + contactDataId); + expect(contactDataId > 0).assertTrue(); + await fuzzyQueryPhone(DAHelper, rawContactId, contactDataId); + } catch (error) { + console.info('logMessage contactCard_fuzzyquery_test_700 contact_data insert error = ' + contactDataId); + done(); + } + } + }); + + async function fuzzyQueryPhone(DAHelper, rawContactId, contactDataId) { + var resultColumns = ["id", "raw_contact_id", "detail_info"]; + var condition = new ohosDataAbility.DataAbilityPredicates(); + // type_id = 5 data is phone + condition.like("detail_info", "%52896%"); + condition.and(); + condition.equalTo("type_id", "5"); + try { + var resultSet = await DAHelper.query(profileContactDataUri, resultColumns, condition); + sleep(1000); + if (resultSet.goToFirstRow()) { + do { + console.info('logMessage contactCard_fuzzyquery_test_700: id = ' + resultSet.getString(0)); + expect(resultSet.getString(0) == contactDataId.toString()).assertEqual(true); + console.info( + 'logMessage contactCard_fuzzyquery_test_700: raw_contact_id = ' + resultSet.getString(1)); + expect(resultSet.getString(1) == rawContactId.toString()).assertEqual(true); + console.info('logMessage contactCard_fuzzyquery_test_700: detail_info = ' + resultSet.getString(2)); + expect(resultSet.getString(2) == "14528963").assertEqual(true); + } while (resultSet.goToNextRow()); + } + resultSet.close(); + } catch (error) { + console.info('logMessage contactCard_fuzzyquery_test_700 query error = ' + error); + } + } + + /** + * @tc.number contactCard_fuzzyquery_test_800 + * @tc.name Contact fuzzy search query interface (nickname) + * @tc.desc Function test + */ + it("contactCard_fuzzyquery_test_800", 0, async function (done) { + console.info("--------logMessage contactCard_fuzzyquery_test_800 is starting!-------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + var rawContactValues = { + "display_name": "xiaoming" + }; + try { + var rawContactId = await DAHelper.insert(profileRawContactUri, rawContactValues); + sleep(1000); + console.info('logMessage contactCard_fuzzyquery_test_800 rawContactId = ' + rawContactId); + expect(rawContactId > 0).assertTrue(); + await contactNickNameInsert(); + await deleteRawContact("contactCard_fuzzyquery_test_800"); + await deleteAll(profileContactDataUri, "contactCard_fuzzyquery_test_800"); + done(); + } catch (error) { + console.info('logMessage contactCard_fuzzyquery_test_800 raw_contact insert error = ' + error); + done(); + } + + async function contactNickNameInsert() { + var contactDataValues = { + "raw_contact_id": rawContactId, + "content_type": "nickname", + "detail_info": "daming" + }; + try { + var contactDataId = await DAHelper.insert(profileContactDataUri, contactDataValues); + console.info('logMessage contactCard_fuzzyquery_test_800 contactDataId = ' + contactDataId); + expect(contactDataId > 0).assertTrue(); + await fuzzyQueryPhoneNickName(DAHelper, rawContactId, contactDataId); + } catch (error) { + console.info('logMessage contactCard_fuzzyquery_test_800 contact_data insert error = ' + contactDataId); + done(); + } + } + }); + + async function fuzzyQueryPhoneNickName(DAHelper, rawContactId, contactDataId) { + var resultColumns = ["id", "raw_contact_id", "detail_info"]; + var condition = new ohosDataAbility.DataAbilityPredicates(); + // type_id = 3 data is nickname + condition.like("detail_info", "%daming%"); + condition.and(); + condition.equalTo("type_id", "3"); + try { + var resultSet = await DAHelper.query(profileContactDataUri, resultColumns, condition); + sleep(1000); + if (resultSet.goToFirstRow()) { + do { + console.info('logMessage contactCard_fuzzyquery_test_800: id = ' + resultSet.getString(0)); + expect(resultSet.getString(0) == contactDataId.toString()).assertTrue(); + console.info( + 'logMessage contactCard_fuzzyquery_test_800: raw_contact_id = ' + resultSet.getString(1)); + expect(resultSet.getString(1) == rawContactId.toString()).assertTrue(); + console.info('logMessage contactCard_fuzzyquery_test_800: detail_info = ' + resultSet.getString(2)); + expect(resultSet.getString(2) == "daming").assertTrue(); + } while (resultSet.goToNextRow()); + } + resultSet.close(); + } catch (error) { + console.info('logMessage contactCard_fuzzyquery_test_800 query error = ' + error); + } + } + + /** + * @tc.number contactCard_fuzzyquery_test_900 + * @tc.name Contact fuzzy search query interface (mailbox) + * @tc.desc Function test + */ + it("contactCard_fuzzyquery_test_900", 0, async function (done) { + console.info("--------logMessage contactCard_fuzzyquery_test_900 is starting!-------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + var rawContactValues = { + "display_name": "xiaoming" + }; + try { + var rawContactId = await DAHelper.insert(profileRawContactUri, rawContactValues); + sleep(1000); + console.info('logMessage contactCard_fuzzyquery_test_900 rawContactId = ' + rawContactId); + expect(rawContactId > 0).assertTrue(); + await contactDataEmailInsert(); + await deleteRawContact("contactCard_fuzzyquery_test_900"); + await deleteAll(profileContactDataUri, "contactCard_fuzzyquery_test_900"); + done(); + } catch (error) { + console.info('logMessage contactCard_fuzzyquery_test_900 raw_contact insert error = ' + error); + done(); + } + + async function contactDataEmailInsert() { + var contactDataValues = { + "raw_contact_id": rawContactId, + "content_type": "email", + "detail_info": "1564@163.com" + }; + try { + var contactDataId = await DAHelper.insert(profileContactDataUri, contactDataValues); + console.info('logMessage contactCard_fuzzyquery_test_900 ; = ' + contactDataId); + expect(contactDataId > 0).assertTrue(); + await fuzzyQueryEmail(DAHelper, rawContactId, contactDataId); + } catch (error) { + console.info('logMessage contactCard_fuzzyquery_test_900 contact_data insert error = ' + error); + done(); + } + } + }); + + async function fuzzyQueryEmail(DAHelper, rawContactId, contactDataId) { + var resultColumns = ["id", "raw_contact_id", "detail_info"]; + var condition = new ohosDataAbility.DataAbilityPredicates(); + // type_id = 1 data is email + condition.like("detail_info", "%1564%"); + condition.and(); + condition.equalTo("type_id", "1"); + try { + var resultSet = await DAHelper.query(profileContactDataUri, resultColumns, condition); + sleep(1000); + if (resultSet.goToFirstRow()) { + do { + console.info('logMessage contactCard_fuzzyquery_test_900: id = ' + resultSet.getString(0)); + expect(resultSet.getString(0) == contactDataId.toString()).assertTrue(); + console.info( + 'logMessage contactCard_fuzzyquery_test_900: raw_contact_id = ' + resultSet.getString(1)); + expect(resultSet.getString(1) == rawContactId.toString()).assertTrue(); + console.info('logMessage contactCard_fuzzyquery_test_900: detail_info = ' + resultSet.getString(2)); + expect(resultSet.getString(2) == "1564@163.com").assertTrue(); + } while (resultSet.goToNextRow()); + } + resultSet.close(); + } catch (error) { + console.info('logMessage contactCard_fuzzyquery_test_900 query error = ' + error); + } + } + + /** + * @tc.number contactCard_fuzzyquery_test_1000 + * @tc.name Contact fuzzy search query interface (residential) + * @tc.desc Function test + */ + it("contactCard_fuzzyquery_test_1000", 0, async function (done) { + console.info("--------logMessage contactCard_fuzzyquery_test_1000 is starting!-------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + var rawContactValues = { + "display_name": "xiaoming" + }; + try { + var rawContactId = await DAHelper.insert(profileRawContactUri, rawContactValues); + sleep(1000); + console.info('logMessage contactCard_fuzzyquery_test_1000 rawContactId = ' + rawContactId); + expect(rawContactId > 0).assertTrue(); + await contactDataPostalInsert(); + await deleteRawContact("contactCard_fuzzyquery_test_1000"); + await deleteAll(profileContactDataUri, "contactCard_fuzzyquery_test_1000"); + done(); + } catch (error) { + console.info('logMessage contactCard_fuzzyquery_test_1000 raw_contact insert error = ' + error); + done(); + } + + async function contactDataPostalInsert() { + var contactDataValues = { + "raw_contact_id": rawContactId, + "content_type": "postal_address", + "detail_info": "nanjing1000" + }; + try { + var contactDataId = await DAHelper.insert(profileContactDataUri, contactDataValues); + sleep(1000); + console.info('logMessage contactCard_fuzzyquery_test_1000 contactDataId = ' + contactDataId); + expect(contactDataId > 0).assertTrue(); + await fuzzyQueryAddress(DAHelper, rawContactId, contactDataId); + } catch (error) { + console.info('logMessage contactCard_fuzzyquery_test_1000 contact_data insert error = ' + error); + done(); + } + } + }); + + async function fuzzyQueryAddress(DAHelper, rawContactId, contactDataId) { + var resultColumns = ["id", "raw_contact_id", "detail_info"]; + var condition = new ohosDataAbility.DataAbilityPredicates(); + // type_id = 1 data is postal_address + condition.like("detail_info", "%nanjing10%"); + condition.and(); + condition.equalTo("type_id", "7"); + try { + var resultSet = await DAHelper.query(profileContactDataUri, resultColumns, condition); + sleep(1000); + if (resultSet.goToFirstRow()) { + do { + console.info('logMessage contactCard_fuzzyquery_test_1000: id = ' + resultSet.getString(0)); + expect(resultSet.getString(0) == contactDataId.toString()).assertTrue(); + console.info( + 'logMessage contactCard_fuzzyquery_test_1000: raw_contact_id = ' + resultSet.getString(1)); + expect(resultSet.getString(1) == rawContactId.toString()).assertTrue(); + console.info( + 'logMessage contactCard_fuzzyquery_test_1000: detail_info = ' + resultSet.getString(2)); + expect(resultSet.getString(2) == "nanjing1000").assertTrue(); + } while (resultSet.goToNextRow()); + } + resultSet.close(); + } catch (error) { + console.info('logMessage contactCard_fuzzyquery_test_1000: query error' + error); + } + } + + /** + * @tc.number contactCard_fuzzyquery_test_1100 + * @tc.name Contact fuzzy search query interface (remarks) + * @tc.desc Function test + */ + it("contactCard_fuzzyquery_test_1100", 0, async function (done) { + console.info("--------logMessage contactCard_fuzzyquery_test_1100 is starting!-------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + var rawContactValues = { + "display_name": "xiaoming" + }; + try { + var rawContactId = await DAHelper.insert(profileRawContactUri, rawContactValues); + sleep(1000); + console.info('logMessage contactCard_fuzzyquery_test_1100 rawContactId = ' + rawContactId); + expect(rawContactId > 0).assertTrue(); + await contactDataNoteInsert(); + await deleteRawContact("contactCard_fuzzyquery_test_1100"); + await deleteAll(profileContactDataUri, "contactCard_fuzzyquery_test_1100"); + done(); + } catch (error) { + console.info('logMessage contactCard_fuzzyquery_test_1100 raw_contact insert error = ' + error); + done(); + } + + async function contactDataNoteInsert() { + var contactDataValues = { + "raw_contact_id": rawContactId, + "content_type": "note", + "detail_info": "java1100" + }; + try { + var contactDataId = await DAHelper.insert(profileContactDataUri, contactDataValues); + sleep(1000); + console.info('logMessage contactCard_fuzzyquery_test_1100 contactDataId = ' + contactDataId); + expect(contactDataId > 0).assertTrue(); + await fuzzyQueryNote(DAHelper, rawContactId, contactDataId); + } catch (error) { + console.info('logMessage contactCard_fuzzyquery_test_1100 contact_data insert error = ' + error); + done(); + } + } + }); + + async function fuzzyQueryNote(DAHelper, rawContactId, contactDataId) { + var resultColumns = ["id", "raw_contact_id", "detail_info"]; + var condition = new ohosDataAbility.DataAbilityPredicates(); + // type_id = 10 data is note + condition.like("detail_info", "%java11%"); + condition.and(); + condition.equalTo("type_id", "10"); + try { + var resultSet = await DAHelper.query(profileContactDataUri, resultColumns, condition); + if (resultSet.goToFirstRow()) { + do { + console.info('logMessage contactCard_fuzzyquery_test_1100: id = ' + resultSet.getString(0)); + expect(resultSet.getString(0) == contactDataId.toString()).assertEqual(true); + console.info( + 'logMessage contactCard_fuzzyquery_test_1100: raw_contact_id = ' + resultSet.getString(1)); + expect(resultSet.getString(1) == rawContactId.toString()).assertEqual(true); + console.info( + 'logMessage contactCard_fuzzyquery_test_1100: detail_info = ' + resultSet.getString(2)); + expect(resultSet.getString(2) == "java1100").assertEqual(true); + } while (resultSet.goToNextRow()); + } + resultSet.close(); + } catch (error) { + console.info('logMessage contactCard_fuzzyquery_test_1100: query error' + error); + } + } + + /** + * @tc.number contactCard_fuzzyquery_test_1200 + * @tc.name Contact fuzzy search query interface (AIM) + * @tc.desc Function test + */ + it("contactCard_fuzzyquery_test_1200", 0, async function (done) { + console.info("--------logMessage contactCard_fuzzyquery_test_1200 is starting!-------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + var rawContactValues = { + "display_name": "xiaoming" + }; + try { + var rawContactId = await DAHelper.insert(profileRawContactUri, rawContactValues); + console.info('logMessage contactCard_fuzzyquery_test_1200 rawContactId = ' + rawContactId); + expect(rawContactId > 0).assertTrue(); + await contactDataAimInsert(); + await deleteRawContact("contactCard_fuzzyquery_test_1200"); + await deleteAll(profileContactDataUri, "contactCard_fuzzyquery_test_1200"); + done(); + } catch (error) { + console.info('logMessage contactCard_fuzzyquery_test_1200 raw_contact insert error = ' + error); + done(); + } + + async function contactDataAimInsert() { + var contactDataValues = { + "raw_contact_id": rawContactId, + "content_type": "im", + "detail_info": "aaaa1200" + }; + try { + var contactDataId = await DAHelper.insert(profileContactDataUri, contactDataValues); + console.info('logMessage contactCard_fuzzyquery_test_1200 ; = ' + contactDataId); + expect(contactDataId > 0).assertTrue(); + await fuzzyQueryIM(DAHelper, rawContactId, contactDataId); + } catch (error) { + console.info('logMessage contactCard_fuzzyquery_test_1200 contact_data insert error = ' + error); + done(); + } + } + }); + + async function fuzzyQueryIM(DAHelper, rawContactId, contactDataId) { + var resultColumns = ["id", "raw_contact_id", "detail_info"]; + var condition = new ohosDataAbility.DataAbilityPredicates(); + // type_id = 10 data is im account number + condition.like("detail_info", "%aa12%"); + condition.and(); + condition.equalTo("type_id", "2"); + try { + var resultSet = await DAHelper.query(profileContactDataUri, resultColumns, condition); + if (resultSet.goToFirstRow()) { + do { + console.info('logMessage contactCard_fuzzyquery_test_1200: id = ' + resultSet.getString(0)); + expect(resultSet.getString(0) == contactDataId.toString()).assertEqual(true); + console.info( + 'logMessage contactCard_fuzzyquery_test_1200: raw_contact_id = ' + resultSet.getString(1)); + expect(resultSet.getString(1) == rawContactId.toString()).assertEqual(true); + console.info( + 'logMessage contactCard_fuzzyquery_test_1200: detail_info = ' + resultSet.getString(2)); + expect(resultSet.getString(2) == "aaaa1200").assertEqual(true); + } while (resultSet.goToNextRow()); + } + resultSet.close(); + } catch (error) { + console.info('logMessage contactCard_fuzzyquery_test_1200: query error' + error); + } + } + + /** + * @tc.number abnormal_contactCard_insert_test_200 + * @tc.name Abnormal use case, an incorrect field is passed in when inserting + * @tc.desc Function test + */ + it("abnormal_contactCard_insert_test_200", 0, async function (done) { + console.info("------------abnormal_contactCard_insert_test_200 is starting!-----------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + var rawContactValues = { + "display_names": "xiaoshan" + }; + try { + var rawContactId = await DAHelper.insert(profileRawContactUri, rawContactValues); + console.info("logMessage abnormal_contactCard_insert_test_200: rawContactId = " + rawContactId); + expect(rawContactId).assertEqual(-1); + done(); + } catch (error) { + console.info('logMessage abnormal_contactCard_insert_test_200: raw_contact insert error' + error); + done(); + } + }); + + /** + * @tc.number abnormal_contactCard_insert_test_300 + * @tc.name Abnormal use case, an incorrect table name is passed in when inserting + * @tc.desc Function test + */ + it("abnormal_contactCard_insert_test_300", 0, async function (done) { + console.info("------------abnormal_contactCard_insert_test_300 is starting!-----------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + var errorUri = "dataability:///com.ohos.calllogability/contacts/raw_contacts"; + + var rawContactValues = { + "display_name": "xiaoshan" + }; + try { + var rawContactId = await DAHelper.insert(errorUri, rawContactValues); + console.info("logMessage abnormal_contactCard_insert_test_300: rawContactId = " + rawContactId); + expect(rawContactId == -1).assertTrue(); + done(); + } catch (error) { + console.info('logMessage abnormal_contactCard_insert_test_300: raw_contact insert error' + error); + done(); + } + }); + + /** + * @tc.number abnormal_contactCard_update_test_1100 + * @tc.name Abnormal use case, an incorrect field is passed in when updating + * @tc.desc Function test + */ + it("abnormal_contactCard_update_test_1100", 0, async function (done) { + console.info("------------abnormal_contactCard_update_test_1100 is starting!-----------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + var rawContactValues = { + "display_name": "xiaoshan" + }; + try { + var rawContactId = await DAHelper.insert(profileRawContactUri, rawContactValues); + console.info("logMessage abnormal_contactCard_update_test_1100: rawContactId = " + rawContactId); + expect(rawContactId > 0).assertTrue(); + await abnormalUpdate(); + await deleteRawContact("abnormal_contactCard_update_test_1100"); + done(); + } catch (error) { + console.info('logMessage abnormal_contactCard_update_test_1100: raw_contact insert error' + error); + done(); + } + + async function abnormalUpdate() { + var updateValues = { + "display_names": "xiaosan" + }; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("ids", rawContactId.toString()); + try { + var updataCode = await DAHelper.update(profileRawContactUri, updateValues, condition) + console.info("logMessage abnormal_contactCard_update_test_1100: updataCode = " + updataCode); + expect(updataCode == -1).assertTrue(); + var map = new Map(); + map.set("id", rawContactId.toString()); + map.set("display_name", "xiaoshan"); + await contactsQuery(map, "abnormal_contactCard_update_test_1100", profileRawContactUri); + } catch (error) { + console.info('logMessage abnormal_contactCard_update_test_1100: update error' + error); + done(); + } + } + }); + + /** + * @tc.number abnormal_contactCard_update_test_1000 + * @tc.name Abnormal use case, an incorrect table name is passed in when updating + * @tc.desc Function test + */ + it("abnormal_contactCard_update_test_1000", 0, async function (done) { + console.info("------------abnormal_contactCard_update_test_1000 is starting!-----------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + var errorUri = "dataability:///com.ohos.calllogability/contacts/raw_contacts"; + + var rawContactValues = { + "display_name": "xiaoshan" + }; + try { + var rawContactId = await DAHelper.insert(profileRawContactUri, rawContactValues); + console.info("logMessage abnormal_contactCard_update_test_1000: rawContactId = " + rawContactId); + expect(rawContactId > 0).assertTrue(); + await abnormalUpdate(); + await deleteRawContact("abnormal_contactCard_update_test_1100"); + done(); + } catch (error) { + console.info('logMessage abnormal_contactCard_update_test_1000: raw_contact insert error' + error); + done(); + } + + async function abnormalUpdate() { + var updateValues = { + "display_name": "xiaosan" + }; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("id", rawContactId.toString()); + try { + var updataCode = await DAHelper.update(errorUri, updateValues, condition); + console.info("logMessage abnormal_contactCard_update_test_1000: updataCode = " + updataCode); + expect(updataCode == -1).assertTrue(); + var map = new Map(); + map.set("id", rawContactId.toString()); + map.set("display_name", "xiaoshan"); + await contactsQuery(map, "abnormal_contactCard_update_test_1000", profileRawContactUri); + } catch (error) { + console.info("logMessage abnormal_contactCard_update_test_1000: updata error = " + error); + done(); + } + } + }); + + /** + * @tc.number abnormal_contactCard_delete_test_4500 + * @tc.name Abnormal use case, an incorrect field is passed in when deleting + * @tc.desc Function test + */ + it("abnormal_contactCard_delete_test_4500", 0, async function (done) { + console.info("------------abnormal_contactCard_delete_test_4500 is starting!-----------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + var rawContactValues = { + "display_name": "xiaozhi" + }; + try { + var rawContactId = await DAHelper.insert(profileRawContactUri, rawContactValues); + console.info("logMessage abnormal_contactCard_delete_test_4500: rawContactId = " + rawContactId); + expect(rawContactId > 0).assertTrue(); + await abnormalDelete(); + await deleteRawContact("abnormal_contactCard_delete_test_4500"); + done(); + } catch (error) { + console.info('logMessage abnormal_contactCard_delete_test_4500: raw_contact insert error' + error); + done(); + } + + async function abnormalDelete() { + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("ids", rawContactId.toString()); + try { + var deleteCode = await DAHelper.delete(profileRawContactUri, condition); + console.info("logMessage abnormal_contactCard_delete_test_4500: deleteCode = " + deleteCode); + expect(deleteCode == -1).assertTrue(); + var map = new Map(); + map.set("id", rawContactId.toString()); + map.set("display_name", "xiaozhi"); + await contactsQuery(map, "abnormal_contactCard_delete_test_4500", profileRawContactUri); + done(); + } catch (error) { + console.info('logMessage abnormal_contactCard_delete_test_4500: delete error' + error); + done(); + } + } + }); + + /** + * @tc.number abnormal_contactCard_delete_test_4600 + * @tc.name Abnormal use case, an incorrect table name is passed in when deleting + * @tc.desc Function test + */ + it("abnormal_contactCard_delete_test_4600", 0, async function (done) { + console.info("------------abnormal_contactCard_delete_test_4600 is starting!-----------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + var errorUri = "dataability:///com.ohos.calllogability/contacts/raw_contacts"; + + var rawContactValues = { + "display_name": "xiaoshan" + }; + try { + var rawContactId = await DAHelper.insert(profileRawContactUri, rawContactValues); + console.info("logMessage abnormal_contactCard_delete_test_4600: rawContactId = " + rawContactId); + expect(rawContactId > 0).assertTrue(); + await abnormalDelete(); + await deleteRawContact("abnormal_contactCard_delete_test_4600"); + done(); + } catch (error) { + console.info('logMessage abnormal_contactCard_delete_test_4600: raw_contact insert error' + error); + done(); + } + + async function abnormalDelete() { + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("id", rawContactId.toString()); + try { + var deleteCode = await DAHelper.delete(errorUri, condition); + console.info("logMessage abnormal_contactCard_delete_test_4600: deleteCode = " + deleteCode); + expect(deleteCode == -1).assertTrue(); + var map = new Map(); + map.set("id", rawContactId.toString()); + map.set("display_name", "xiaoshan"); + await contactsQuery(map, "abnormal_contactCard_delete_test_4600", profileRawContactUri); + done(); + } catch (error) { + console.info('logMessage abnormal_contactCard_delete_test_4600: delete error' + error); + done(); + } + } + }); + + /** + * @tc.number abnormal_contactCard_query_test_4200 + * @tc.name Abnormal use case, an incorrect field is passed in when querying + * @tc.desc Function test + */ + it("abnormal_contactCard_query_test_4200", 0, async function (done) { + console.info("------------abnormal_contactCard_query_test_4200 is starting!-----------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + var rawContactValues = { + "display_name": "xiaozhicheng" + }; + try { + var rawContactId = await DAHelper.insert(profileRawContactUri, rawContactValues) + console.info("logMessage abnormal_contactCard_query_test_4200: rawContactId = " + rawContactId); + expect(rawContactId > 0).assertTrue(); + await abnormalQuery(); + await deleteRawContact("abnormal_contactCard_query_test_4200"); + done(); + } catch (error) { + console.info('logMessage abnormal_contactCard_query_test_4200: raw_contact insert error' + error); + done(); + } + + async function abnormalQuery() { + var resultColumns = ["id", "display_name"]; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("ids", rawContactId.toString()); + try { + var resultSet = await DAHelper.query(profileRawContactUri, resultColumns, condition); + expect(resultSet.goToFirstRow()).assertEqual(false); + console.info( + 'logMessage abnormal_contactCard_query_test_4200: goToFirstRow' + resultSet.goToFirstRow()); + resultSet.close(); + } catch (error) { + console.info('logMessage abnormal_contactCard_query_test_4200: query error = ' + error); + done(); + } + } + }); + + /** + * @tc.number abnormal_contactCard_batchinsert_test_5100 + * @tc.name Abnormal use cases, when adding data in batches, some of them failed, check the processing logic + * @tc.desc Function test + */ + it("abnormal_contactCard_batchinsert_test_5100", 0, async function (done) { + console.info("--------logMessage abnormal_contactCard_batchinsert_test_5100 is starting!------------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + var addBulkValue1 = { + "display_name": "zhangsan" + }; + var addBulkValue2 = { + "display_names": "lisi" + }; + var addBulkValue3 = { + "display_name": "wangwu" + }; + var addBulkValue4 = { + "display_names": "laoliu" + }; + var addBulkValue5 = { + "display_name": "xiaozhang" + }; + var listAddBluk = []; + listAddBluk[0] = addBulkValue1; + listAddBluk[1] = addBulkValue2; + listAddBluk[2] = addBulkValue3; + listAddBluk[3] = addBulkValue4; + listAddBluk[4] = addBulkValue5; + try { + var batchInsertCode = await DAHelper.batchInsert(profileRawContactUri, listAddBluk); + console.info("logMessage abnormal_contactCard_batchinsert_test_5100: batchInsertCode = " + batchInsertCode); + expect(batchInsertCode == -1).assertTrue(); + done(); + } catch (error) { + console.info("logMessage abnormal_contactCard_batchinsert_test_5100: batch insert error = " + error); + done(); + } + }); + + /** + * @tc.number abnormal_contactCard_insert_data_5300 + * @tc.name insert_data error no rawContactId + * @tc.desc Function test + */ + it("abnormal_contactCard_insert_data_5300", 0, async function (done) { + console.info("--------logMessage abnormal_contactCard_insert_data_5300 is starting!-------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + var rawContactValues = { + "display_name": "xiaotian" + }; + try { + var rawContactId = await DAHelper.insert(profileRawContactUri, rawContactValues); + sleep(1000); + console.info('logMessage abnormal_contactCard_insert_data_5300 rawContactId = ' + rawContactId); + expect(rawContactId > 0).assertTrue(); + await contactDataAimInsert(); + await deleteRawContact("abnormal_contactCard_insert_data_5300"); + done(); + } catch (error) { + console.info('logMessage abnormal_contactCard_insert_data_5300 raw_contact insert error = ' + error); + done(); + } + + async function contactDataAimInsert() { + var contactDataValues = { + "content_type": "im", "detail_info": "aaaa" + }; + try { + var contactDataId = await DAHelper.insert(profileContactDataUri, contactDataValues); + console.info('logMessage abnormal_contactCard_insert_data_5300 ; = ' + contactDataId); + expect(contactDataId == -1).assertTrue(); + } catch (error) { + console.info('logMessage abnormal_contactCard_insert_data_5300 contact_data insert error = ' + error); + done(); + } + } + }); + + /** + * @tc.number abnormal_contactCard_insert_data_5400 + * @tc.name insert_data error no content_type + * @tc.desc Function test + */ + it("abnormal_contactCard_insert_data_5400", 0, async function (done) { + console.info("--------logMessage abnormal_contactCard_insert_data_5400 is starting!-------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + var rawContactValues = { + "display_name": "xiaotian" + }; + try { + var rawContactId = await DAHelper.insert(profileRawContactUri, rawContactValues); + console.info('logMessage abnormal_contactCard_insert_data_5400 rawContactId = ' + rawContactId); + expect(rawContactId > 0).assertTrue(); + await contactDataAimInsert(); + await deleteRawContact("abnormal_contactCard_insert_data_5400"); + done(); + } catch (error) { + console.info('logMessage abnormal_contactCard_insert_data_5400 raw_contact insert error = ' + error); + done(); + } + + async function contactDataAimInsert() { + var contactDataValues = { + "raw_contact_id": rawContactId, "detail_info": "aaaa" + }; + try { + var contactDataId = await DAHelper.insert(profileContactDataUri, contactDataValues); + console.info('logMessage abnormal_contactCard_insert_data_5400 ; = ' + contactDataId); + expect(contactDataId == -1).assertTrue(); + } catch (error) { + console.info('logMessage abnormal_contactCard_insert_data_5400 contact_data insert error = ' + error); + done(); + } + } + }); + + /** + * @tc.number contactCard_delete_test_5500 + * @tc.name batchDelete + * @tc.desc Function test + */ + it("contactCard_delete_test_5500", 0, async function (done) { + console.info("--------logMessage contactCard_delete_test_5500 is starting!------------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + try { + var rawContactId = await DAHelper.insert(profileRawContactUri, common.getProfileRawContact()); + console.info("logMessage contactCard_delete_test_5500: rawContactId = " + rawContactId); + expect(rawContactId > 0).assertTrue(); + var map = common.getProfileRawContactMap(); + map.set("id", rawContactId.toString()); + await contactsQuery(map, "contactCard_delete_test_5500", profileRawContactUri); + await executeBatch(); + } catch (error) { + console.info("logMessage contactCard_delete_test_5500: insert error = " + error); + done(); + } + async function executeBatch() { + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("id", rawContactId.toString()); + DAHelper.executeBatch(URI_CONTACTS, [{ + uri: profileRawContactUri, + type: featureAbility.DataAbilityOperationType.TYPE_DELETE, + predicates: condition, + expectedCount: 0, + PredicatesBackReferences: {}, + interrupted: true, + }], + (error, data) => { + console.info( + "logMessage contactCard_delete_test_5500: executeBatch data = " + JSON.stringify(data)); + console.info("logMessage contactCard_delete_test_5500: data_3 = " + data); + console.info("logMessage contactCard_delete_test_5500: data_1= " + data[0].count); + expect(data[0].count == 0).assertTrue(); + done(); + }); + } + }); + + /** + * @tc.number contactCard_update_test_5600 + * @tc.name batchUpdate + * @tc.desc Function test + */ + it("contactCard_update_test_5600", 0, async function (done) { + console.info("--------logMessage contactCard_update_test_5600 is starting!------------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + try { + var rawContactId = await DAHelper.insert(profileRawContactUri, common.getProfileRawContact()); + console.info("logMessage contactCard_update_test_5600: rawContactId = " + rawContactId); + expect(rawContactId > 0).assertTrue(); + var map = common.getProfileRawContactMap(); + map.set("id", rawContactId.toString()); + await contactsQuery(map, "contactCard_update_test_5600", profileRawContactUri); + await executeBatch(); + } catch (error) { + console.info("logMessage contactCard_update_test_5600: insert error = " + error); + done(); + } + + async function executeBatch() { + var updateValues = { + "display_name": "xiaoxiaoxiao" + }; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("id", rawContactId.toString()); + DAHelper.executeBatch(URI_CONTACTS, [{ + uri: profileRawContactUri, + type: featureAbility.DataAbilityOperationType.TYPE_UPDATE, + valuesBucket: updateValues, + predicates: condition, + expectedCount: 0, + PredicatesBackReferences: {}, + interrupted: true, + }], + (error, data) => { + console.info( + "logMessage contactCard_update_test_5600: executeBatch data = " + JSON.stringify(data)); + console.info("logMessage contactCard_update_test_5600: data_3 = " + data); + console.info("logMessage contactCard_update_test_5600: data_1= " + data[0].count); + expect(data[0].count == 0).assertTrue(); + done(); + }); + } + }); + + /** + * @tc.number contactCard_insert_test_5700 + * @tc.name Insert Multiple raw_contact essential information + * @tc.desc Function test + */ + it("contactCard_insert_test_5700", 0, async function (done) { + console.info("------logMessage contactCard_insert_test_5700 is starting!-----"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + try { + var rawContactId = await DAHelper.insert(profileRawContactUri, common.getProfileRawContact()); + sleep(1000); + console.info('logMessage contactCard_insert_test_5700: rawContactId = ' + rawContactId); + expect(rawContactId > 0).assertTrue(); + var map = common.getProfileRawContactMap(); + map.set("id", rawContactId.toString()); + await contactsQuery(map, "contactCard_insert_test_5700", profileRawContactUri); + var rawContactIdOne = await DAHelper.insert(profileRawContactUri, common.getProfileRawContact()); + sleep(1000); + console.info('logMessage contactCard_insert_test_5700: rawContactIdOne = ' + rawContactIdOne); + expect(rawContactIdOne > 0).assertTrue(); + var map = common.getProfileRawContactMap(); + map.set("id", rawContactIdOne.toString()); + await contactsQuery(map, "contactCard_insert_test_5700", profileRawContactUri); + var rawContactIdTwo = await DAHelper.insert(profileRawContactUri, common.getProfileRawContact()); + sleep(1000); + console.info('logMessage contactCard_insert_test_5700: rawContactIdTwo = ' + rawContactIdTwo); + expect(rawContactIdTwo > 0).assertTrue(); + var map = common.getProfileRawContactMap(); + map.set("id", rawContactIdTwo.toString()); + await contactsQuery(map, "contactCard_insert_test_5700", profileRawContactUri); + await deleteRawContact("contactCard_insert_test_5700"); + done(); + } catch (error) { + console.info('logMessage contactCard_insert_test_5700: insert error = ' + error); + done(); + } + }); + + /** + * @tc.number contactCard_insert_test_5800 + * @tc.name Add 20000 bytes of basic contact information and verify whether the text insertion is successful + * @tc.desc Function test + */ + it("contactCard_insert_test_5800", 0, async function (done) { + console.info("------logMessage contactCard_insert_test_5800 is starting!-----"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + var name; + for (var i = 0; i < 20000; i++) { + name += "i"; + } + var contcatvalues = { + "display_name": name + } + try { + var rawContactId = await DAHelper.insert(profileRawContactUri, contcatvalues); + sleep(1000); + console.info('logMessage contactCard_insert_test_5800: rawContactId = ' + rawContactId); + expect(rawContactId > 0).assertTrue(); + var map = new Map(); + map.set("id", rawContactId.toString()); + map.set("display_name", name); + await contactsQuery(map, "contactCard_insert_test_5800", profileRawContactUri); + await deleteRawContact("contactCard_insert_test_5800"); + done(); + } catch (error) { + console.info('logMessage contactCard_insert_test_5800: insert error = ' + error); + done(); + } + }); + + /** + * @tc.number contactCard_insert_test_5900 + * @tc.name Add multiple contact details and verify that the insertion was successful + * @tc.desc Function test + */ + it("contactCard_insert_test_5900", 0, async function (done) { + console.info("------logMessage contactCard_insert_test_5900 is starting!-----"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + var contcatvalues = { + "display_name": "xiao5900" + } + try { + var rawContactId = await DAHelper.insert(profileRawContactUri, contcatvalues); + console.info('logMessage contactCard_insert_test_5900: rawContactId = ' + rawContactId); + expect(rawContactId > 0).assertTrue(); + var contactDataValues1 = { + "raw_contact_id": rawContactId, + "content_type": "phone", + "detail_info": "19960229" + }; + var contactDataId = await DAHelper.insert(profileContactDataUri, contactDataValues1); + console.info('logMessage contactCard_insert_test_5900: contactDataId = ' + contactDataId); + expect(contactDataId > 0).assertTrue(); + + var map = new Map(); + map.set("id", contactDataId.toString()); + map.set("detail_info", "19960229"); + await contactsQuery(map, "contactCard_insert_test_5900", profileContactDataUri); + + var rawContactIdOne = await DAHelper.insert(profileRawContactUri, contcatvalues); + console.info('logMessage contactCard_insert_test_5900: rawContactId = ' + rawContactIdOne); + expect(rawContactIdOne > 0).assertTrue(); + var contactDataValues2 = { + "raw_contact_id": rawContactIdOne, + "content_type": "phone", + "detail_info": "111111032" + }; + var contactDataId1 = await DAHelper.insert(profileContactDataUri, contactDataValues2); + console.info('logMessage contactCard_insert_test_5900: contactDataId = ' + contactDataId1); + expect(contactDataId1 > 0).assertTrue(); + + var map = new Map(); + map.set("id", contactDataId1.toString()); + map.set("detail_info", "111111032"); + await contactsQuery(map, "contactCard_insert_test_5900", profileContactDataUri); + + await deleteRawContact("contactCard_insert_test_5900"); + await deleteAll(profileContactDataUri, "contactCard_insert_test_5900"); + done(); + } catch (error) { + console.info('logMessage contactCard_insert_test_5900: insert error = ' + error); + done(); + } + }); + + /** + * @tc.number contactCard_insert_test_6000 + * @tc.name Add the basic information of a single contact and verify whether the insertion is successful (name, + * Pinyin, company, position, favorite) + * @tc.desc Function test + */ + it("contactCard_insert_test_6000", 0, async function (done) { + console.info("------logMessage contactCard_insert_test_6000 is starting!-----"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + var insertRawContactValues = { + "display_name": "licheng", + "company": "TT", + "position": "developer", + "favorite": 1, + "phonetic_name": "licheng||lc" + }; + try { + var rawContactId = await DAHelper.insert(profileRawContactUri, insertRawContactValues); + console.info("logMessage contactCard_insert_test_6000: rawContactId = " + rawContactId); + expect(rawContactId > 0).assertTrue(); + + var map = new Map(); + map.set("id", rawContactId.toString()); + map.set("display_name", "licheng"); + map.set("company", "TT"); + map.set("position", "developer"); + map.set("favorite", "1"); + map.set("phonetic_name", "licheng||lc"); + await contactsQuery(map, "contactCard_insert_test_6000", profileRawContactUri); + await deleteRawContact("contactCard_insert_test_6000"); + await deleteAll(profileContactDataUri, "contactCard_insert_test_6000"); + done(); + } catch (error) { + console.info("logMessage contactCard_insert_test_6000: raw_contact insert error = " + error); + done(); + } + }); + + /** + * @tc.number contactCard_insertData_test_6100 + * @tc.name To contact_data Add a full field data to the data table and verify whether the insertion is + * successful + * @tc.desc Function test + */ + it("contactCard_insertData_test_6100", 0, async function (done) { + console.info("------logMessage contactCard_insertData_test_6100 is starting!-----"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + var insertRawContactValues = { + "display_name": "xiaocai", + }; + try { + var rawContactId = await DAHelper.insert(profileRawContactUri, insertRawContactValues); + console.info("logMessage contactCard_insertData_test_6100: rawContactId = " + rawContactId); + expect(rawContactId > 0).assertTrue(); + var contactDataValues = common.getProfileContactData(); + contactDataValues["raw_contact_id"] = rawContactId; + console.info('logMessage contactCard_insertData_test_6100: contactDataValues["raw_contact_id"] = ' + + contactDataValues.raw_contact_id); + var contactDataId = await DAHelper.insert(profileContactDataUri, contactDataValues); + console.info('logMessage contactCard_insertData_test_6100: contactDataId = ' + contactDataId); + expect(contactDataId > 0).assertTrue(); + var map = common.getProfileContactDataMap(); + map.set("id", contactDataId.toString()); + map.set("raw_contact_id", rawContactId.toString()); + await contactsQuery(map, "contactCard_insertData_test_6100", profileContactDataUri); + await deleteRawContact("contactCard_insertData_test_6100"); + await deleteAll(profileContactDataUri, "contactCard_insertData_test_6100"); + done(); + } catch (error) { + console.info("logMessage contactCard_insertData_test_6100: raw_contact insert error = " + error); + done(); + } + }); + + /** + * @tc.number contactCard_update_test_6200 + * @tc.name Modify the basic information of multiple contacts and verify whether the modification is successful + * @tc.desc Function test + */ + it("contactCard_update_test_6200", 0, async function (done) { + console.info("--------logMessage contactCard_update_test_6200 is starting!------------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + try { + var insertRawContactValues = { + "display_name": "xiaocai", + }; + var rawContactId = await DAHelper.insert(profileRawContactUri, insertRawContactValues); + expect(rawContactId > 0).assertTrue(); + console.info("logMessage contactCard_update_test_6200: rawContactId = " + rawContactId); + var insertRawContactValuesOne = { + "display_name": "xiaocai1", + }; + var rawContactIdOne = await DAHelper.insert(profileRawContactUri, insertRawContactValuesOne); + expect(rawContactIdOne > 0).assertTrue(); + console.info("logMessage contactCard_update_test_6200: rawContactIdOne = " + rawContactIdOne); + var insertRawContactValuesTwo = { + "display_name": "xiaocai1", + }; + var rawContactIdTwo = await DAHelper.insert(profileRawContactUri, insertRawContactValuesTwo); + expect(rawContactIdTwo > 0).assertTrue(); + console.info("logMessage contactCard_update_test_6200: rawContactIdTwo = " + rawContactIdTwo); + + var updateValues = { + "display_name": "xiaosan" + }; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("id", rawContactId.toString()); + condition.or(); + condition.equalTo("id", rawContactIdOne.toString()); + condition.or(); + condition.equalTo("id", rawContactIdTwo.toString()); + var updataCode = await DAHelper.update(profileRawContactUri, updateValues, condition); + console.info("logMessage contactCard_update_test_6200: updataCode = " + updataCode); + expect(updataCode == 0).assertTrue(); + sleep(1000); + await queryUpdateThree( + "contactCard_update_test_6200", DAHelper, rawContactId, rawContactIdOne, rawContactIdTwo); + await deleteRawContact("contactCard_update_test_6200"); + done(); + } catch (error) { + console.info("logMessage contactCard_update_test_6200: insert error = " + error); + done(); + } + }); + + async function queryUpdateThree(tag, DAHelper, rawContactId, rawContactIdOne, rawContactIdTwo) { + + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info(tag + ': contactsQuery start ! DAHelper = ' + DAHelper); + var resultColumns = ["display_name"]; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("id", rawContactId.toString()); + condition.or(); + condition.equalTo("id", rawContactIdOne.toString()); + condition.or(); + condition.equalTo("id", rawContactIdTwo.toString()); + try { + var resultSet = await DAHelper.query(profileRawContactUri, resultColumns, condition); + if (resultSet.rowCount > 0) { + if (resultSet.goToFirstRow()) { + do { + var name = resultSet.getString(resultSet.getColumnIndex("display_name")); + expect(name == "xiaosan").assertEqual(true); + } while (resultSet.goToNextRow()); + } + } + resultSet.close(); + } catch (error) { + console.info(tag + "logMessage contactsQuery: error = " + error); + } + } + + /** + * @tc.number contactCard_UpdateRawContcat_test_6300 + * @tc.name Update raw_contact The full field data of the contact table and verify whether the modification is + * successful + * @tc.desc Function test + */ + it("contactCard_UpdateRawContcat_test_6300", 0, async function (done) { + console.info("------logMessage contactCard_UpdateRawContcat_test_6300 is starting!-----"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + try { + var rawContactId = await DAHelper.insert(profileRawContactUri, common.getProfileRawContact()); + console.info("logMessage contactCard_UpdateRawContcat_test_6300: rawContactId = " + rawContactId); + expect(rawContactId > 0).assertTrue(); + sleep(2000); + var updateValues = common.getProfileRawContactUpdate(); + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("id", rawContactId.toString()); + var updataCode = await DAHelper.update(profileRawContactUri, updateValues, condition); + console.info('logMessage contactCard_UpdateRawContcat_test_6300: updataCode = ' + updataCode); + sleep(3000); + var map = common.getProfileRawContactUpdateMap(); + map.set("id", rawContactId.toString()); + await contactsQuery(map, "contactCard_UpdateRawContcat_test_6300", profileRawContactUri); + await deleteRawContact("contactCard_UpdateRawContcat_test_6300"); + await deleteAll(profileContactDataUri, "contactCard_UpdateRawContcat_test_6300"); + done(); + } catch (error) { + console.info("logMessage contactCard_UpdateRawContcat_test_6300: raw_contact insert error = " + error); + done(); + } + }); + + /** + * @tc.number contactCard_insertDataUpdate_test_6400 + * @tc.name Update contact_data table, and verify whether the modification is successful + * @tc.desc Function test + */ + it("contactCard_insertDataUpdate_test_6400", 0, async function (done) { + console.info("------logMessage contactCard_insertDataUpdate_test_6400 is starting!-----"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + var insertRawContactValues = { + "display_name": "xiaocai", + }; + try { + var rawContactId = await DAHelper.insert(profileRawContactUri, insertRawContactValues); + console.info("logMessage contactCard_insertDataUpdate_test_6400: rawContactId = " + rawContactId); + expect(rawContactId > 0).assertTrue(); + + var contactDataValues = common.getProfileContactData(); + contactDataValues["raw_contact_id"] = rawContactId; + console.info('logMessage contactCard_insertDataUpdate_test_6400: contactDataValues.raw_contact_id = ' + + contactDataValues.raw_contact_id); + var contactDataId = await DAHelper.insert(profileContactDataUri, contactDataValues); + console.info('logMessage contactCard_insertDataUpdate_test_6400: contactDataId = ' + contactDataId); + expect(contactDataId > 0).assertTrue(); + + var updateValues = common.getProfileContactDataUpdate(); + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("id", contactDataId.toString()); + var updataCode = await DAHelper.update(profileContactDataUri, updateValues, condition); + console.info('logMessage contactCard_insertDataUpdate_test_6400: updataCode = ' + updataCode); + sleep(1000); + var map = common.getProfileContactDataUpdateMap(); + map.set("id", contactDataId.toString()); + map.set("raw_contact_id", rawContactId.toString()); + await contactsQuery(map, "contactCard_insertDataUpdate_test_6400", profileContactDataUri); + await deleteRawContact("contactCard_insertDataUpdate_test_6400"); + await deleteAll(profileContactDataUri, "contactCard_insertDataUpdate_test_6400"); + done(); + } catch (error) { + console.info("logMessage contactCard_insertDataUpdate_test_6400: raw_contact insert error = " + error); + done(); + } + }); + + /** + * @tc.number contactCard_insertDataUpdateAll_test_6500 + * @tc.name Update all contact details and verify that the modification was successful + * @tc.desc Function test + */ + it("contactCard_insertDataUpdateAll_test_6500", 0, async function (done) { + console.info("------logMessage contactCard_insertDataUpdateAll_test_6500 is starting!-----"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + var insertRawContactValues = { + "display_name": "xiaocai", + }; + try { + var rawContactId = await DAHelper.insert(profileRawContactUri, insertRawContactValues); + console.info("logMessage contactCard_insertDataUpdateAll_test_6500: rawContactId = " + rawContactId); + expect(rawContactId > 0).assertTrue(); + await insertData(rawContactId, "name", "xiaocai", ""); + await insertData(rawContactId, "phone", "6500", ""); + await insertData(rawContactId, "organization", "TTTTT", "Deve"); + await insertData(rawContactId, "nickname", "xxxxcai", ""); + await insertData(rawContactId, "email", "111@fox.com", ""); + await insertData(rawContactId, "postal_address", "dddd", ""); + await insertData(rawContactId, "note", "caicai", ""); + await insertData(rawContactId, "im", "999999999", ""); + await insertData(rawContactId, "contact_event", "1125", ""); + await insertData(rawContactId, "website", "wwww.xxx.com", ""); + await insertData(rawContactId, "relation", "xiaobai", ""); + await insertData(rawContactId, "group_membership", 1, ""); + await insertData(rawContactId, "contact_misc", "5678", ""); + var updateValues = { + "detail_info": "xiaocai" + }; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("raw_contact_id", rawContactId.toString()); + var updataCode = await DAHelper.update(profileContactDataUri, updateValues, condition); + console.info('logMessage contactCard_insertDataUpdateAll_test_6500: updataCode = ' + updataCode); + sleep(1000); + await queryUpdateAllData("contactCard_insertDataUpdateAll_test_6500", DAHelper, rawContactId); + await deleteRawContact("contactCard_insertDataUpdateAll_test_6500"); + await deleteAll(profileContactDataUri, "contactCard_insertDataUpdateAll_test_6500"); + done(); + } catch (error) { + console.info("logMessage contactCard_insertDataUpdateAll_test_6500: raw_contact insert error = " + error); + done(); + } + }); + + async function queryUpdateAllData(tag, DAHelper, rawContactId) { + + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info(tag + ': contactsQuery start ! DAHelper = ' + DAHelper); + var resultColumns = ["detail_info"]; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("row_contact_id", rawContactId.toString()); + try { + var resultSet = await DAHelper.query(profileContactDataUri, resultColumns, condition); + if (resultSet.rowCount > 0) { + if (resultSet.goToFirstRow()) { + do { + var detail_info = resultSet.getString(resultSet.getColumnIndex("detail_info")); + expect(detail_info == "xiaocai").assertEqual(true); + } while (resultSet.goToNextRow()); + } + } + resultSet.close(); + } catch (error) { + console.info(tag + "logMessage contactsQuery: error = " + error); + } + } + + /** + * @tc.number contactCard_insertFavorite_test_6600 + * @tc.name Add multiple contacts to favorites and verify that the favorites field is changed + * @tc.desc Function test + */ + it("contactCard_insertFavorite_test_6600", 0, async function (done) { + console.info("------logMessage contactCard_insertFavorite_test_6600 is starting!-----"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + try { + var insertRawContactValues = { + "display_name": "xiaocai", "favorite": 1 + }; + var rawContactId = await DAHelper.insert(profileRawContactUri, insertRawContactValues); + console.info("logMessage contactCard_insertFavorite_test_6600: rawContactId = " + rawContactId); + + var insertRawContactValuesOne = { + "display_name": "xiaotian", "favorite": 1 + }; + var rawContactIdOne = await DAHelper.insert(profileRawContactUri, insertRawContactValuesOne); + console.info("logMessage contactCard_insertFavorite_test_6600: rawContactId = " + rawContactIdOne); + + var insertRawContactValuesTwo = { + "display_name": "xiaoli", "favorite": 1 + }; + var rawContactIdTwo = await DAHelper.insert(profileRawContactUri, insertRawContactValuesTwo); + console.info("logMessage contactCard_insertFavorite_test_6600: rawContactId = " + rawContactIdTwo); + + sleep(1000); + await queryThreeFavorite( + "contactCard_insertFavorite_test_6600", DAHelper, rawContactId, rawContactIdOne, rawContactIdTwo, 1); + await deleteRawContact("contactCard_insertFavorite_test_6600"); + done(); + } catch (error) { + console.info("logMessage contactCard_insertFavorite_test_6600: raw_contact insert error = " + error); + done(); + } + }); + + async function queryThreeFavorite(tag, DAHelper, rawContactId, rawContactIdOne, rawContactIdTwo, favoritevalue) { + + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info(tag + ': queryThreeFavorite start ! DAHelper = ' + DAHelper); + var resultColumns = ["favorite"]; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("id", rawContactId.toString()); + condition.or(); + condition.equalTo("id", rawContactIdOne.toString()); + condition.or(); + condition.equalTo("id", rawContactIdTwo.toString()); + try { + var resultSet = await DAHelper.query(profileRawContactUri, resultColumns, condition); + if (resultSet.rowCount > 0) { + if (resultSet.goToFirstRow()) { + do { + var favorite = resultSet.getInt(resultSet.getColumnIndex("favorite")); + expect(favorite == favoritevalue).assertEqual(true); + } while (resultSet.goToNextRow()); + } + } + resultSet.close(); + } catch (error) { + console.info(tag + "logMessage queryThreeFavorite: error = " + error); + } + } + + /** + * @tc.number contactCard_unFavorite_test_6700 + * @tc.name Remove favorites from multiple contacts and verify that the favorites field has changed + * @tc.desc Function test + */ + it("contactCard_unFavorite_test_6700", 0, async function (done) { + console.info("------logMessage contactCard_unFavorite_test_6700 is starting!-----"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + try { + var insertRawContactValues = { + "display_name": "xiaocai", "favorite": 1 + }; + var rawContactId = await DAHelper.insert(profileRawContactUri, insertRawContactValues); + console.info("logMessage contactCard_unFavorite_test_6700: rawContactId = " + rawContactId); + + var insertRawContactValuesOne = { + "display_name": "xiaotian", "favorite": 1 + }; + var rawContactIdOne = await DAHelper.insert(profileRawContactUri, insertRawContactValuesOne); + console.info("logMessage contactCard_unFavorite_test_6700: rawContactId = " + rawContactIdOne); + + var insertRawContactValuesTwo = { + "display_name": "xiaoli", "favorite": 1 + }; + var rawContactIdTwo = await DAHelper.insert(profileRawContactUri, insertRawContactValuesTwo); + console.info("logMessage contactCard_unFavorite_test_6700: rawContactId = " + rawContactIdTwo); + + var updateValues = { + "favorite": 0 + }; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("id", rawContactId.toString()); + condition.or(); + condition.equalTo("id", rawContactIdOne.toString()); + condition.or(); + condition.equalTo("id", rawContactIdTwo.toString()); + var updataCode = await DAHelper.update(profileRawContactUri, updateValues, condition); + console.info("logMessage contactCard_unFavorite_test_6700: updataCode = " + updataCode); + sleep(1000); + await queryThreeFavorite( + "contactCard_unFavorite_test_6700", DAHelper, rawContactId, rawContactIdOne, rawContactIdTwo, 0); + await deleteRawContact("contactCard_unFavorite_test_6700"); + done(); + } catch (error) { + console.info("logMessage contactCard_unFavorite_test_6700: raw_contact insert error = " + error); + done(); + } + }); + + /** + * @tc.number contactCard_insertContactBlocklist_test_6800 + * @tc.name Add multiple records to the black list and verify whether the insertion is successful + * @tc.desc Function test + */ + it("contactCard_insertContactBlocklist_test_6800", 0, async function (done) { + console.info("--------logMessage contactCard_insertContactBlocklist_test_6800 is starting!-------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + try { + var batchInsertCode = await DAHelper.insert(profileBlocklistUri, common.getProfileBlockList()); + console.info("logMessage contactCard_insertContactBlocklist_test_6800: insert = " + batchInsertCode); + var batchInsertCodeOne = await DAHelper.insert(profileBlocklistUri, common.getProfileBlockList()); + console.info("logMessage contactCard_insertContactBlocklist_test_6800: insert = " + batchInsertCodeOne); + var batchInsertCodeTwo = await DAHelper.insert(profileBlocklistUri, common.getProfileBlockList()); + console.info("logMessage contactCard_insertContactBlocklist_test_6800: insert = " + batchInsertCodeTwo); + sleep(1000); + expect(batchInsertCode > 0).assertTrue(); + await query(3); + await deleteAll(profileBlocklistUri, "contactCard_insertContactBlocklist_test_6800"); + done(); + } catch (error) { + console.info("logMessage contactCard_insertContactBlocklist_test_6800: batchInsert error = " + error); + done(); + } + + async function query(size) { + var resultColumns = []; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("phone_number", "123456789"); + try { + var resultSet = await DAHelper.query(profileBlocklistUri, resultColumns, condition); + sleep(1000); + console.info('contactCard_insertContactBlocklist_test_6800 :resultSet.goToFirstRow() = ' + + resultSet.goToFirstRow()); + console.info( + 'contactCard_insertContactBlocklist_test_6800 : query result is = ' + resultSet.rowCount == size); + expect(resultSet.rowCount == size).assertEqual(true); + resultSet.close(); + } catch (error) { + console.info(" contactCard_insertContactBlocklist_test_6800 error = " + error); + } + } + }); + + /** + * @tc.number contactCard_removeContactBlocklist_test_6900 + * @tc.name Delete multiple records from the black list and verify whether the deletion is successful + * @tc.desc Function test + */ + it("contactCard_removeContactBlocklist_test_6900", 0, async function (done) { + console.info("--------logMessage contactCard_removeContactBlocklist_test_6900 is starting!-------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + try { + var batchInsertCode = await DAHelper.insert(profileBlocklistUri, common.getProfileBlockList()); + console.info( + "logMessage contactCard_removeContactBlocklist_test_6900: batchInsertCode = " + batchInsertCode); + var batchInsertCodeOne = await DAHelper.insert(profileBlocklistUri, common.getProfileBlockList()); + console.info("logMessage contactCard_removeContactBlocklist_test_6900: insert = " + batchInsertCodeOne); + var batchInsertCodeTwo = await DAHelper.insert(profileBlocklistUri, common.getProfileBlockList()); + console.info("logMessage contactCard_removeContactBlocklist_test_6900: insert = " + batchInsertCodeTwo); + sleep(1000); + expect(batchInsertCode > 0).assertTrue(); + await deleteAll(profileBlocklistUri, "contactCard_removeContactBlocklist_test_6900"); + await query(0); + done(); + } catch (error) { + console.info("logMessage contactCard_removeContactBlocklist_test_6900: batchInsert error = " + error); + done(); + } + async function query(size) { + var resultColumns = []; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("phone_number", "123456789"); + try { + var resultSet = await DAHelper.query(profileBlocklistUri, resultColumns, condition); + console.info('contactCard_removeContactBlocklist_test_6900 : resultSet = ' + resultSet); + expect(resultSet.rowCount == size).assertEqual(true); + resultSet.close(); + } catch (error) { + console.info(" contactCard_removeContactBlocklist_test_6900 error = " + error); + } + } + }); + + /** + * @tc.number contactCard_insertGroup_test_7000 + * @tc.name Add multiple contacts to favorites and verify that the favorites field is changed + * @tc.desc Function test + */ + it("contactCard_insertGroup_test_7000", 0, async function (done) { + console.info("------logMessage contactCard_insertGroup_test_7000 is starting!-----"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + try { + var insertRawContactValues = { + "display_name": "xiaocai", + }; + var rawContactId = await DAHelper.insert(profileRawContactUri, insertRawContactValues); + console.info("logMessage contactCard_insertGroup_test_7000: rawContactId = " + rawContactId); + await insertData(rawContactId, "group_membership", 1, ""); + + var insertRawContactValuesOne = { + "display_name": "xiaotian", + }; + var rawContactIdOne = await DAHelper.insert(profileRawContactUri, insertRawContactValuesOne); + console.info("logMessage contactCard_insertGroup_test_7000: rawContactId = " + rawContactIdOne); + await insertData(rawContactIdOne, "group_membership", 1, ""); + var insertRawContactValuesTwo = { + "display_name": "xiaoli", + }; + var rawContactIdTwo = await DAHelper.insert(profileRawContactUri, insertRawContactValuesTwo); + console.info("logMessage contactCard_insertGroup_test_7000: rawContactId = " + rawContactIdTwo); + await insertData(rawContactIdTwo, "group_membership", 1, ""); + sleep(1000); + await queryThreeGroup( + "contactCard_insertGroup_test_7000", DAHelper, rawContactId, rawContactIdOne, rawContactIdTwo, 1); + await deleteRawContact("contactCard_insertGroup_test_7000"); + done(); + } catch (error) { + console.info("logMessage contactCard_insertGroup_test_7000: raw_contact insert error = " + error); + done(); + } + }); + + async function queryThreeGroup(tag, DAHelper, rawContactId, rawContactIdOne, rawContactIdTwo, groupId) { + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info(tag + ': queryThreeGroup start ! DAHelper = ' + DAHelper); + var resultColumns = ["detail_info"]; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("id", rawContactId.toString()); + condition.or(); + condition.equalTo("id", rawContactIdOne.toString()); + condition.or(); + condition.equalTo("id", rawContactIdTwo.toString()); + try { + var resultSet = await DAHelper.query(profileRawContactUri, resultColumns, condition); + if (resultSet.rowCount > 0) { + if (resultSet.goToFirstRow()) { + do { + var group = resultSet.getInt(resultSet.getColumnIndex("detail_info")); + expect(group == groupId).assertEqual(true); + } while (resultSet.goToNextRow()); + } + } + resultSet.close(); + } catch (error) { + console.info(tag + "logMessage queryThreeGroup: error = " + error); + } + } + + /** + * @tc.number contactCard_insert_test_7100 + * @tc.name Add a full field data to the groups table and verify whether the insertion is successful + * @tc.desc Function test + */ + it("contactCard_insert_test_7100", 0, async function (done) { + console.info("---------logMessage contactCard_insert_test_7100 is starting!----------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + try { + var groupId = await DAHelper.insert(profileGroupUri, common.getProfileGroup()); + console.info("logMessage contactCard_insert_test_7100: groupId = " + groupId); + expect(groupId > 0).assertTrue(); + var map = common.getProfileGroupMap(); + map.set("id", groupId.toString()); + await contactsQuery(map, "contactCard_insert_test_7100", profileGroupUri); + await deleteAll(profileGroupUri, "contactCard_insert_test_7100"); + done(); + } catch (error) { + console.info("logMessage contactCard_insert_test_7100: group insert error = " + error); + done(); + } + }); + + /** + * @tc.number contactCard_delete_test_7200 + * @tc.name Add a full field data to the groups table and verify whether the insertion is successful + * @tc.desc Function test + */ + it("contactCard_delete_test_7200", 0, async function (done) { + console.info("------logMessage contactCard_delete_test_7200 is starting!-----"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + try { + var insertRawContactValues = { + "display_name": "xiaocai", + }; + var rawContactId = await DAHelper.insert(profileRawContactUri, insertRawContactValues); + console.info("logMessage contactCard_delete_test_7200: rawContactId = " + rawContactId); + await insertData(rawContactId, "group_membership", 1, ""); + + var insertRawContactValuesOne = { + "display_name": "xiaotian", + }; + var rawContactIdOne = await DAHelper.insert(profileRawContactUri, insertRawContactValuesOne); + console.info("logMessage contactCard_delete_test_7200: rawContactId = " + rawContactIdOne); + await insertData(rawContactIdOne, "group_membership", 1, ""); + var insertRawContactValuesTwo = { + "display_name": "xiaoli", + }; + var rawContactIdTwo = await DAHelper.insert(profileRawContactUri, insertRawContactValuesTwo); + console.info("logMessage contactCard_delete_test_7200: rawContactId = " + rawContactIdTwo); + await insertData(rawContactIdTwo, "group_membership", 1, ""); + sleep(1000); + await deleteAll(profileContactDataUri, "contactCard_delete_test_7200"); + sleep(1000); + await queryZeroGroup( + "contactCard_delete_test_7200", DAHelper, rawContactId, rawContactIdOne, rawContactIdTwo); + await deleteRawContact("contactCard_delete_test_7200"); + done(); + } catch (error) { + console.info("logMessage contactCard_delete_test_7200: raw_contact insert error = " + error); + done(); + } + }); + + async function queryZeroGroup(tag, DAHelper, rawContactId, rawContactIdOne, rawContactIdTwo) { + + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info(tag + ': queryZeroGroup start ! DAHelper = ' + DAHelper); + var resultColumns = ["detail_info"]; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("raw_contact_id", rawContactId.toString()); + condition.or(); + condition.equalTo("raw_contact_id", rawContactIdOne.toString()); + condition.or(); + condition.equalTo("raw_contact_id", rawContactIdTwo.toString()); + try { + var resultSet = await DAHelper.query(profileContactDataUri, resultColumns, condition); + console.info(tag + ': queryZeroGroup! resultSet.rowCount = ' + resultSet.rowCount); + expect(resultSet.rowCount == 0).assertEqual(true); + resultSet.close(); + } catch (error) { + console.info(tag + "logMessage queryZeroGroup: error = " + error); + } + } + + /** + * @tc.number contactCard_delete_test_7300 + * @tc.name Delete the full field data of a groups table and verify whether the deletion is successful + * @tc.desc Function test + */ + it("contactCard_delete_test_7300", 0, async function (done) { + console.info("---------logMessage contactCard_delete_test_7300 is starting!----------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + try { + var groupId = await DAHelper.insert(profileGroupUri, common.getProfileGroup()); + console.info("logMessage contactCard_delete_test_7300: groupId = " + groupId); + expect(groupId > 0).assertTrue(); + var map = common.getProfileGroupMap(); + map.set("id", groupId.toString()); + await contactsQuery(map, "contactCard_delete_test_7300", profileGroupUri); + await deleteAll(profileGroupUri, "contactCard_delete_test_7300"); + done(); + } catch (error) { + console.info("logMessage contactCard_delete_test_7300: group insert error = " + error); + done(); + } + }); + + /** + * @tc.number contactCard_delete_test_7400 + * @tc.name Add a raw_contact all fields, delete raw_contact + * @tc.desc Function test + */ + it("contactCard_delete_test_7400", 0, async function (done) { + console.info("------logMessage contactCard_delete_test_7400 is starting!-----"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + try { + var rawContactId = await DAHelper.insert(profileRawContactUri, common.getProfileRawContact()); + sleep(1000); + console.info('logMessage contactCard_delete_test_7400: rawContactId = ' + rawContactId); + expect(rawContactId > 0).assertTrue(); + var map = common.getProfileRawContactMap(); + map.set("id", rawContactId.toString()); + map.set("version", "2"); + map.set("is_deleted", "1"); + await deleteAll(profileRawContactUri, "contact_Delete_test_7400"); + sleep(1000); + await contactsQuery(map, "contactCard_delete_test_7400", profileRawContactUri); + var conditionAll = new ohosDataAbility.DataAbilityPredicates(); + conditionAll.greaterThan("id", "0"); + var code = await DAHelper.delete(profileDeletedContactsUri, conditionAll); + console.info('contactCard_delete_test_7400 : Completely delete code = ' + code); + expect(code == 0).assertTrue(); + done(); + } catch (error) { + console.info('logMessage contactCard_delete_test_7400: insert error = ' + error); + done(); + } + }); + + /** + * @tc.number contactCard_delete_test_7500 + * @tc.name Delete contact_data Single full field data in data table + * @tc.desc Function test + */ + it("contactCard_delete_test_7500", 0, async function (done) { + console.info("------logMessage contactCard_delete_test_7500 is starting!-----"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + var insertRawContactValues = { + "display_name": "xiaocai", + }; + try { + var rawContactId = await DAHelper.insert(profileRawContactUri, insertRawContactValues); + console.info("logMessage contactCard_delete_test_7500: rawContactId = " + rawContactId); + expect(rawContactId > 0).assertTrue(); + var contactDataValues = common.getProfileContactData(); + contactDataValues["raw_contact_id"] = rawContactId; + var contactDataId = await DAHelper.insert(profileContactDataUri, contactDataValues); + console.info('logMessage contactCard_delete_test_7500: contactDataId = ' + contactDataId); + expect(contactDataId > 0).assertTrue(); + await deleteAll(profileContactDataUri, "contactCard_delete_test_7500"); + var map = new Map(); + map.set("id", contactDataId.toString()); + await queryIdForDelete(map, "contactCard_delete_test_7500", profileContactDataUri); + await deleteRawContact("contactCard_delete_test_7500"); + done(); + } catch (error) { + console.info("logMessage contactCard_delete_test_7500: raw_contact insert error = " + error); + done(); + } + }); + + /** + * @tc.number contactCard_insertDataAll_test_7600 + * @tc.name Add all details of a single contact and verify whether the insertion is successful (name, mobile + * number, company, position, nickname, email, home, remarks, aim) + * @tc.desc Function test + */ + it("contactCard_insertDataAll_test_7600", 0, async function (done) { + console.info("------logMessage contactCard_insertDataAll_test_7600 is starting!-----"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + var insertRawContactValues = { + "display_name": "xiaocai", + }; + try { + var rawContactId = await DAHelper.insert(profileRawContactUri, insertRawContactValues); + console.info("logMessage contactCard_insertDataAll_test_7600: rawContactId = " + rawContactId); + expect(rawContactId > 0).assertTrue(); + var contactdata1 = await insertData(rawContactId, "name", "xiaocai", ""); + await queryAlldata("contactCard_insertDataAll_test_7600", DAHelper, rawContactId, contactdata1, "xiaocai"); + var contactdata2 = await insertData(rawContactId, "phone", "6500", ""); + await queryAlldata("contactCard_insertDataAll_test_7600", DAHelper, rawContactId, contactdata2, "6500"); + var contactdatd3 = await insertData(rawContactId, "organization", "TTTTT", "Deve"); + await queryAlldata("contactCard_insertDataAll_test_7600", DAHelper, rawContactId, contactdatd3, "TTTTT"); + var contactdatd4 = await insertData(rawContactId, "nickname", "xxxxcai", ""); + await queryAlldata("contactCard_insertDataAll_test_7600", DAHelper, rawContactId, contactdatd4, "xxxxcai"); + var contactdatd5 = await insertData(rawContactId, "email", "111@fox.com", ""); + await queryAlldata( + "contactCard_insertDataAll_test_7600", DAHelper, rawContactId, contactdatd5, "111@fox.com"); + var contactdatd6 = await insertData(rawContactId, "postal_address", "dddd", ""); + await queryAlldata("contactCard_insertDataAll_test_7600", DAHelper, rawContactId, contactdatd6, "dddd"); + var contactdatd7 = await insertData(rawContactId, "note", "caicai", ""); + await queryAlldata("contactCard_insertDataAll_test_7600", DAHelper, rawContactId, contactdatd7, "caicai"); + var contactdatd8 = await insertData(rawContactId, "im", "999999999", ""); + await queryAlldata( + "contactCard_insertDataAll_test_7600", DAHelper, rawContactId, contactdatd8, "999999999"); + sleep(1000); + await deleteRawContact("contactCard_insertDataAll_test_7600"); + await deleteAll(profileContactDataUri, "contactCard_insertDataAll_test_7600"); + done(); + } catch (error) { + console.info("logMessage contactCard_insertDataAll_test_7600: raw_contact insert error = " + error); + done(); + } + }); + + async function queryAlldata(tag, DAHelper, rawContactId, contactdata, values) { + var resultColumns = ["raw_contact_id", "detail_info"]; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("id", contactdata.toString()); + try { + var resultSet = await DAHelper.query(profileContactDataUri, resultColumns, condition); + if (resultSet.rowCount > 0) { + if (resultSet.goToFirstRow()) { + do { + var id = resultSet.getString(resultSet.getColumnIndex("raw_contact_id")); + console.info(tag + " result raw_contact_id = " + id); + expect(id == rawContactId).assertEqual(true); + var info = resultSet.getString(resultSet.getColumnIndex("detail_info")); + console.info(tag + "result info = " + info + " value = " + values); + expect(info == values).assertEqual(true); + } while (resultSet.goToNextRow()); + } + } + resultSet.close(); + } catch (error) { + console.info(tag + " :logMessage queryIdForDelete: error = " + error); + } + } + + /** + * @tc.number contactCard_insertDataAll_test_7700 + * @tc.name Add all details of a single contact and verify whether the insertion is successful (name, mobile + * number, company, position, nickname, email, home, remarks, aim, birthday, website, assistant, group, phone ring) + * @tc.desc Function test + */ + it("contactCard_insertDataAll_test_7700", 0, async function (done) { + console.info("------logMessage contactCard_insertDataAll_test_7700 is starting!-----"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + var insertRawContactValues = { + "display_name": "xiaocai", + }; + try { + var rawContactId = await DAHelper.insert(profileRawContactUri, insertRawContactValues); + console.info("logMessage contactCard_insertDataAll_test_7700: rawContactId = " + rawContactId); + expect(rawContactId > 0).assertTrue(); + var contactdata1 = await insertData(rawContactId, "name", "xiaocai", ""); + await queryAlldata("contactCard_insertDataAll_test_7700", DAHelper, rawContactId, contactdata1, "xiaocai"); + var contactdata2 = await insertData(rawContactId, "phone", "6500", ""); + await queryAlldata("contactCard_insertDataAll_test_7700", DAHelper, rawContactId, contactdata2, "6500"); + var contactdatd3 = await insertData(rawContactId, "organization", "TTTTT", "Deve"); + await queryAlldata("contactCard_insertDataAll_test_7700", DAHelper, rawContactId, contactdatd3, "TTTTT"); + var contactdatd4 = await insertData(rawContactId, "nickname", "xxxxcai", ""); + await queryAlldata("contactCard_insertDataAll_test_7700", DAHelper, rawContactId, contactdatd4, "xxxxcai"); + var contactdatd5 = await insertData(rawContactId, "email", "111@fox.com", ""); + await queryAlldata( + "contactCard_insertDataAll_test_7700", DAHelper, rawContactId, contactdatd5, "111@fox.com"); + var contactdatd6 = await insertData(rawContactId, "postal_address", "dddd", ""); + await queryAlldata("contactCard_insertDataAll_test_7700", DAHelper, rawContactId, contactdatd6, "dddd"); + var contactdatd7 = await insertData(rawContactId, "note", "caicai", ""); + await queryAlldata("contactCard_insertDataAll_test_7700", DAHelper, rawContactId, contactdatd7, "caicai"); + var contactdatd8 = await insertData(rawContactId, "im", "999999999", ""); + await queryAlldata( + "contactCard_insertDataAll_test_7700", DAHelper, rawContactId, contactdatd8, "999999999"); + var contactdatd9 = await insertData(rawContactId, "contact_event", "1125", ""); + await queryAlldata("contactCard_insertDataAll_test_7700", DAHelper, rawContactId, contactdatd9, "1125"); + var contactdatd10 = await insertData(rawContactId, "website", "wwww.xxx.com", ""); + await queryAlldata( + "contactCard_insertDataAll_test_7700", DAHelper, rawContactId, contactdatd10, "wwww.xxx.com"); + var contactdatd11 = await insertData(rawContactId, "relation", "xiaobai", ""); + await queryAlldata("contactCard_insertDataAll_test_7700", DAHelper, rawContactId, contactdatd11, "xiaobai"); + var contactdatd12 = await insertData(rawContactId, "group_membership", 1, ""); + await queryAlldata("contactCard_insertDataAll_test_7700", DAHelper, rawContactId, contactdatd12, 1); + var contactdatd13 = await insertData(rawContactId, "contact_misc", "5678", ""); + await queryAlldata("contactCard_insertDataAll_test_7700", DAHelper, rawContactId, contactdatd13, "5678"); + sleep(1000); + await deleteRawContact("contactCard_insertDataAll_test_7700"); + await deleteAll(profileContactDataUri, "contactCard_insertDataAll_test_7700"); + done(); + } catch (error) { + console.info("logMessage contactCard_insertDataAll_test_7700: raw_contact insert error = " + error); + done(); + } + }); + + /** + * @tc.number contactCard_insertDataUpdateMore_test_7800 + * @tc.name Modify multiple contact details and verify whether the modification is successful + * @tc.desc Function test + */ + it("contactCard_insertDataUpdateMore_test_7800", 0, async function (done) { + console.info("------logMessage contactCard_insertDataUpdateMore_test_7800 is starting!-----"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + try { + var insertRawContactValues = { + "display_name": "xiaocai" + }; + var rawContactId = await DAHelper.insert(profileRawContactUri, insertRawContactValues); + console.info("logMessage contactCard_insertDataUpdateMore_test_7800: rawContactId = " + rawContactId); + expect(rawContactId > 0).assertTrue(); + + var insertRawContactValues = { + "display_name": "xiaotian" + }; + var rawContactIdFirst = await DAHelper.insert(profileRawContactUri, insertRawContactValues); + console.info("logMessage contactCard_insertDataUpdateMore_test_7800: rawContactIdFirst = " + rawContactIdFirst); + expect(rawContactIdFirst > 0).assertTrue(); + await insertData(rawContactId, "name", "xiaotian", ""); + + var updateValues = { + "detail_info": "xiaocai7800" + }; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("raw_contact_id", rawContactId.toString()); + condition.or(); + condition.equalTo("raw_contact_id", rawContactIdFirst.toString()) + var updataCode = await DAHelper.update(profileContactDataUri, updateValues, condition); + console.info('logMessage contactCard_insertDataUpdateMore_test_7800: updataCode = ' + updataCode); + sleep(1000); + await insertDataUpdateMoreQuery( + "contactCard_insertDataUpdateMore_test_7800", DAHelper, rawContactId, rawContactIdFirst); + await deleteRawContact("contactCard_insertDataUpdateMore_test_7800"); + await deleteAll(profileContactDataUri, "contactCard_insertDataUpdateMore_test_7800"); + done(); + } catch (error) { + console.info("logMessage contactCard_insertDataUpdateMore_test_7800: raw_contact insert error = " + error); + done(); + } + }); + + async function insertDataUpdateMoreQuery(tag, DAHelper, rawContactId, rawContactIdFirst) { + var resultColumns = ["detail_info"]; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("raw_contact_id", rawContactId.toString()); + condition.or(); + condition.equalTo("raw_contact_id", rawContactIdFirst.toString()) + try { + var resultSet = await DAHelper.query(profileContactDataUri, resultColumns, condition); + if (resultSet.rowCount > 0) { + if (resultSet.goToFirstRow()) { + do { + var info = resultSet.getString(resultSet.getColumnIndex("detail_info")); + console.info(tag + "result info = " + info); + expect(info == "xiaocai7800").assertEqual(true); + } while (resultSet.goToNextRow()); + } + } + resultSet.close(); + } catch (error) { + console.info(tag + " :logMessage : error = " + error); + } + } + + /** + * @tc.number contactCard_deleterestore_test_7900 + * @tc.name Modify multiple contact details and verify whether the modification is successful + * @tc.desc Function test + */ + it("contactCard_deleterestore_test_7900", 0, async function (done) { + console.info("------logMessage contactCard_deleterestore_test_7900 is starting!-----"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + try { + var insertRawContactValues = { + "display_name": "xaioli7900" + }; + var rawContactId = await DAHelper.insert(profileRawContactUri, insertRawContactValues); + console.info("logMessage contactCard_deleterestore_test_7900: rawContactId = " + rawContactId); + expect(rawContactId > 0).assertTrue(); + sleep(1000); + var condition1 = new ohosDataAbility.DataAbilityPredicates(); + condition1.equalTo("id", rawContactId.toString()); + var deleteCode = await DAHelper.delete(profileRawContactUri, condition1); + console.info("contactCard_deleterestore_test_7900 : deleteCode = " + deleteCode); + expect(deleteCode == 0).assertTrue(); + sleep(1000); + + var condition2 = new ohosDataAbility.DataAbilityPredicates(); + condition2.equalTo("id", rawContactId.toString()); + var updatevalue = { + "is_deleted": 0 + }; + var updateCode = await DAHelper.update(profileRawContactUri, updatevalue, condition2); + console.info('contactCard_deleterestore_test_7900 : update = ' + updateCode); + sleep(1000); + + var condition3 = new ohosDataAbility.DataAbilityPredicates(); + condition3.equalTo("id", rawContactId.toString()); + var deleteCode = await DAHelper.delete(profileDeletedRawContactRecord, condition3); + + var map = new Map(); + map.set("id", rawContactId.toString()); + map.set("is_deleted", "0"); + await contactsQuery(map, "contactCard_deleterestore_test_7900", profileRawContactUri); + done(); + } catch (error) { + console.info("logMessage contactCard_deleterestore_test_7900: raw_contact insert error = " + error); + done(); + } + }); + + afterAll(async function () { + var tag = "Contacts_test_start_deleted"; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.greaterThan("id", "0"); + var DAHelperContact = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info(tag + ': start ! DAHelperContact = ' + DAHelperContact); + var deleteBlockList = await DAHelperContact.delete(profileBlocklistUri, condition); + console.info(tag + " : logMessage : deleteBlockList = " + deleteBlockList); + var deletedGroup = await DAHelperContact.delete(profileGroupUri, condition); + console.info(tag + " : logMessage : deletedGroup = " + deletedGroup); + var dataDeletedCode = await DAHelperContact.delete(profileContactDataUri, condition); + sleep(2000); + console.info(tag + " : logMessage : dataDeletedCode = " + dataDeletedCode); + var rawContactDeleted = await DAHelperContact.delete(profileRawContactUri, condition); + sleep(2000); + console.info(tag + " : logMessage : rawContactDeleted = " + rawContactDeleted); + var deleted = await DAHelperContact.delete(profileDeletedContactsUri, condition); + sleep(2000); + console.info(tag + " : logMessage : deleted = " + deleted); + }); + }); +} \ No newline at end of file diff --git a/telephony/telephonyjstest/contact_function/entry/src/main/ets/MainAbility/test/contact/ContactClass_test.js b/telephony/telephonyjstest/contact_function/entry/src/main/ets/MainAbility/test/contact/ContactClass_test.js new file mode 100644 index 000000000..38c4158bd --- /dev/null +++ b/telephony/telephonyjstest/contact_function/entry/src/main/ets/MainAbility/test/contact/ContactClass_test.js @@ -0,0 +1,310 @@ +/* + * 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 contact from '@ohos.contact'; +import utils from '../Utils.ets' +import {describe, expect, it} from 'deccjsunit/index' + +export default function ContactClassTest() { + describe('ContactClassTest', function () { + console.log('*************ContactClassTest is start*************'); + + /* * + * @tc.number : telephony_contact_phoneNumber_test_0100 + * @tc.name : CUSTOM_LABEL NUM_HOME NUM_MOBILE NUM_WORK NUM_FAX_WORK + * @tc.desc : check class PhoneNumber + */ + it("telephony_contact_phoneNumber_test_0100", 0, async function (done) { + console.log("************* telephony_contact_phoneNumber_test_0100 Test start*************"); + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + try { + expect(0).assertEqual(contact.PhoneNumber.CUSTOM_LABEL); + expect(1).assertEqual(contact.PhoneNumber.NUM_HOME); + expect(2).assertEqual(contact.PhoneNumber.NUM_MOBILE); + expect(3).assertEqual(contact.PhoneNumber.NUM_WORK); + expect(4).assertEqual(contact.PhoneNumber.NUM_FAX_WORK); + done(); + } catch (error) { + console.log("telephony_contact_phoneNumber_test_0100 error " + error.message); + } + console.log("************* telephony_contact_phoneNumber_test_0100 Test end*************"); + }); + + /* * + * @tc.number : telephony_contact_phoneNumber_test_0200 + * @tc.name : NUM_FAX_HOME NUM_PAGER NUM_OTHER NUM_CALLBACK NUM_CAR + * @tc.desc : check class PhoneNumber + */ + it("telephony_contact_phoneNumber_test_0200", 0, async function (done) { + console.log("************* telephony_contact_phoneNumber_test_0200 Test start*************"); + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + expect(5).assertEqual(contact.PhoneNumber.NUM_FAX_HOME); + expect(6).assertEqual(contact.PhoneNumber.NUM_PAGER); + expect(7).assertEqual(contact.PhoneNumber.NUM_OTHER); + expect(8).assertEqual(contact.PhoneNumber.NUM_CALLBACK); + expect(9).assertEqual(contact.PhoneNumber.NUM_CAR); + done(); + console.log("************* telephony_contact_phoneNumber_test_0200 Test end*************"); + }); + + /* * + * @tc.number : telephony_contact_phoneNumber_test_0300 + * @tc.name : NUM_COMPANY_MAIN NUM_ISDN NUM_MAIN NUM_OTHER_FAX NUM_RADIO + * @tc.desc : check class PhoneNumber + */ + it("telephony_contact_phoneNumber_test_0300", 0, async function (done) { + console.log("************* telephony_contact_phoneNumber_test_0300 Test start*************"); + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + expect(10).assertEqual(contact.PhoneNumber.NUM_COMPANY_MAIN); + expect(11).assertEqual(contact.PhoneNumber.NUM_ISDN); + expect(12).assertEqual(contact.PhoneNumber.NUM_MAIN); + expect(13).assertEqual(contact.PhoneNumber.NUM_OTHER_FAX); + expect(14).assertEqual(contact.PhoneNumber.NUM_RADIO); + done(); + console.log("************* telephony_contact_phoneNumber_test_0300 Test end*************"); + }); + + /* * + * @tc.number : telephony_contact_phoneNumber_test_0400 + * @tc.name : NUM_TELEX NUM_TTY_TDD NUM_WORK_MOBILE NUM_WORK_PAGER NUM_ASSISTANT NUM_MMS INVALID_LABEL_ID labelName + * @tc.desc : check class PhoneNumber + */ + it("telephony_contact_phoneNumber_test_0400", 0, async function (done) { + console.log("************* telephony_contact_phoneNumber_test_0400 Test start*************"); + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + expect(15).assertEqual(contact.PhoneNumber.NUM_TELEX); + expect(16).assertEqual(contact.PhoneNumber.NUM_TTY_TDD); + expect(17).assertEqual(contact.PhoneNumber.NUM_WORK_MOBILE); + expect(18).assertEqual(contact.PhoneNumber.NUM_WORK_PAGER); + expect(19).assertEqual(contact.PhoneNumber.NUM_ASSISTANT); + expect(20).assertEqual(contact.PhoneNumber.NUM_MMS); + expect(-1).assertEqual(contact.PhoneNumber.INVALID_LABEL_ID); + expect(typeof contact.PhoneNumber.labelName).assertEqual("string"); + done(); + console.log("************* telephony_contact_phoneNumber_test_0400 Test end*************"); + }); + + /* * + * @tc.number : telephony_contact_postalAddress_test_0100 + * @tc.name : CUSTOM_LABEL ADDR_HOME ADDR_WORK ADDR_OTHER INVALID_LABEL_ID + * @tc.desc : check class PostalAddress + */ + it("telephony_contact_postalAddress_test_0100", 0, async function (done) { + console.log("************* telephony_contact_postalAddress_test_0100 Test start*************"); + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + expect(0).assertEqual(contact.PostalAddress.CUSTOM_LABEL); + expect(1).assertEqual(contact.PostalAddress.ADDR_HOME); + expect(2).assertEqual(contact.PostalAddress.ADDR_WORK); + expect(3).assertEqual(contact.PostalAddress.ADDR_OTHER); + expect(-1).assertEqual(contact.PostalAddress.INVALID_LABEL_ID); + done(); + console.log("************* telephony_contact_postalAddress_test_0100 Test end*************"); + }); + + /* * + * @tc.number : telephony_contact_postalAddress_test_0200 + * @tc.name : labelName neighborhood pobox postalAddress postcode street + * @tc.desc : check class PostalAddress + */ + it("telephony_contact_postalAddress_test_0200", 0, async function (done) { + console.log("************* telephony_contact_postalAddress_test_0200 Test start*************"); + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + try { + var postalAddress = new contact.PostalAddress({ + 'labelName': 'testLabel', + 'neighborhood': 'beijing', + 'pobox': 'testBox', + 'postalAddress': 'testAddress', + 'postcode': 'testCode', + 'street': 'testStreet' + }) + expect(postalAddress.labelName).assertEqual('testLabel'); + expect(postalAddress.neighborhood).assertEqual('beijing'); + expect(postalAddress.pobox).assertEqual('testBox'); + expect(postalAddress.postalAddress).assertEqual('testAddress'); + expect(postalAddress.postcode).assertEqual('testCode'); + expect(postalAddress.street).assertEqual('testStreet'); + } catch (err) { + console.log("telephony_contact_postalAddress_test_0200 test error " + err.message); + } + done(); + console.log("************* telephony_contact_postalAddress_test_0200 Test end*************"); + }); + + /* * + * @tc.number : telephony_contact_relation_test_0100 + * @tc.name : CUSTOM_LABEL ADDR_HOME ADDR_WORK ADDR_OTHER INVALID_LABEL_ID + * @tc.desc : check class Relation + */ + it("telephony_contact_relation_test_0100", 0, async function (done) { + console.log("************* telephony_contact_relation_test_0100 Test start*************"); + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + expect(0).assertEqual(contact.Relation.CUSTOM_LABEL); + expect(1).assertEqual(contact.Relation.RELATION_ASSISTANT); + expect(2).assertEqual(contact.Relation.RELATION_BROTHER); + expect(3).assertEqual(contact.Relation.RELATION_CHILD); + expect(4).assertEqual(contact.Relation.RELATION_DOMESTIC_PARTNER); + done(); + console.log("************* telephony_contact_relation_test_0100 Test end*************"); + }); + + /* * + * @tc.number : telephony_contact_relation_test_0200 + * @tc.name : RELATION_FATHER RELATION_FRIEND RELATION_MANAGER RELATION_MOTHER RELATION_PARENT + * @tc.desc : check class Relation + */ + it("telephony_contact_relation_test_0200", 0, async function (done) { + console.log("************* telephony_contact_relation_test_0200 Test start*************"); + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + expect(5).assertEqual(contact.Relation.RELATION_FATHER); + expect(6).assertEqual(contact.Relation.RELATION_FRIEND); + expect(7).assertEqual(contact.Relation.RELATION_MANAGER); + expect(8).assertEqual(contact.Relation.RELATION_MOTHER); + expect(9).assertEqual(contact.Relation.RELATION_PARENT); + done(); + console.log("************* telephony_contact_relation_test_0200 Test end*************"); + }); + + /* * + * @tc.number : telephony_contact_Relation_test_0300 + * @tc.name : RELATION_PARTNER RELATION_REFERRED_BY RELATION_RELATIVE + RELATION_SISTER RELATION_SPOUSE INVALID_LABEL_ID + * @tc.desc : check class Relation + */ + it("telephony_contact_relation_test_0300", 0, async function (done) { + console.log("************* telephony_contact_relation_test_0300 Test start*************"); + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + expect(10).assertEqual(contact.Relation.RELATION_PARTNER); + expect(11).assertEqual(contact.Relation.RELATION_REFERRED_BY); + expect(12).assertEqual(contact.Relation.RELATION_RELATIVE); + expect(13).assertEqual(contact.Relation.RELATION_SISTER); + expect(14).assertEqual(contact.Relation.RELATION_SPOUSE); + expect(-1).assertEqual(contact.Relation.INVALID_LABEL_ID); + done(); + console.log("************* telephony_contact_relation_test_0300 Test end*************"); + }); + + /* * + * @tc.number : telephony_contact_relation_test_0400 + * @tc.name : labelName relationName + * @tc.desc : check class Relation + */ + it("telephony_contact_relation_test_0400", 0, async function (done) { + console.log("************* telephony_contact_relation_test_0400 Test start*************"); + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + try { + var relation = new contact.Relation({ + 'labelName': 'testLabel', + 'relationName': 'testRelation' + }) + expect(relation.labelName).assertEqual('testLabel'); + expect(relation.relationName).assertEqual('testRelation'); + } catch (err) { + console.log("telephony_contact_relation_test_0400 test error " + err.message); + } + done(); + console.log("************* telephony_contact_relation_test_0400 Test end*************"); + }); + + /* * + * @tc.number : telephony_contact_sipAddress_test_0100 + * @tc.name : CUSTOM_LABEL SIP_HOME SIP_WORK SIP_OTHER INVALID_LABEL_ID + * @tc.desc : check class SipAddress + */ + it("telephony_contact_sipAddress_test_0100", 0, async function (done) { + console.log("************* telephony_contact_sipAddress_test_0100 Test start*************"); + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + expect(0).assertEqual(contact.SipAddress.CUSTOM_LABEL); + expect(1).assertEqual(contact.SipAddress.SIP_HOME); + expect(2).assertEqual(contact.SipAddress.SIP_WORK); + expect(3).assertEqual(contact.SipAddress.SIP_OTHER); + expect(-1).assertEqual(contact.SipAddress.INVALID_LABEL_ID); + done(); + console.log("************* telephony_contact_sipAddress_test_0100 Test end*************"); + }); + + /* * + * @tc.number : telephony_contact_sipAddress_test_0200 + * @tc.name : labelName sipAddress + * @tc.desc : check class SipAddress + */ + it("telephony_contact_sipAddress_test_0200", 0, async function (done) { + console.log("************* telephony_contact_sipAddress_test_0200 Test start*************"); + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + + try { + var sip = new contact.SipAddress({ + 'labelName': 'testLabel', + 'sipAddress': 'testSip' + }) + expect(sip.labelName).assertEqual('testLabel'); + expect(sip.sipAddress).assertEqual('testSip'); + } catch (err) { + console.log("telephony_contact_sipAddress_test_0200 test error " + err.message); + } + done(); + console.log("************* telephony_contact_sipAddress_test_0200 Test end*************"); + }); + console.log('*************ContactClassTest is end*************'); + }) +} \ No newline at end of file diff --git a/telephony/telephonyjstest/contact_function/entry/src/main/ets/MainAbility/test/contact/ContacterJsunit.ets b/telephony/telephonyjstest/contact_function/entry/src/main/ets/MainAbility/test/contact/ContacterJsunit.ets new file mode 100644 index 000000000..a5e2873bf --- /dev/null +++ b/telephony/telephonyjstest/contact_function/entry/src/main/ets/MainAbility/test/contact/ContacterJsunit.ets @@ -0,0 +1,262 @@ +// @ts-nocheck +/** + * 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 {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index' +import contact from '@ohos.contact'; +import utils from '../Utils.ets' + +export default function contacterJsunit() { + describe('ContacterTest',function () { + /** + * @tc.number Telephony_contact_Contact_0100 + * @tc.name Test The Contact enum + * @tc.desc Function test + */ + + it('Telephony_contact_Contact_0100', 0, async function (done) { + console.info("Telephony_contact_Contact_0100 start") + if(utils.notCheck){ + done(); + return; + } + expect(contact.Contact.INVALID_CONTACT_ID === -1).assertTrue(); + expect(contact.Contact.id === 0).assertTrue(); + expect(contact.Contact.key !== "test").assertTrue(); + console.info("Telephony_contact_Contact_0100 end") + done(); + }); + + /** + * @tc.number Telephony_contact_Contact_0200 + * @tc.name Test The Contact enum + * @tc.desc Function test + */ + + it('Telephony_contact_Contact_0200', 0, async function (done) { + console.info("Telephony_contact_Contact_0200 start") + if(utils.notCheck){ + done(); + return; + } + expect(contact.Contact.INVALID_CONTACT_ID === -1).assertTrue(); + expect(contact.Contact.id === 1).assertTrue(); + expect(contact.Contact.key !== "key").assertTrue(); + console.info("Telephony_contact_Contact_0200 end") + done(); + }); + + /** + * @tc.number Telephony_contact_Attribute_0100 + * @tc.name Test The Attribute enum + * @tc.desc Function test + */ + it('Telephony_contact_Attribute_0100', 0, async function (done) { + console.info("Telephony_contact_Attribute_0100 start") + if(utils.notCheck){ + done(); + return; + } + expect(contact.Attribute.ATTR_CONTACT_EVENT === 0).assertTrue(); + expect(contact.Attribute.ATTR_EMAIL === 0).assertTrue(); + expect(contact.Attribute.ATTR_GROUP_MEMBERSHIP === 0).assertTrue(); + expect(contact.Attribute.ATTR_IM === 0).assertTrue(); + expect(contact.Attribute.ATTR_NAME === 0).assertTrue(); + expect(contact.Attribute.ATTR_NICKNAME === 0).assertTrue(); + expect(contact.Attribute.ATTR_NOTE === 0).assertTrue(); + expect(contact.Attribute.ATTR_ORGANIZATION === 0).assertTrue(); + expect(contact.Attribute.ATTR_PHONE === 0).assertTrue(); + expect(contact.Attribute.ATTR_PORTRAIT === 0).assertTrue(); + expect(contact.Attribute.ATTR_POSTAL_ADDRESS === 0).assertTrue(); + expect(contact.Attribute.ATTR_RELATION === 0).assertTrue(); + expect(contact.Attribute.ATTR_SIP_ADDRESS === 0).assertTrue(); + expect(contact.Attribute.ATTR_WEBSITE === 0).assertTrue(); + console.info("Telephony_contact_Attribute_0100 end") + done(); + }); + + /** + * @tc.number Telephony_contact_Attribute_0200 + * @tc.name Test The Attribute enum + * @tc.desc Function test + */ + it('Telephony_contact_Attribute_0200', 0, async function (done) { + console.info("Telephony_contact_Attribute_0100 start") + if(utils.notCheck){ + done(); + return; + } + expect(contact.Attribute.ATTR_CONTACT_EVENT === 1).assertTrue(); + expect(contact.Attribute.ATTR_EMAIL === 1).assertTrue(); + expect(contact.Attribute.ATTR_GROUP_MEMBERSHIP === 1).assertTrue(); + expect(contact.Attribute.ATTR_IM === 1).assertTrue(); + expect(contact.Attribute.ATTR_NAME === 1).assertTrue(); + expect(contact.Attribute.ATTR_NICKNAME === 1).assertTrue(); + expect(contact.Attribute.ATTR_NOTE === 1).assertTrue(); + expect(contact.Attribute.ATTR_ORGANIZATION === 1).assertTrue(); + expect(contact.Attribute.ATTR_PHONE === 1).assertTrue(); + expect(contact.Attribute.ATTR_PORTRAIT === 1).assertTrue(); + expect(contact.Attribute.ATTR_POSTAL_ADDRESS === 1).assertTrue(); + expect(contact.Attribute.ATTR_RELATION === 1).assertTrue(); + expect(contact.Attribute.ATTR_SIP_ADDRESS === 1).assertTrue(); + expect(contact.Attribute.ATTR_WEBSITE === 1).assertTrue(); + console.info("Telephony_contact_Attribute_0200 end") + done(); + }); + + /** + * @tc.number Telephony_contact_Email_0100 + * @tc.name Test The Attribute Email + * @tc.desc Function test + */ + it('Telephony_contact_Email_0100', 0, async function (done) { + console.info("Telephony_contact_Email_0100 start") + if(utils.notCheck){ + done(); + return; + } + expect(contact.Email.CUSTOM_LABEL === 0).assertTrue(); + expect(contact.Email.EMAIL_HOME === 1).assertTrue(); + expect(contact.Email.EMAIL_WORK === 2).assertTrue(); + expect(contact.Email.EMAIL_OTHER === 3).assertTrue(); + expect(contact.Email.INVALID_LABEL_ID === -1).assertTrue(); + expect(contact.Email.email !== "email").assertTrue(); + expect(contact.Email.labelName !== "email").assertTrue(); + expect(contact.Email.displayName !== "email").assertTrue(); + console.info("Telephony_contact_Email_0100 end") + done(); + }); + + /** + * @tc.number Telephony_contact_Email_0200 + * @tc.name Test The Attribute Email + * @tc.desc Function test + */ + it('Telephony_contact_Email_0200', 0, async function (done) { + console.info("Telephony_contact_Email_0200 start") + if(utils.notCheck){ + done(); + return; + } + expect(contact.Email.CUSTOM_LABEL === 0).assertTrue(); + expect(contact.Email.EMAIL_HOME === 1).assertTrue(); + expect(contact.Email.EMAIL_WORK === 2).assertTrue(); + expect(contact.Email.EMAIL_OTHER === 3).assertTrue(); + expect(contact.Email.INVALID_LABEL_ID === -1).assertTrue(); + expect(contact.Email.email !== "email2").assertTrue(); + expect(contact.Email.labelName !== "email2").assertTrue(); + expect(contact.Email.displayName !== "email2").assertTrue(); + console.info("Telephony_contact_Email_0200 end") + done(); + }); + + /** + * @tc.number Telephony_contact_Event_0100 + * @tc.name Test The Attribute Event + * @tc.desc Function test + */ + it('Telephony_contact_Event_0100', 0, async function (done) { + console.info("Telephony_contact_Event_0100 start") + if(utils.notCheck){ + done(); + return; + } + expect(contact.Event.CUSTOM_LABEL === 0).assertTrue(); + expect(contact.Event.EVENT_ANNIVERSARY === 1).assertTrue(); + expect(contact.Event.EVENT_OTHER === 2).assertTrue(); + expect(contact.Event.EVENT_BIRTHDAY === 3).assertTrue(); + expect(contact.Event.INVALID_LABEL_ID === -1).assertTrue(); + expect(contact.Event.eventDate !== "event").assertTrue(); + expect(contact.Event.labelName !== "event").assertTrue(); + console.info("Telephony_contact_Event_0100 end") + done(); + }); + + /** + * @tc.number Telephony_contact_Event_0200 + * @tc.name Test The Attribute Event + * @tc.desc Function test + */ + it('Telephony_contact_Event_0200', 0, async function (done) { + console.info("Telephony_contact_Event_0200 start") + if(utils.notCheck){ + done(); + return; + } + expect(contact.Event.CUSTOM_LABEL === 0).assertTrue(); + expect(contact.Event.EVENT_ANNIVERSARY === 1).assertTrue(); + expect(contact.Event.EVENT_OTHER === 2).assertTrue(); + expect(contact.Event.EVENT_BIRTHDAY === 3).assertTrue(); + expect(contact.Event.INVALID_LABEL_ID === -1).assertTrue(); + expect(contact.Event.eventDate !== "event2").assertTrue(); + expect(contact.Event.labelName !== "event2").assertTrue(); + console.info("Telephony_contact_Event_0200 end") + done(); + }); + + /** + * @tc.number Telephony_contact_ImAddress_0100 + * @tc.name Test The Attribute ImAddress + * @tc.desc Function test + */ + it('Telephony_contact_ImAddress_0100', 0, async function (done) { + console.info("Telephony_contact_ImAddress_0100 start") + if(utils.notCheck){ + done(); + return; + } + expect(contact.ImAddress.CUSTOM_LABEL === -1).assertTrue(); + expect(contact.ImAddress.IM_AIM === 0).assertTrue(); + expect(contact.ImAddress.IM_MSN === 1).assertTrue(); + expect(contact.ImAddress.IM_YAHOO === 2).assertTrue(); + expect(contact.ImAddress.IM_SKYPE === 3).assertTrue(); + expect(contact.ImAddress.IM_QQ === 4).assertTrue(); + expect(contact.ImAddress.IM_ICQ === 6).assertTrue(); + expect(contact.ImAddress.IM_JABBER === 7).assertTrue(); + expect(contact.ImAddress.INVALID_LABEL_ID === -2).assertTrue(); + expect(contact.ImAddress.imAddress !== "imAddress").assertTrue(); + expect(contact.ImAddress.labelName !== "imAddress").assertTrue(); + console.info("Telephony_contact_ImAddress_0100 end") + done(); + }); + + /** + * @tc.number Telephony_contact_ImAddress_0200 + * @tc.name Test The Attribute ImAddress + * @tc.desc Function test + */ + it('Telephony_contact_ImAddress_0200', 0, async function (done) { + console.info("Telephony_contact_ImAddress_0100 start") + if(utils.notCheck){ + done(); + return; + } + expect(contact.ImAddress.CUSTOM_LABEL === -1).assertTrue(); + expect(contact.ImAddress.IM_AIM === 0).assertTrue(); + expect(contact.ImAddress.IM_MSN === 1).assertTrue(); + expect(contact.ImAddress.IM_YAHOO === 2).assertTrue(); + expect(contact.ImAddress.IM_SKYPE === 3).assertTrue(); + expect(contact.ImAddress.IM_QQ === 4).assertTrue(); + expect(contact.ImAddress.IM_ICQ === 6).assertTrue(); + expect(contact.ImAddress.IM_JABBER === 7).assertTrue(); + expect(contact.ImAddress.INVALID_LABEL_ID === -2).assertTrue(); + expect(contact.ImAddress.imAddress !== "imAddress2").assertTrue(); + expect(contact.ImAddress.labelName !== "imAddress2").assertTrue(); + console.info("Telephony_contact_ImAddress_0200 end") + done(); + }); + + }) +} \ No newline at end of file diff --git a/telephony/telephonyjstest/contact_function/entry/src/main/ets/MainAbility/test/contact/Contacts_test.js b/telephony/telephonyjstest/contact_function/entry/src/main/ets/MainAbility/test/contact/Contacts_test.js new file mode 100644 index 000000000..b3fe8365b --- /dev/null +++ b/telephony/telephonyjstest/contact_function/entry/src/main/ets/MainAbility/test/contact/Contacts_test.js @@ -0,0 +1,6306 @@ +/* + * 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 featureAbility from '@ohos.ability.featureAbility'; +import ohosDataAbility from '@ohos.data.dataability'; +import utils from '../Utils.ets' +import {afterAll, afterEach, beforeAll, beforeEach, describe, expect, it} from 'deccjsunit/index' +import common from './common.js'; + +const URI_CONTACTS = "dataability:///com.ohos.contactsdataability"; +const contactUri = "dataability:///com.ohos.contactsdataability/contacts/contact"; +const rawContactUri = "dataability:///com.ohos.contactsdataability/contacts/raw_contact"; +const contactDataUri = "dataability:///com.ohos.contactsdataability/contacts/contact_data"; +const groupUri = "dataability:///com.ohos.contactsdataability/contacts/groups"; +const contactBlocklistUri = "dataability:///com.ohos.contactsdataability/contacts/contact_blocklist"; +const deletedRawContactUri = "dataability:///com.ohos.contactsdataability/contacts/deleted_raw_contact"; +const searchContactUri = "dataability:///com.ohos.contactsdataability/contacts/search_contact"; +const deletedUri = "dataability:///com.ohos.contactsdataability/contacts/deleted_raw_contact"; +const deletedRawContactRecord = "dataability:///com.ohos.contactsdataability/contacts/deleted_raw_contact_record"; + +export default function ContactsTest() { + describe('ContactsTest', function () { + console.info("-------ContactsTest is starting!--------"); + + function sleep(numberMillis) { + var now = new Date(); + var exitTime = now.getTime() + numberMillis; + while (true) { + now = new Date(); + if (now.getTime() > exitTime) + return; + } + } + + async function contactsQuery(map, tag, uri) { + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info(tag + ': contactsQuery start ! DAHelper = ' + DAHelper); + var resultColumns = []; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("id", map.get("id")); + try { + var resultSet = await DAHelper.query(uri, resultColumns, condition); + sleep(2000); + if (resultSet.rowCount > 0 && resultSet.goToFirstRow()) { + do { + for (var [key, value] of map) { + var dbresult = resultSet.getString(resultSet.getColumnIndex(key)); + console.info(tag + ' :logMessage contactsQuery key = ' + key + ' dbresult :' + dbresult + + ' value : ' + value); + expect(value == dbresult).assertEqual(true); + } + } while (resultSet.goToNextRow()); + } + + resultSet.close(); + } catch (error) { + console.info(tag + "logMessage contactsQuery: error = " + error); + } + } + + async function queryBatch(map, tag, size) { + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info(tag + ': queryBatch start ! DAHelper = ' + DAHelper); + var resultColumns = []; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("raw_contact_id", map.get("raw_contact_id")); + try { + var resultSet = await DAHelper.query(rawContactUri, resultColumns, condition); + sleep(1000); + console.info(tag + ': queryBatch start ! resultSet.rowCount = ' + resultSet.rowCount); + expect(resultSet.rowCount == size).assertEqual(true); + resultSet.close(); + } catch (error) { + console.info(tag + "logMessage resultSet.rowCount: error = " + error); + } + } + + async function queryIdForDelete(map, tag, uri) { + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info(tag + ': queryIdForDelete start ! DAHelper = ' + DAHelper); + var resultColumns = common.getCallLogResultColumns(); + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("id", map.get("id")); + try { + var resultSet = await DAHelper.query(uri, resultColumns, condition); + sleep(1000); + expect(resultSet.goToFirstRow() == false).assertTrue(); + console.info(tag + " :logMessage queryIdForDelete: goToFirstRow " + resultSet.goToFirstRow()); + resultSet.close(); + } catch (error) { + console.info(tag + " :logMessage queryIdForDelete: error = " + error); + } + } + + async function deleteAll(uri, tag) { + try { + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.greaterThan("id", "0"); + var deleteCode = await DAHelper.delete(uri, condition); + console.info(tag + ': deleteAll deleteCode = ' + deleteCode); + expect(deleteCode == 0).assertTrue(); + } catch (error) { + console.info(tag + ': deleteAll error = ' + error); + } + } + + async function deleteRawContact(tag) { + try { + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.greaterThan("id", "0"); + condition.and(); + condition.equalTo("is_deleted", "0"); + var deleteCode = await DAHelper.delete(rawContactUri, condition); + console.info(tag + ': deleteRawContact deleteCode = ' + deleteCode); + expect(deleteCode == 0).assertTrue(); + sleep(1000); + var conditionAll = new ohosDataAbility.DataAbilityPredicates(); + conditionAll.greaterThan("id", "0"); + var code = await DAHelper.delete(deletedUri, conditionAll); + console.info(tag + ': Completely delete code = ' + code); + expect(code == 0).assertTrue(); + } catch (error) { + console.info(tag + ': deleteRawContact error = ' + error); + } + } + + async function insertData(rawContactId, type, value, position) { + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + var contactDataValues1 = + { + "raw_contact_id": rawContactId, "content_type": type, "detail_info": value, "position": position + }; + try { + var contactDataId = await DAHelper.insert(contactDataUri, contactDataValues1); + console.info("logMessage : contactDataId1 " + contactDataId1); + expect(contactDataId > 0).assertTrue(); + } catch (error) { + console.info("logMessage : contact_data name insert error = " + error); + } + return contactDataId; + } + + /** + * @tc.number contact_insert_test_100 + * @tc.name Insert contact data + * @tc.desc Function test + */ + it("contact_insert_test_100", 0, async function (done) { + console.info("------logMessage contact_insert_test_100 is starting!-----"); + if(utils.notCheck){ + expect(true).assertTrue(); + done(); + return; + } + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + try { + var rawContactId = await DAHelper.insert(rawContactUri, common.getProfileRawContact()); + sleep(1000); + console.info('logMessage contact_insert_test_100: rawContactId = ' + rawContactId); + expect(rawContactId > 0).assertTrue(); + var map = common.getProfileRawContactMap(); + map.set("id", rawContactId.toString()); + await contactsQuery(map, "contact_insert_test_100", rawContactUri); + await deleteRawContact("contact_insert_test_100"); + done(); + } catch (error) { + console.info('logMessage contact_insert_test_100: insert error = ' + error); + done(); + } + }); + + /** + * @tc.number contact_insert_test_400 + * @tc.name Insert contact details (name, company, position, mobile phone number) + * @tc.desc Function test + */ + it("contact_insert_test_400", 0, async function (done) { + console.info("------logMessage contact_insert_test_400 is starting!-----"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + var insertRawContactValues = { + "display_name": "xiaocheng", + }; + try { + var rawContactId = await DAHelper.insert(rawContactUri, insertRawContactValues); + console.info("logMessage contact_insert_test_400: rawContactId = " + rawContactId); + expect(rawContactId > 0).assertTrue(); + await dataNameInsert(DAHelper, rawContactId); + await dataCompanyInsert(DAHelper, rawContactId); + await dataPhoneInsert(DAHelper, rawContactId); + await deleteRawContact("contact_insert_test_400"); + await deleteAll(contactDataUri, "contact_insert_test_400"); + done(); + } catch (error) { + console.info("logMessage contact_insert_test_400: raw_contact insert error = " + error); + done(); + } + }); + + async function dataNameInsert(DAHelper, rawContactId) { + var contactDataValues1 = { + "raw_contact_id": rawContactId, + "content_type": "name", + "detail_info": "xiaocheng" + }; + try { + var contactDataId1 = await DAHelper.insert(contactDataUri, contactDataValues1); + console.info("logMessage contact_insert_test_400: contactDataId1 " + contactDataId1); + expect(contactDataId1 > 0).assertTrue(); + var map = new Map(); + map.set("id", contactDataId1.toString()); + map.set("detail_info", "xiaocheng"); + map.set("raw_contact_id", rawContactId.toString()); + await contactsQuery(map, "contact_insert_test_400", contactDataUri); + } catch (error) { + console.info("logMessage contact_insert_test_400: contact_data name insert error = " + error); + done(); + } + } + + async function dataCompanyInsert(DAHelper, rawContactId) { + var contactDataValues2 = { + "raw_contact_id": rawContactId, + "content_type": "organization", + "detail_info": "TT", + "position": "developer" + }; + try { + var contactDataId2 = await DAHelper.insert(contactDataUri, contactDataValues2); + console.info("logMessage contact_insert_test_400: contactDataId2 " + contactDataId2); + expect(contactDataId2 > 0).assertTrue(); + var map = new Map(); + map.set("id", contactDataId2.toString()); + map.set("detail_info", "TT"); + map.set("position", "developer"); + contactsQuery(map, "contact_insert_test_400", contactDataUri); + } catch (error) { + console.info("logMessage contact_insert_test_400: contact_data company insert error = " + error); + done(); + } + } + + async function dataPhoneInsert(DAHelper, rawContactId) { + var contactDataValues3 = { + "raw_contact_id": rawContactId, + "content_type": "phone", + "detail_info": "12345678" + }; + try { + var contactDataId3 = await DAHelper.insert(contactDataUri, contactDataValues3); + sleep(1000); + console.info("logMessage contact_insert_test_400: contactDataId3 " + contactDataId3); + expect(contactDataId3 > 0).assertTrue(); + var map = new Map(); + map.set("id", contactDataId3.toString()); + map.set("detail_info", "12345678"); + await contactsQuery(map, "contact_insert_test_400", contactDataUri); + } catch (error) { + console.info("logMessage contact_insert_test_400: contact_data phone insert error = " + error); + done(); + } + } + + /** + * @tc.number contact_insert_test_500 + * @tc.name Insert contact details (nickname, email, home) + * @tc.desc Function test + */ + it("contact_insert_test_500", 0, async function (done) { + console.info("------logMessage contact_insert_test_500 is starting!-----"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + var insertRawContactValues = { + "display_name": "xiaocheng", + }; + try { + var rawContactId = await DAHelper.insert(rawContactUri, insertRawContactValues); + console.info("logMessage contact_insert_test_500: rawContactId = " + rawContactId); + expect(rawContactId > 0).assertTrue(); + await dataEmailInsert(DAHelper, rawContactId); + await dataNickNameInsert(DAHelper, rawContactId); + await dataPostalAddressInsert(DAHelper, rawContactId); + await deleteRawContact("contact_insert_test_500"); + await deleteAll(contactDataUri, "contact_insert_test_500"); + done(); + } catch (error) { + console.info("logMessage contact_insert_test_500: raw_contact insert error = " + error); + done(); + } + }); + + async function dataEmailInsert(DAHelper, rawContactId) { + var contactDataValues1 = { + "raw_contact_id": rawContactId, + "content_type": "email", + "detail_info": "166@163.com" + }; + try { + var contactDataId1 = await DAHelper.insert(contactDataUri, contactDataValues1); + sleep(1000); + console.info("logMessage contact_insert_test_500: contactDataId1 " + contactDataId1); + expect(contactDataId1 > 0).assertTrue(); + var map = new Map(); + map.set("id", contactDataId1.toString()); + map.set("detail_info", "166@163.com"); + await contactsQuery(map, "contact_insert_test_500_1", contactDataUri); + } catch (error) { + console.info("logMessage contact_insert_test_500: contact_data email insert error = " + error); + } + } + + async function dataNickNameInsert(DAHelper, rawContactId) { + var contactDataValues2 = { + "raw_contact_id": rawContactId, + "content_type": "nickname", + "detail_info": "xiaocheng" + }; + try { + var contactDataId2 = await DAHelper.insert(contactDataUri, contactDataValues2); + console.info("logMessage contact_insert_test_500: contactDataId2 " + contactDataId2); + expect(contactDataId2 > 0).assertTrue(); + var map = new Map(); + map.set("id", contactDataId2.toString()); + map.set("detail_info", "xiaocheng"); + await contactsQuery(map, "contact_insert_test_500_2", contactDataUri); + } catch (error) { + console.info("logMessage contact_insert_test_500: contact_data nickname insert error = " + error); + } + } + + async function dataPostalAddressInsert(DAHelper, rawContactId) { + var contactDataValues3 = { + "raw_contact_id": rawContactId, + "content_type": "postal_address", + "detail_info": "NanJingSoftRoad" + }; + try { + var contactDataId3 = await DAHelper.insert(contactDataUri, contactDataValues3); + console.info("logMessage contact_insert_test_500: contactDataId3 " + contactDataId3); + expect(contactDataId3 > 0).assertTrue(); + var map = new Map(); + map.set("id", contactDataId3.toString()); + map.set("detail_info", "NanJingSoftRoad"); + await contactsQuery(map, "contact_insert_test_500_3", contactDataUri); + } catch (error) { + console.info("logMessage contact_insert_test_500: contact_data postal_address insert error = " + error); + } + } + + /** + * @tc.number contact_insert_test_600 + * @tc.name Insert contact details (remarks, AIM, birthday) + * @tc.desc Function test + */ + it("contact_insert_test_600", 0, async function (done) { + console.info("------logMessage contact_insert_test_600 is starting!-----"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + var insertRawContactValues = { + "display_name": "xiaocheng", + }; + try { + var rawContactId = await DAHelper.insert(rawContactUri, insertRawContactValues) + console.info("logMessage contact_insert_test_600: rawContactId = " + rawContactId); + expect(rawContactId > 0).assertTrue(); + await dataNoteInsert(DAHelper, rawContactId); + await dataAimInsert(DAHelper, rawContactId); + await dataEventInsert(DAHelper, rawContactId); + await deleteRawContact("contact_insert_test_600"); + await deleteAll(contactDataUri, "contact_insert_test_600"); + done(); + } catch (error) { + console.info("logMessage contact_insert_test_600: raw_contact insert error = " + error); + done(); + } + }); + + async function dataNoteInsert(DAHelper, rawContactId) { + var contactDataValues1 = { + "raw_contact_id": rawContactId, + "content_type": "note", + "detail_info": "javaGangster" + }; + try { + var contactDataId1 = await DAHelper.insert(contactDataUri, contactDataValues1); + console.info("logMessage contact_insert_test_600: contactDataId1 " + contactDataId1); + expect(contactDataId1 > 0).assertTrue(); + var map = new Map(); + map.set("id", contactDataId1.toString()); + map.set("detail_info", "javaGangster"); + await contactsQuery(map, "contact_insert_test_600_1", contactDataUri); + } catch (error) { + console.info("logMessage contact_insert_test_600: contact_data note insert error = " + error); + done(); + } + } + + async function dataAimInsert(DAHelper, rawContactId) { + var contactDataValues2 = { + "raw_contact_id": rawContactId, "content_type": "im", "detail_info": "aaaaa" + }; + try { + var contactDataId2 = await DAHelper.insert(contactDataUri, contactDataValues2); + console.info("logMessage contact_insert_test_600: contactDataId2 " + contactDataId2); + expect(contactDataId2 > 0).assertTrue(); + var map = new Map(); + map.set("id", contactDataId1.toString()); + map.set("detail_info", "aaaaa"); + await contactsQuery(map, "contact_insert_test_600_2", contactDataUri); + } catch (error) { + console.info("logMessage contact_insert_test_600: contact_data aim insert error = " + error); + } + } + + async function dataEventInsert(DAHelper, rawContactId) { + var contactDataValues3 = { + "raw_contact_id": rawContactId, + "content_type": "contact_event", + "detail_info": "19960229" + }; + try { + var contactDataId3 = await DAHelper.insert(contactDataUri, contactDataValues3); + console.info("logMessage contact_insert_test_600: contactDataId3 " + contactDataId3); + expect(contactDataId3 > 0).assertTrue(); + var map = new Map(); + map.set("id", contactDataId1.toString()); + map.set("detail_info", "19960229"); + await contactsQuery(map, "contact_insert_test_600_3", contactDataUri); + } catch (error) { + console.info("logMessage contact_insert_test_600: contact_data event insert error = " + error); + } + } + + /** + * @tc.number contact_insert_test_700 + * @tc.name Insert contact details (URL, assistant, group) + * @tc.desc Function test + */ + it("contact_insert_test_700", 0, async function (done) { + console.info("------logMessage contact_insert_test_700 is starting!-----"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + var insertRawContactValues = { + "display_name": "xiaocheng", + }; + try { + var rawContactId = await DAHelper.insert(rawContactUri, insertRawContactValues); + console.info("logMessage contact_insert_test_700: rawContactId = " + rawContactId); + expect(rawContactId > 0).assertTrue(); + await dataWebsiteInsert(DAHelper, rawContactId); + await dataRelationInsert(DAHelper, rawContactId); + await dataWebsiteInsert(DAHelper, rawContactId); + await deleteRawContact("contact_insert_test_700"); + await deleteAll(contactDataUri, "contact_insert_test_700"); + done(); + } catch (error) { + console.info("logMessage contact_insert_test_700: raw_contact insert error = " + error); + done(); + } + }); + + async function dataWebsiteInsert(DAHelper, rawContactId) { + var contactDataValues1 = { + "raw_contact_id": rawContactId, + "content_type": "website", + "detail_info": "www.com" + }; + try { + var contactDataId1 = await DAHelper.insert(contactDataUri, contactDataValues1); + sleep(1000); + console.info("logMessage contact_insert_test_700: contactDataId1 " + contactDataId1); + expect(contactDataId1 > 0).assertTrue(); + var map = new Map(); + map.set("id", contactDataId1.toString()); + map.set("detail_info", "www.com"); + await contactsQuery(map, "contact_insert_test_700_1", contactDataUri); + await contactDataRelationInsert(); + } catch (error) { + console.info("logMessage contact_insert_test_700: contact_data website insert error = " + error); + } + } + + async function dataRelationInsert(DAHelper, rawContactId) { + var contactDataValues2 = { + "raw_contact_id": rawContactId, + "content_type": "relation", + "detail_info": "Secretary" + }; + try { + var contactDataId2 = await DAHelper.insert(contactDataUri, contactDataValues2); + sleep(1000); + console.info("logMessage contact_insert_test_700: contactDataId2 " + contactDataId2); + expect(contactDataId2 > 0).assertTrue(); + var map = new Map(); + map.set("id", contactDataId2.toString()); + map.set("detail_info", "Secretary"); + await contactsQuery(map, "contact_insert_test_700_2", contactDataUri); + await contactDataGroupInsert(); + } catch (error) { + console.info("logMessage contact_insert_test_700: contact_data relation insert error = " + error); + } + } + + async function dataGroupInsert(DAHelper, rawContactId) { + var contactDataValues3 = { + "raw_contact_id": rawContactId, + "content_type": "group_membership", + "detail_info": "1" + }; + try { + var contactDataId3 = await DAHelper.insert(contactDataUri, contactDataValues3); + sleep(1000); + console.info("logMessage contact_insert_test_700: contactDataId3 " + contactDataId3); + expect(contactDataId3 > 0).assertTrue(); + var map = new Map(); + map.set("id", contactDataId3.toString()); + map.set("detail_info", "1"); + await contactsQuery(map, "contact_insert_test_700_3", contactDataUri); + done(); + } catch (error) { + console.info("logMessage contact_insert_test_700: contact_data group insert error = " + error); + } + } + + /** + * @tc.number contact_insert_test_800 + * @tc.name Insert contact details (phone ringtone) + * @tc.desc Function test + */ + it("contact_insert_test_800", 0, async function (done) { + console.info("------logMessage contact_insert_test_800 is starting!-----"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + var insertRawContactValues = { + "display_name": "xiaocheng", + }; + try { + var rawContactId = await DAHelper.insert(rawContactUri, insertRawContactValues); + console.info("logMessage contact_insert_test_800: rawContactId = " + rawContactId); + expect(rawContactId > 0).assertTrue(); + await dataMiscInsert(DAHelper, rawContactId); + await deleteRawContact("contact_insert_test_800"); + await deleteAll(contactDataUri, "contact_insert_test_800"); + done(); + } catch (error) { + console.info("logMessage contact_insert_test_800: raw_contact insert error = " + error); + done(); + } + }); + + async function dataMiscInsert(DAHelper, rawContactId) { + var contactDataValues1 = { + "raw_contact_id": rawContactId, + "content_type": "contact_misc", + "detail_info": "1234" + }; + try { + var contactDataId1 = await DAHelper.insert(contactDataUri, contactDataValues1); + sleep(1000); + console.info("logMessage contact_insert_test_800: contactDataId1 " + contactDataId1); + expect(contactDataId1 > 0).assertTrue(); + var map = new Map(); + map.set("id", contactDataId1.toString()); + map.set("detail_info", "1234"); + await contactsQuery(map, "contact_insert_test_800_1", contactDataUri); + } catch (error) { + console.info("logMessage contact_insert_test_800: contact_data misc insert error = " + error); + } + } + + /** + * @tc.number contact_update_test_900 + * @tc.name Update contact data + * @tc.desc Function test + */ + it("contact_update_test_900", 0, async function (done) { + console.info("------logMessage contact_update_test_900 is starting!-----"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + var insertRawContactValues = { + "display_name": "licheng", + "company": "TT", + "position": "developer", + "favorite": 1, + "phonetic_name": "licheng||lc" + }; + try { + var rawContactId = await DAHelper.insert(rawContactUri, insertRawContactValues); + console.info("logMessage contact_update_test_900: rawContactId = " + rawContactId); + expect(rawContactId > 0).assertTrue(); + await rawContactUpdate(DAHelper, rawContactId); + await deleteRawContact("contact_update_test_900"); + await deleteAll(contactDataUri, "contact_update_test_900"); + done(); + } catch (error) { + console.info("logMessage contact_update_test_900: raw_contact insert error = " + error); + done(); + } + }); + + async function rawContactUpdate(DAHelper, rawContactId) { + var updateValues = { + "display_name": "dacheng", + "company": "oo", + "position": "Testers", + "favorite": 0, + "phonetic_name": "dacheng||dc" + }; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("id", rawContactId.toString()); + try { + var updateCode = await DAHelper.update(rawContactUri, updateValues, condition); + sleep(1000); + console.info('logMessage contact_update_test_900: updateCode = ' + updateCode); + expect(updateCode == 0).assertTrue(); + var map = new Map(); + map.set("id", rawContactId.toString()); + map.set("display_name", "dacheng"); + map.set("company", "oo"); + map.set("position", "Testers"); + map.set("favorite", "0"); + map.set("phonetic_name", "dacheng||dc"); + await contactsQuery(map, "contact_update_test_900", rawContactUri); + } catch (error) { + console.info('logMessage contact_update_test_900: raw_contact update error = ' + error); + } + } + + /** + * @tc.number contact_update_test_1200 + * @tc.name Update contact details (name) + * @tc.desc Function test + */ + it("contact_update_test_1200", 0, async function (done) { + console.info("------logMessage contact_update_test_1200 is starting!-----"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + var insertRawContactValues = { + "display_name": "xiaoyuan" + }; + try { + var rawContactId = await DAHelper.insert(rawContactUri, insertRawContactValues); + console.info("logMessage contact_update_test_1200: rawContactId = " + rawContactId); + expect(rawContactId > 0).assertTrue(); + await beforedataNameInsert(DAHelper, rawContactId); + await dataNameUpdate(DAHelper, rawContactId); + await deleteRawContact("contact_update_test_1200"); + await deleteAll(contactDataUri, "contact_update_test_1200"); + done(); + } catch (error) { + console.info('logMessage contact_update_test_1200: raw_contact insert error = ' + error); + done(); + } + }); + + async function beforedataNameInsert(DAHelper, rawContactId) { + var contactDataValues = { + "raw_contact_id": rawContactId, "content_type": "name", "detail_info": "xiaoyuan" + }; + try { + var contactDataId = await DAHelper.insert(contactDataUri, contactDataValues); + sleep(1000); + console.info('logMessage contact_update_test_1200: contactDataId = ' + contactDataId); + expect(contactDataId > 0).assertTrue(); + } catch (error) { + console.info('logMessage contact_update_test_1200: contact_data insert error = ' + error); + } + } + + async function dataNameUpdate(DAHelper, rawContactId) { + var updateValues = { + "detail_info": "dayuan" + }; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("raw_contact_id", rawContactId.toString()); + try { + var updateCode = await DAHelper.update(contactDataUri, updateValues, condition); + sleep(1000); + console.info('logMessage contact_update_test_1200: updateCode = ' + updateCode); + expect(updateCode == 0).assertTrue(); + var map = new Map(); + map.set("id", rawContactId.toString()); + map.set("display_name", "dayuan"); + await contactsQuery(map, "contact_update_test_1200", rawContactUri); + } catch (error) { + console.info('logMessage contact_update_test_1200: contact_data update error = ' + error); + } + } + + /** + * @tc.number contact_update_test_1300 + * @tc.name Update contact details (company, position) + * @tc.desc Function test + */ + it("contact_update_test_1300", 0, async function (done) { + console.info("------logMessage contact_update_test_1300 is starting!-----"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + var insertRawContactValues = { + "display_name": "xiaoyuan" + }; + try { + var rawContactId = await DAHelper.insert(rawContactUri, insertRawContactValues); + console.info("logMessage contact_update_test_1300: rawContactId = " + rawContactId); + expect(rawContactId > 0).assertTrue(); + await beforedataCompanyInsert(DAHelper, rawContactId); + await dataCompanyUpdate(DAHelper, rawContactId); + await deleteRawContact("contact_update_test_1300"); + await deleteAll(contactDataUri, "contact_update_test_1300"); + done(); + } catch (error) { + console.info('logMessage contact_update_test_1300: raw_contact insert error = ' + error); + done(); + } + }); + + async function beforedataCompanyInsert(DAHelper, rawContactId) { + var contactDataValues = { + "raw_contact_id": rawContactId, + "content_type": "organization", + "detail_info": "TT", + "position": "Testers", + }; + try { + var contactDataId = await DAHelper.insert(contactDataUri, contactDataValues); + sleep(1000); + console.info('logMessage contact_update_test_1300: contactDataId = ' + contactDataId); + expect(contactDataId > 0).assertTrue(); + } catch (error) { + console.info('logMessage contact_update_test_1300: contact_data insert error = ' + error); + } + } + + async function dataCompanyUpdate(DAHelper, rawContactId) { + var updateValues = { + "detail_info": "OOOO", "position": "developer" + }; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("raw_contact_id", rawContactId.toString()); + try { + var updateCode = await DAHelper.update(contactDataUri, updateValues, condition); + sleep(1000); + console.info('logMessage contact_update_test_1300: updateCode = ' + updateCode); + expect(updateCode == 0).assertTrue(); + var map = new Map(); + map.set("id", rawContactId.toString()); + map.set("company", "OOOO"); + map.set("position", "developer"); + await contactsQuery(map, "contact_update_test_1300", rawContactUri); + } catch (error) { + console.info('logMessage contact_update_test_1300: contact_data update error = ' + error); + } + } + + /** + * @tc.number contact_update_test_1400 + * @tc.name Update contact details (mobile phone number) + * @tc.desc Function test + */ + it("contact_update_test_1400", 0, async function (done) { + console.info("------logMessage contact_update_test_1400 is starting!-----"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + var insertRawContactValues = { + "display_name": "xiaoyuan" + }; + try { + var rawContactId = await DAHelper.insert(rawContactUri, insertRawContactValues); + console.info("logMessage contact_update_test_1400: rawContactId = " + rawContactId); + expect(rawContactId > 0).assertTrue(); + await beforeDataPhoneInsert(DAHelper, rawContactId); + await dataPhoneUpdate(DAHelper, rawContactId); + await deleteRawContact("contact_update_test_1400"); + await deleteAll(contactDataUri, "contact_update_test_1400"); + done(); + } catch (error) { + console.info('logMessage contact_update_test_1400: raw_contact insert error = ' + error); + done(); + } + }); + + async function beforeDataPhoneInsert(DAHelper, rawContactId) { + var contactDataValues = { + "raw_contact_id": rawContactId, "content_type": "phone", "detail_info": "123456" + }; + try { + var contactDataId = await DAHelper.insert(contactDataUri, contactDataValues); + sleep(1000); + console.info('logMessage contact_update_test_1400: contactDataId = ' + contactDataId); + expect(contactDataId > 0).assertTrue(); + } catch (error) { + console.info('logMessage contact_update_test_1400: contact_data insert error = ' + error); + } + } + + async function dataPhoneUpdate(DAHelper, rawContactId) { + var updateValues = { + "detail_info": "99663355" + }; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("raw_contact_id", rawContactId.toString()); + try { + var updateCode = await DAHelper.update(contactDataUri, updateValues, condition); + sleep(1000); + console.info('logMessage contact_update_test_1400: updateCode = ' + updateCode); + expect(updateCode == 0).assertTrue(); + var map = new Map(); + map.set("id", contactDataId.toString()); + map.set("detail_info", "99663355"); + await contactsQuery(map, "contact_update_test_1400", contactDataUri); + } catch (error) { + console.info('logMessage contact_update_test_1400: contact_data update error = ' + error); + } + } + + /** + * @tc.number contact_update_test_1500 + * @tc.name Update contact details (nickname) + * @tc.desc Function test + */ + it("contact_update_test_1500", 0, async function (done) { + console.info("------logMessage contact_update_test_1500 is starting!-----"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + var insertRawContactValues = { + "display_name": "xiaoyuan" + }; + try { + var rawContactId = await DAHelper.insert(rawContactUri, insertRawContactValues); + console.info("logMessage contact_update_test_1500: rawContactId = " + rawContactId); + expect(rawContactId > 0).assertTrue(); + await beforedataNickNameInsert(DAHelper, rawContactId); + await dataNickNameUpdate(DAHelper, rawContactId); + await deleteRawContact("contact_update_test_1500"); + await deleteAll(contactDataUri, "contact_update_test_1500"); + done(); + } catch (error) { + console.info('logMessage contact_update_test_1500: raw_contact insert error = ' + error); + done(); + } + }); + + async function beforedataNickNameInsert(DAHelper, rawContactId) { + var contactDataValues = { + "raw_contact_id": rawContactId, + "content_type": "nickname", + "detail_info": "xiaoyuan" + }; + try { + var contactDataId = await DAHelper.insert(contactDataUri, contactDataValues); + sleep(1000); + console.info('logMessage contact_update_test_1500: contactDataId = ' + contactDataId); + expect(contactDataId > 0).assertTrue(); + } catch (error) { + console.info('logMessage contact_update_test_1500: contact_data insert error = ' + error); + } + } + + async function dataNickNameUpdate(DAHelper, rawContactId) { + var updateValues = { + "detail_info": "fengyuan" + }; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("raw_contact_id", rawContactId.toString()); + try { + var updateCode = await DAHelper.update(contactDataUri, updateValues, condition); + sleep(1000); + console.info('logMessage contact_update_test_1500: updateCode = ' + updateCode); + expect(updateCode == 0).assertTrue(); + var map = new Map(); + map.set("id", contactDataId.toString()); + map.set("detail_info", "fengyuan"); + await contactsQuery(map, "contact_update_test_1500", contactDataUri); + } catch (error) { + console.info('logMessage contact_update_test_1500: contact_data update error = ' + error); + } + } + + /** + * @tc.number contact_update_test_1600 + * @tc.name Update contact details (email) + * @tc.desc Function test + */ + it("contact_update_test_1600", 0, async function (done) { + console.info("------logMessage contact_update_test_1600 is starting!-----"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + var insertRawContactValues = { + "display_name": "xiaoyuan" + }; + try { + var rawContactId = await DAHelper.insert(rawContactUri, insertRawContactValues); + console.info("logMessage contact_update_test_1600: rawContactId = " + rawContactId); + expect(rawContactId > 0).assertTrue(); + await beforeDataEmailInsert(DAHelper, rawContactId); + await dataEmailUpdate(DAHelper, rawContactId); + await deleteRawContact("contact_update_test_1600"); + await deleteAll(contactDataUri, "contact_update_test_1600"); + done(); + } catch (error) { + console.info("logMessage contact_update_test_1600: raw_contact insert error = " + error); + done(); + } + }); + + async function beforeDataEmailInsert(DAHelper, rawContactId) { + var contactDataValues = { + "raw_contact_id": rawContactId, + "content_type": "email", + "detail_info": "166@163.com" + }; + try { + var contactDataId = await DAHelper.insert(contactDataUri, contactDataValues); + sleep(1000); + console.info('logMessage contact_update_test_1600: contactDataId = ' + contactDataId); + expect(contactDataId > 0).assertTrue(); + } catch (error) { + console.info('logMessage contact_update_test_1600: contact_data insert error = ' + error); + } + } + + async function dataEmailUpdate(DAHelper, rawContactId) { + var updateValues = { + "detail_info": "199@163.com" + }; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("raw_contact_id", rawContactId.toString()); + try { + var updateCode = await DAHelper.update(contactDataUri, updateValues, condition) + sleep(1000); + console.info('logMessage contact_update_test_1600: updateCode = ' + updateCode); + expect(updateCode == 0).assertTrue(); + var map = new Map(); + map.set("id", contactDataId.toString()); + map.set("detail_info", "199@163.com"); + await contactsQuery(map, "contact_update_test_1600", contactDataUri); + } catch (error) { + console.info('logMessage contact_update_test_1600: update error = ' + error); + } + } + + /** + * @tc.number contact_update_test_1700 + * @tc.name Update Contact Details (Residential) + * @tc.desc Function test + */ + it("contact_update_test_1700", 0, async function (done) { + console.info("------logMessage contact_update_test_1700 is starting!-----"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + var insertRawContactValues = { + "display_name": "xiaoyuan" + }; + try { + var rawContactId = await DAHelper.insert(rawContactUri, insertRawContactValues); + console.info("logMessage contact_update_test_1700: rawContactId = " + rawContactId); + expect(rawContactId > 0).assertTrue(); + await beforeDataPostalInsert(DAHelper, rawContactId); + await dataPostalUpdate(); + await deleteRawContact("contact_update_test_1700"); + await deleteAll(contactDataUri, "contact_update_test_1700"); + done(); + } catch (error) { + console.info("logMessage contact_update_test_1700: raw_contact insert error = " + error); + done(); + } + }); + + async function beforeDataPostalInsert(DAHelper, rawContactId) { + var contactDataValues = { + "raw_contact_id": rawContactId, + "content_type": "postal_address", + "detail_info": "NanJing" + }; + try { + var contactDataId = await DAHelper.insert(contactDataUri, contactDataValues); + sleep(1000); + console.info('logMessage contact_update_test_1700: contactDataId = ' + contactDataId); + expect(contactDataId > 0).assertTrue(); + } catch (error) { + console.info("logMessage contact_update_test_1700: contact_data insert error = " + error); + } + } + + async function dataPostalUpdate(DAHelper, rawContactId) { + var updateValues = { + "detail_info": "BeiJing" + }; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("raw_contact_id", rawContactId.toString()); + try { + var updateCode = await DAHelper.update(contactDataUri, updateValues, condition); + sleep(1000); + console.info('logMessage contact_update_test_1700: updateCode = ' + updateCode); + expect(updateCode == 0).assertTrue(); + var map = new Map(); + map.set("id", contactDataId.toString()); + map.set("detail_info", "BeiJing"); + await contactsQuery(map, "contact_update_test_1700", contactDataUri); + } catch (error) { + console.info('logMessage contact_update_test_1700: update error = ' + error); + } + } + + /** + * @tc.number contact_update_test_1800 + * @tc.name Update contact details (remarks) + * @tc.desc Function test + */ + it("contact_update_test_1800", 0, async function (done) { + console.info("------logMessage contact_update_test_1800 is starting!-----"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + var insertRawContactValues = { + "display_name": "xiaoyuan" + }; + try { + var rawContactId = await DAHelper.insert(rawContactUri, insertRawContactValues); + console.info("logMessage contact_update_test_1800: rawContactId = " + rawContactId); + expect(rawContactId > 0).assertTrue(); + await beforedataNoteInsert(DAHelper, rawContactId); + await dataNoteUpdate(DAHelper, rawContactId); + await deleteRawContact("contact_update_test_1800"); + await deleteAll(contactDataUri, "contact_update_test_1800"); + done(); + } catch (error) { + console.info("logMessage contact_update_test_1800: raw_contact insert error = " + error); + done(); + } + }); + + async function beforedataNoteInsert(DAHelper, rawContactId) { + var contactDataValues = { + "raw_contact_id": rawContactId, "content_type": "note", "detail_info": "Gangster" + }; + try { + var contactDataId = await DAHelper.insert(contactDataUri, contactDataValues); + sleep(1000); + console.info('logMessage contact_update_test_1800: contactDataId = ' + contactDataId); + expect(contactDataId > 0).assertTrue(); + } catch (error) { + console.info('logMessage contact_update_test_1800: contact_data insert error = ' + error); + } + } + + async function dataNoteUpdate(DAHelper, rawContactId) { + var updateValues = { + "detail_info": "God" + }; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("raw_contact_id", rawContactId.toString()); + try { + var updateCode = await DAHelper.update(contactDataUri, updateValues, condition); + sleep(1000); + console.info('logMessage contact_update_test_1800: updateCode = ' + updateCode); + expect(updateCode == 0).assertTrue(); + var map = new Map(); + map.set("id", contactDataId.toString()); + map.set("detail_info", "God"); + await contactsQuery(map, "contact_update_test_1800", contactDataUri); + } catch (error) { + console.info('logMessage contact_update_test_1800: update error = ' + error); + } + } + + /** + * @tc.number contact_update_test_1900 + * @tc.name Update Contact Details (AIM) + * @tc.desc Function test + */ + it("contact_update_test_1900", 0, async function (done) { + console.info("------logMessage contact_update_test_1900 is starting!-----"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + var insertRawContactValues = { + "display_name": "xiaoyuan" + }; + try { + var rawContactId = await DAHelper.insert(rawContactUri, insertRawContactValues) + console.info("logMessage contact_update_test_1900: rawContactId = " + rawContactId); + expect(rawContactId > 0).assertTrue(); + await beforeDataAimInsert(DAHelper, rawContactId); + await dataAimUpdate(DAHelper, rawContactId); + await deleteRawContact("contact_update_test_1900"); + await deleteAll(contactDataUri, "contact_update_test_1900"); + done(); + } catch (error) { + console.info("logMessage contact_update_test_1900: raw_contact insert error = " + error); + done(); + } + }); + + async function beforeDataAimInsert(DAHelper, rawContactId) { + var contactDataValues = { + "raw_contact_id": rawContactId, "content_type": "im", "detail_info": "aaaaa" + }; + try { + var contactDataId = await DAHelper.insert(contactDataUri, contactDataValues); + sleep(1000); + console.info('logMessage contact_update_test_1900: contactDataId = ' + contactDataId); + expect(contactDataId > 0).assertTrue(); + } catch (error) { + console.info("logMessage contact_update_test_1900: contact_data insert error = " + error); + } + } + + async function dataAimUpdate(DAHelper, rawContactId) { + var updateValues = { + "detail_info": "bbbbb" + }; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("raw_contact_id", rawContactId.toString()); + try { + var updateCode = await DAHelper.update(contactDataUri, updateValues, condition); + sleep(1000); + console.info('logMessage contact_update_test_1900: updateCode = ' + updateCode); + expect(updateCode == 0).assertTrue(); + var map = new Map(); + map.set("id", contactDataId.toString()); + map.set("detail_info", "bbbbb"); + await contactsQuery(map, "contact_update_test_1900", contactDataUri); + } catch (error) { + console.info('logMessage contact_update_test_1900: update error = ' + error); + } + } + + /** + * @tc.number contact_update_test_2000 + * @tc.name Update Contact Details (Birthday) + * @tc.desc Function test + */ + it("contact_update_test_2000", 0, async function (done) { + console.info("------logMessage contact_update_test_2000 is starting!-----"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + var insertRawContactValues = { + "display_name": "xiaoyuan" + }; + try { + var rawContactId = await DAHelper.insert(rawContactUri, insertRawContactValues); + console.info("logMessage contact_update_test_2000: rawContactId = " + rawContactId); + expect(rawContactId > 0).assertTrue(); + await beforeDataEventInsert(DAHelper, rawContactId); + await dataEventUpdate(DAHelper, rawContactId); + await deleteRawContact("contact_update_test_2000"); + await deleteAll(contactDataUri, "contact_update_test_2000"); + done(); + } catch (error) { + console.info("logMessage contact_update_test_2000: raw_contact insert error = " + error); + done(); + } + }); + + async function beforeDataEventInsert(DAHelper, rawContactId) { + var contactDataValues1 = { + "raw_contact_id": rawContactId, + "content_type": "contact_event", + "detail_info": "19960229" + }; + try { + var contactDataId = await DAHelper.insert(contactDataUri, contactDataValues1); + sleep(1000); + console.info('logMessage contact_update_test_2000: contactDataId = ' + contactDataId); + expect(contactDataId > 0).assertTrue(); + } catch (error) { + console.info('logMessage contact_update_test_2000: contact_data insert error = ' + error); + } + } + + async function dataEventUpdate(DAHelper, rawContactId) { + var updateValues = { + "detail_info": "19971021" + }; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("raw_contact_id", rawContactId.toString()); + try { + var updateCode = await DAHelper.update(contactDataUri, updateValues, condition); + sleep(1000); + console.info('logMessage contact_update_test_2000: updateCode = ' + updateCode); + expect(updateCode == 0).assertTrue(); + var map = new Map(); + map.set("id", contactDataId.toString()); + map.set("detail_info", "19971021"); + await contactsQuery(map, "contact_update_test_2000", contactDataUri); + } catch (error) { + console.info('logMessage contact_update_test_2000: update error = ' + error); + } + } + + /** + * @tc.number contact_update_test_2100 + * @tc.name Update contact details (website) + * @tc.desc Function test + */ + it("contact_update_test_2100", 0, async function (done) { + console.info("------logMessage contact_update_test_2100 is starting!-----"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + var insertRawContactValues = { + "display_name": "xiaoyuan" + }; + try { + var rawContactId = await DAHelper.insert(rawContactUri, insertRawContactValues); + console.info("logMessage contact_update_test_2100: rawContactId = " + rawContactId); + expect(rawContactId > 0).assertTrue(); + await beforeDataWebsiteInsert(DAHelper, rawContactId); + await dataWebsiteUpdate(DAHelper, rawContactId); + await deleteRawContact("contact_update_test_2100"); + await deleteAll(contactDataUri, "contact_update_test_2100"); + done(); + } catch (error) { + console.info("logMessage contact_update_test_2100: raw_contact insert error = " + error); + done(); + } + }); + + async function beforeDataWebsiteInsert(DAHelper, rawContactId) { + var contactDataValues1 = { + "raw_contact_id": rawContactId, + "content_type": "website", + "detail_info": "www.com" + }; + try { + var contactDataId = await DAHelper.insert(contactDataUri, contactDataValues1); + sleep(1000); + console.info('logMessage contact_update_test_2100: contactDataId = ' + contactDataId); + expect(contactDataId > 0).assertTrue(); + } catch (error) { + console.info('logMessage contact_update_test_2100: contact_data insert error = ' + error); + } + } + + async function dataWebsiteUpdate(DAHelper, rawContactId) { + var updateValues = { + "detail_info": "www.123.com" + }; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("raw_contact_id", rawContactId.toString()); + try { + var updateCode = await DAHelper.update(contactDataUri, updateValues, condition); + sleep(1000); + console.info('logMessage contact_update_test_2100: updateCode = ' + updateCode); + expect(updateCode == 0).assertTrue(); + var map = new Map(); + map.set("id", contactDataId.toString()); + map.set("detail_info", "www.123.com"); + await contactsQuery(map, "contact_update_test_2100", contactDataUri); + } catch (error) { + console.info('logMessage contact_update_test_2100: update error = ' + error); + } + } + + /** + * @tc.number contact_update_test_2200 + * @tc.name Update contact details (assistant) + * @tc.desc Function test + */ + it("contact_update_test_2200", 0, async function (done) { + console.info("------logMessage contact_update_test_2200 is starting!-----"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + var insertRawContactValues = { + "display_name": "xiaoyuan" + }; + try { + var rawContactId = await DAHelper.insert(rawContactUri, insertRawContactValues); + console.info("logMessage contact_update_test_2200: rawContactId = " + rawContactId); + expect(rawContactId > 0).assertTrue(); + await beforeDataRelationInsert(DAHelper, rawContactId); + await dataRelationUpdate(DAHelper, rawContactId); + await deleteRawContact("contact_update_test_2200"); + await deleteAll(contactDataUri, "contact_update_test_2200"); + done(); + } catch (error) { + console.info("logMessage contact_update_test_2200: raw_contact insert error = " + error); + done(); + } + }); + + async function beforeDataRelationInsert(DAHelper, rawContactId) { + var contactDataValues = { + "raw_contact_id": rawContactId, + "content_type": "relation", + "detail_info": "Secretary" + }; + try { + var contactDataId = await DAHelper.insert(contactDataUri, contactDataValues); + console.info('logMessage contact_update_test_2200: contactDataId = ' + contactDataId); + expect(contactDataId > 0).assertTrue(); + } catch (error) { + console.info('logMessage contact_update_test_2200: contact_data insert error = ' + error); + } + } + + async function dataRelationUpdate(DAHelper, rawContactId) { + var updateValues = { + "detail_info": "spouse" + }; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("raw_contact_id", rawContactId.toString()); + try { + var updateCode = await DAHelper.update(contactDataUri, updateValues, condition); + sleep(1000); + console.info('logMessage contact_update_test_2200: updateCode = ' + updateCode); + expect(updateCode == 0).assertTrue(); + var map = new Map(); + map.set("id", contactDataId.toString()); + map.set("detail_info", "spouse"); + await contactsQuery(map, "contact_update_test_2200", contactDataUri); + } catch (error) { + console.info('logMessage contact_update_test_2200: update error = ' + error); + } + } + + /** + * @tc.number contact_update_test_2300 + * @tc.name Update contact detail data table (group) + * @tc.desc Function test + */ + it("contact_update_test_2300", 0, async function (done) { + console.info("------logMessage contact_update_test_2300 is starting!-----"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + var insertRawContactValues = { + "display_name": "xiaoyuan" + }; + try { + var rawContactId = await DAHelper.insert(rawContactUri, insertRawContactValues); + console.info("logMessage contact_update_test_2300: rawContactId = " + rawContactId); + expect(rawContactId > 0).assertTrue(); + await beforeDataGroupInsert(DAHelper, rawContactId); + await dataGroupUpdate(DAHelper, rawContactId); + await deleteRawContact("contact_update_test_2300"); + await deleteAll(contactDataUri, "contact_update_test_2300"); + done(); + } catch (error) { + console.info("logMessage contact_update_test_2300: raw_contact insert error = " + error); + done(); + } + }); + + async function beforeDataGroupInsert(DAHelper, rawContactId) { + var contactDataValues = { + "raw_contact_id": rawContactId, + "content_type": "group_membership", + "detail_info": "2" + }; + try { + var contactDataId = await DAHelper.insert(contactDataUri, contactDataValues); + sleep(1000); + console.info('logMessage contact_update_test_2300: contactDataId = ' + contactDataId); + expect(contactDataId > 0).assertTrue(); + } catch (error) { + console.info('logMessage contact_update_test_2300: contact_data insert error = ' + error); + } + } + + async function dataGroupUpdate(DAHelper, rawContactId) { + var updateValues = { + "detail_info": "7" + }; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("raw_contact_id", rawContactId.toString()); + try { + var updateCode = await DAHelper.update(contactDataUri, updateValues, condition); + sleep(1000); + console.info('logMessage contact_update_test_2300: updateCode = ' + updateCode); + expect(updateCode == 0).assertTrue(); + var map = new Map(); + map.set("id", contactDataId.toString()); + map.set("detail_info", "3"); + await contactsQuery(map, "contact_update_test_2300", contactDataUri); + } catch (error) { + console.info('logMessage contact_update_test_2300: update error = ' + error); + } + } + + /** + * @tc.number contact_update_test_2400 + * @tc.name Update contact detail data table (phone ringtone) + * @tc.desc Function test + */ + it("contact_update_test_2400", 0, async function (done) { + console.info("------logMessage contact_update_test_2400 is starting!-----"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + var insertRawContactValues = { + "display_name": "xiaoyuan" + }; + try { + var rawContactId = await DAHelper.insert(rawContactUri, insertRawContactValues); + sleep(1000); + console.info("logMessage contact_update_test_2400: rawContactId = " + rawContactId); + expect(rawContactId > 0).assertTrue(); + await beforeDataMiscInsert(DAHelper, rawContactId); + await dataMiscUpdate(DAHelper, rawContactId); + await deleteRawContact("contact_update_test_2400"); + await deleteAll(contactDataUri, "contact_update_test_2400"); + done(); + } catch (error) { + console.info("logMessage contact_update_test_2400: raw_contact insert error = " + error); + done(); + } + }); + + async function beforeDataMiscInsert(DAHelper, rawContactId) { + var contactDataValues1 = { + "raw_contact_id": rawContactId, + "content_type": "contact_misc", + "detail_info": "1234" + }; + try { + var contactDataId = await DAHelper.insert(contactDataUri, contactDataValues1); + sleep(1000); + console.info('logMessage contact_update_test_2400: contactDataId = ' + contactDataId); + expect(contactDataId > 0).assertTrue(); + } catch (error) { + console.info('logMessage contact_update_test_2400: contact_data insert error = ' + error); + } + } + + async function dataMiscUpdate(DAHelper, rawContactId) { + var updateValues = { + "detail_info": "999" + }; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("raw_contact_id", rawContactId.toString()); + try { + var updateCode = await DAHelper.update(contactDataUri, updateValues, condition); + sleep(1000); + console.info('logMessage contact_update_test_2400: updateCode = ' + updateCode); + expect(updateCode == 0).assertTrue(); + var map = new Map(); + map.set("id", contactDataId.toString()); + map.set("detail_info", "999"); + await contactsQuery(map, "contact_update_test_2300", contactDataUri); + } catch (error) { + console.info('logMessage contact_update_test_2400: update error = ' + error); + } + } + + /** + * @tc.number contact_favorite_test_2500 + * @tc.name Favorite contacts + * @tc.desc Function test + */ + it("contact_favorite_test_2500", 0, async function (done) { + console.info("-------logMessage contact_favorite_test_2500 is starting!------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + var rawContactValues = { + "display_name": "xiaocai", "company": "TT", "position": "Testers" + }; + try { + var rawContactId = await DAHelper.insert(rawContactUri, rawContactValues) + console.info('logMessage contact_favorite_test_2500: rawContactId = ' + rawContactId); + expect(rawContactId > 0).assertTrue(); + await updateFavorite(DAHelper, rawContactId); + await deleteRawContact("contact_favorite_test_2500"); + done(); + } catch (error) { + console.info('logMessage contact_favorite_test_2500: raw_contact insert error = ' + error); + done(); + } + }); + + async function updateFavorite(DAHelper, rawContactId) { + var updateValues = { + "favorite": 1 + }; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("id", rawContactId.toString()); + try { + var updateCode = await DAHelper.update(rawContactUri, updateValues, condition); + sleep(1000); + console.info("logMessage contact_favorite_test_2500: updateCode = " + updateCode); + expect(updateCode == 0).assertTrue(); + var map = new Map(); + map.set("id", rawContactId.toString()); + map.set("display_name", "xiaocai"); + map.set("company", "TT"); + map.set("position", "Testers"); + map.set("favorite", "1"); + await contactsQuery(map, "contact_favorite_test_2500", rawContactUri); + } catch (error) { + console.info('logMessage contact_favorite_test_2500: update error = ' + error); + } + } + + /** + * @tc.number contact_unfavorite_test_2600 + * @tc.name Unfavorite contacts + * @tc.desc Function test + */ + it("contact_unfavorite_test_2600", 0, async function (done) { + console.info("-------logMessage contact_unfavorite_test_2600 is starting!------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + var rawContactValues = { + "display_name": "xiaohong", "company": "TT", "position": "Testers", "favorite": 1 + }; + try { + var rawContactId = await DAHelper.insert(rawContactUri, rawContactValues); + console.info('logMessage contact_unfavorite_test_2600: rawContactId = ' + rawContactId); + expect(rawContactId > 0).assertTrue(); + await updateUnFavorite(DAHelper, rawContactId); + await deleteRawContact("contact_unfavorite_test_2600"); + done(); + } catch (error) { + console.info('logMessage contact_unfavorite_test_2600: raw_contact insert error = ' + error); + done(); + } + }); + + async function updateUnFavorite(DAHelper, rawContactId) { + var updateValues = { + "favorite": 0 + }; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("id", rawContactId.toString()); + try { + var updateCode = await DAHelper.update(rawContactUri, updateValues, condition); + sleep(1000); + console.info("logMessage contact_unfavorite_test_2600: updateCode = " + updateCode); + expect(updateCode == 0).assertTrue(); + var map = new Map(); + map.set("id", rawContactId.toString()); + map.set("display_name", "xiaohong"); + map.set("company", "TT"); + map.set("position", "Testers"); + map.set("favorite", "0"); + await contactsQuery(map, "contact_favorite_test_2500", rawContactUri); + } catch (error) { + console.info("logMessage contact_unfavorite_test_2600: update error = " + error); + } + } + + /** + * @tc.number contact_insert_test_2700 + * @tc.name Insert contact black list + * @tc.desc Function test + */ + it("contact_insert_test_2700", 0, async function (done) { + console.info("-------logMessage contact_insert_test_2700 is starting!------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + try { + var blocklistId = await DAHelper.insert(contactBlocklistUri, common.getProfileBlockList()); + sleep(1000); + console.info('logMessage contact_insert_test_2700: blocklistId = ' + blocklistId); + expect(blocklistId > 0).assertTrue(); + var map = common.getProfileBlockListMap(); + map.set("id", blocklistId.toString()); + await contactsQuery(map, "contact_insert_test_2700", contactBlocklistUri); + await deleteAll(contactBlocklistUri, "contact_insert_test_2700"); + done(); + } catch (error) { + console.info('logMessage contact_insert_test_2700: blocklist insert error = ' + error); + done(); + } + }); + + /** + * @tc.number contact_delete_test_2800 + * @tc.name Delete contact black list + * @tc.desc Function test + */ + it("contact_delete_test_2800", 0, async function (done) { + console.info("-------logMessage contact_delete_test_2800 is starting!------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + try { + var blocklistId = await DAHelper.insert(contactBlocklistUri, common.getProfileBlockList()); + sleep(1000); + console.info('logMessage contact_delete_test_2800: blocklistId = ' + blocklistId); + expect(blocklistId > 0).assertTrue(); + await blocklistDelete(); + done(); + } catch (error) { + console.info('logMessage contact_delete_test_2800: blocklist insert error = ' + error); + done(); + } + + async function blocklistDelete() { + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("id", blocklistId.toString()); + try { + var deleteCode = await DAHelper.delete(contactBlocklistUri, condition); + sleep(1000); + console.info("logMessage contact_delete_test_2800: deleteCode = " + deleteCode); + expect(deleteCode == 0).assertTrue(); + var map = new Map(); + map.set("id", blocklistId.toString()); + await queryIdForDelete(map, "contact_delete_test_2800", contactBlocklistUri); + } catch (error) { + console.info('logMessage contact_delete_test_2800: delete error = ' + error); + done(); + } + } + }); + + /** + * @tc.number contact_insert_test_2900 + * @tc.name Insert contact group + * @tc.desc Function test + */ + it("contact_insert_test_2900", 0, async function (done) { + console.info("-------logMessage contact_insert_test_2900 is starting!-------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + var groupValues = { + "group_name": "TestersThird" + }; + try { + var groupId = await DAHelper.insert(groupUri, groupValues); + sleep(1000); + console.info("logMessage contact_insert_test_2900: groupId =" + groupId); + expect(groupId > 0).assertTrue(); + await groupRawContactInsert(DAHelper); + await deleteRawContact("contact_insert_test_2900"); + await deleteAll(groupUri, "contact_insert_test_2900"); + await deleteAll(contactDataUri, "contact_insert_test_2900"); + done(); + } catch (error) { + console.info("logMessage contact_insert_test_2900: group insert error =" + error); + done(); + } + }); + + async function groupRawContactInsert(DAHelper) { + var rawContactValues = { + "display_name": "liyu" + }; + try { + var rawContactId = await DAHelper.insert(rawContactUri, rawContactValues); + sleep(1000); + console.info("logMessage contact_insert_test_2900: rawContactId =" + rawContactId); + expect(rawContactId > 0).assertTrue(); + await groupDataInsert(DAHelper, rawContactId); + } catch (error) { + console.info("logMessage contact_insert_test_2900: raw_contact insert error =" + error); + } + } + + async function groupDataInsert(DAHelper, rawContactId) { + var contactDataValues = { + "raw_contact_id": rawContactId, + "content_type": "group_membership", + "detail_info": groupId.toString() + }; + try { + var contactDataId = await DAHelper.insert(contactDataUri, contactDataValues) + sleep(1000); + console.info("logMessage contact_insert_test_2900: contactDataId =" + contactDataId); + expect(contactDataId > 0).assertTrue(); + var map = new Map(); + map.set("id", contactDataId); + map.set("raw_contact_id", rawContactId.toString()); + map.set("detail_info", groupId.toString()); + await contactsQuery(map, "contact_insert_test_2900", contactDataUri); + } catch (error) { + console.info("logMessage contact_insert_test_2900: contact_data insert error =" + error); + } + } + + /** + * @tc.number contact_delete_test_3000 + * @tc.name Delete contact group + * @tc.desc Function test + */ + it("contact_delete_test_3000", 0, async function (done) { + console.info("-------logMessage contact_delete_test_3000 is starting!-------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + var groupValues = { + "group_name": "TestersFourth" + }; + try { + var groupId = await DAHelper.insert(groupUri, groupValues); + sleep(1000); + console.info("logMessage contact_delete_test_3000: groupId =" + groupId); + expect(groupId > 0).assertTrue(); + await groupAfterRawContactInsert(DAHelper); + await deleteRawContact("contact_delete_test_3000"); + await deleteAll(groupUri, "contact_delete_test_3000"); + await deleteAll(contactDataUri, "contact_delete_test_3000"); + done(); + } catch (error) { + console.info("logMessage contact_delete_test_3000: group insert error =" + error); + done(); + } + }); + + async function groupAfterRawContactInsert(DAHelper) { + var rawContactValues = { + "display_name": "liyuchen" + }; + try { + var rawContactId = await DAHelper.insert(rawContactUri, rawContactValues); + sleep(1000); + console.info("logMessage contact_delete_test_3000: rawContactId =" + rawContactId); + expect(rawContactId > 0).assertTrue(); + await deleteGroupContactDataInsert(DAHelper, rawContactId); + } catch (error) { + console.info("logMessage contact_delete_test_3000: raw_contact insert error =" + error); + } + } + + async function deleteGroupContactDataInsert(DAHelper, rawContactId) { + var contactDataValues = { + "raw_contact_id": rawContactId, + "content_type": "group_membership", + "detail_info": groupId.toString() + }; + try { + var contactDataId = await DAHelper.insert(contactDataUri, contactDataValues); + console.info("logMessage contact_delete_test_3000: contactDataId =" + contactDataId); + expect(contactDataId > 0).assertTrue(); + await deleteGroup(DAHelper, contactDataId); + } catch (error) { + console.info("logMessage contact_delete_test_3000: contact_data insert error =" + error); + } + } + + async function deleteGroup(DAHelper, contactDataId) { + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("id", contactDataId.toString()); + try { + var deleteCode = await DAHelper.delete(contactDataUri, condition); + sleep(1000); + console.info("logMessage contact_delete_test_3000: deleteCode =" + deleteCode); + expect(deleteCode == 0).assertTrue(); + var map = new Map(); + map.set("id", contactDataId.toString()); + await queryIdForDelete(map, "contact_delete_test_3000", contactDataUri); + } catch (error) { + console.info("logMessage contact_delete_test_3000: delete error =" + error); + } + } + + /** + * @tc.number contact_query_test_3100 + * @tc.name Query basic information of a single contact + * @tc.desc Function test + */ + it("contact_query_test_3100", 0, async function (done) { + console.info("-----------logMessage contact_query_test_3100 is starting!------------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + var rawContactValues = { + "display_name": "xiaoyu" + }; + try { + var rawContactId = await DAHelper.insert(rawContactUri, rawContactValues); + sleep(1000); + console.info("logMessage contact_query_test_3100: rawContactId = " + rawContactId); + expect(rawContactId > 0).assertTrue(); + await rawContactQuery(DAHelper, rawContactId); + await deleteRawContact("contact_query_test_3100"); + done(); + } catch (error) { + console.info("logMessage contact_query_test_3100: raw_contact insert error = " + error); + done(); + } + }); + + async function rawContactQuery(DAHelper, rawContactId) { + var resultColumns = ["id", "display_name"]; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("id", rawContactId.toString()); + try { + var resultSet = await DAHelper.query(rawContactUri, resultColumns, condition); + sleep(2000); + if (resultSet.goToFirstRow()) { + do { + console.info('logMessage contact_query_test_3100: id = ' + resultSet.getString(0)); + expect(resultSet.getString(0) == rawContactId).assertEqual(true); + console.info('logMessage contact_query_test_3100: displayName = ' + resultSet.getString(1)); + expect(resultSet.getString(1) == "xiaoyu").assertEqual(true); + } while (resultSet.goToNextRow()); + } + resultSet.close(); + } catch (error) { + console.info("logMessage contact_query_test_3100: query error = " + error); + } + } + + /** + * @tc.number contact_query_test_3200 + * @tc.name Query basic information of multiple contacts + * @tc.desc Function test + */ + it("contact_query_test_3200", 0, async function (done) { + console.info("-----------logMessage contact_query_test_3200 is starting!------------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + var rawContactValues1 = { + "display_name": "xiaoyu" + }; + try { + var rawContactIdOne = await DAHelper.insert(rawContactUri, rawContactValues1); + sleep(1000); + console.info("logMessage contact_query_test_3200: rawContactId = " + rawContactIdOne); + expect(rawContactIdOne > 0).assertTrue(); + } catch (error) { + console.info("logMessage contact_query_test_3200: raw_contact_1 insert error = " + error); + done(); + } + + var rawContactValues2 = { + "display_name": "xiaohong" + }; + try { + var rawContactIdTwo = await DAHelper.insert(rawContactUri, rawContactValues2); + sleep(1000); + console.info("logMessage contact_query_test_3200: rawContactId = " + rawContactIdTwo); + expect(rawContactIdTwo > 0).assertTrue(); + await queryTwoRaw(DAHelper, rawContactIdOne, rawContactIdTwo); + await deleteRawContact("contact_query_test_3200"); + done(); + } catch (error) { + console.info("logMessage contact_query_test_3200: raw_contact_2 insert error = " + error); + done(); + } + }); + + async function queryTwoRaw(DAHelper, rawContactIdOne, rawContactIdTwo) { + var resultColumns = ["id", "display_name"]; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("id", rawContactIdOne.toString()); + condition.or(); + condition.equalTo("id", rawContactIdTwo.toString()); + try { + var resultSet = await DAHelper.query(rawContactUri, resultColumns, condition); + sleep(1000); + console.info('logMessage contact_query_test_3200: goToFirstRow' + resultSet.goToFirstRow()); + expect(resultSet.goToFirstRow()).assertEqual(true); + if (resultSet.goToFirstRow()) { + do { + console.info("logMessage contact_query_test_3200: columnNames :" + resultSet.columnNames); + console.info("logMessage contact_query_test_3200: columnCount:" + resultSet.columnCount); + console.info('logMessage contact_query_test_3200: id = ' + resultSet.getString(0)); + console.info('logMessage contact_query_test_3200: displayName = ' + resultSet.getString(1)); + } while (resultSet.goToNextRow()); + } + resultSet.close(); + } catch (error) { + console.info('logMessage contact_query_test_3200: query error' + error); + } + } + + /** + * @tc.number contact_query_test_3300 + * @tc.name Query basic information of all contacts + * @tc.desc Function test + */ + it("contact_query_test_3300", 0, async function (done) { + console.info("-----------logMessage contact_query_test_3300 is starting!------------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + var rawContactValues1 = { + "display_name": "xiaoyu" + }; + try { + var rawContactId = await DAHelper.insert(rawContactUri, rawContactValues1); + sleep(1000); + console.info("logMessage contact_query_test_3300: rawContactId = " + rawContactId); + expect(rawContactId > 0).assertTrue(); + } catch (error) { + console.info("logMessage contact_query_test_3300: raw_contact_1 insert error = " + error); + done(); + } + var resultColumns = ["id", "display_name"]; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.greaterThan("id", "0"); + try { + var resultSet = await DAHelper.query(profileRawContactUri, resultColumns, condition); + sleep(1000); + if (resultSet.goToFirstRow()) { + do { + console.info('logMessage contact_query_test_3300: id = ' + resultSet.getString(0)); + expect(resultSet.getString(0) == rawContactId.toString()).assertEqual(true); + console.info('logMessage contact_query_test_3300: displayName = ' + resultSet.getString(1)); + expect(resultSet.getString(1) == "xiaoyu").assertEqual(true); + } while (resultSet.goToNextRow()); + } + resultSet.close(); + await deleteRawContact("contact_query_test_3300"); + done(); + } catch (error) { + console.info("logMessage contact_query_test_3300: query error = " + error); + done(); + } + }); + + /** + * @tc.number contact_query_test_3400 + * @tc.name Query all information of a single contact + * @tc.desc Function test + */ + it("contact_query_test_3400", 0, async function (done) { + console.info("-----------logMessage contact_query_test_3400 is starting!------------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + var rawContactValues = { + "display_name": "xiaoyuzhou", + "company": "TT", + "position": "Testers", + "favorite": 1, + "phonetic_name": "xiaoyu||xy" + }; + try { + var rawContactId = await DAHelper.insert(rawContactUri, rawContactValues); + sleep(1000); + console.info("logMessage contact_query_test_3400: rawContactId = " + rawContactId); + expect(rawContactId > 0).assertTrue(); + await queryAllInformation(DAHelper, rawContactId); + await deleteRawContact("contact_query_test_3400"); + done(); + } catch (error) { + console.info("logMessage contact_query_test_3400: raw_contact insert error = " + error); + done(); + } + }); + + async function queryAllInformation(DAHelper, rawContactId) { + var resultColumns = []; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("id", rawContactId.toString()); + try { + var resultSet = await DAHelper.query(rawContactUri, resultColumns, condition); + sleep(1000); + if (resultSet.goToFirstRow()) { + do { + var id = resultSet.getString(resultSet.getColumnIndex("id")); + console.info('logMessage contact_query_test_3400: id = ' + id); + expect(id == rawContactId).assertEqual(true); + var favorite = resultSet.getString(resultSet.getColumnIndex("favorite")); + console.info('logMessage contact_query_test_3400: favorite = ' + favorite); + expect(favorite == "1").assertEqual(true); + var phoneticName = resultSet.getString(resultSet.getColumnIndex("phonetic_name")); + console.info('logMessage contact_query_test_3400: phoneticName = ' + phonetic_name); + expect(phoneticName == "xiaoyu||xy").assertEqual(true); + var company = resultSet.getString(resultSet.getColumnIndex("company")); + console.info('logMessage contact_query_test_3400: company = ' + company); + expect(company == "TT").assertEqual(true); + var displayName = resultSet.getString(resultSet.getColumnIndex("display_name")); + console.info('logMessage contact_query_test_3400: displayName = ' + displayName); + expect(displayName == "xiaoyuzhou").assertEqual(true); + } while (resultSet.goToNextRow()); + } + resultSet.close(); + } catch (error) { + console.info('logMessage contact_query_test_3400: query error = ' + error); + } + } + + /** + * @tc.number contact_query_test_3500 + * @tc.name Query group member ability + * @tc.desc Function test + */ + it("contact_query_test_3500", 0, async function (done) { + console.info("-----------logMessage contact_query_test_3500 is starting!------------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + var rawContactValues = { + "display_name": "xiaoyuzhou" + }; + try { + var rawContactId = await DAHelper.insert(rawContactUri, rawContactValues); + sleep(1000); + console.info("logMessage contact_query_test_3500: rawContactId = " + rawContactId); + expect(rawContactId > 0).assertTrue(); + } catch (error) { + console.info("logMessage contact_query_test_3500: raw_contact insert error = " + error); + done(); + } + var groupValues = { + "group_name": "BossBoard3500" + }; + try { + var groupId = await DAHelper.insert(groupUri, groupValues); + sleep(1000); + console.info("logMessage contact_query_test_3500: groupId = " + groupId); + expect(groupId > 0).assertTrue(); + } catch (error) { + console.info("logMessage contact_query_test_3500: group insert error = " + error); + done(); + } + await groupBossBoardInsert(DAHelper, rawContactId, groupId); + await deleteRawContact("contact_query_test_3500"); + await deleteAll(groupUri, "contact_query_test_3500"); + await deleteAll(contactDataUri, "contact_query_test_3500"); + done(); + }); + + async function groupBossBoardInsert(DAHelper, rawContactId, groupId) { + var contactDataValues = { + "raw_contact_id": rawContactId, + "content_type": "group_membership", + "detail_info": groupId.toString() + }; + try { + var contactDataId = await DAHelper.insert(contactDataUri, contactDataValues); + sleep(1000); + console.info("logMessage contact_query_test_3500: contactDataId = " + contactDataId); + expect(contactDataId > 0).assertTrue(); + await groupBossBoardQuery(DAHelper, rawContactId, groupId); + } catch (error) { + console.info("logMessage contact_query_test_3500: query error = " + error); + } + } + + async function groupBossBoardQuery(DAHelper, rawContactId, groupId) { + var resultColumns = ["raw_contact_id", "detail_info"]; + var condition = new ohosDataAbility.DataAbilityPredicates(); + // type_id = 9 data is group + condition.equalTo("type_id", "9"); + condition.and(); + condition.equalTo("detail_info", groupId.toString()); + try { + var resultSet = await DAHelper.query(contactDataUri, resultColumns, condition); + sleep(1000); + if (resultSet.goToFirstRow()) { + do { + console.info('logMessage contact_query_test_3500: raw_contact_id = ' + resultSet.getString(0)); + expect(resultSet.getString(0) == rawContactId).assertEqual(true); + console.info('logMessage contact_query_test_3500: detail_info = ' + resultSet.getString(1)); + expect(resultSet.getString(1) == groupId.toString()).assertEqual(true); + } while (resultSet.goToNextRow()); + } + resultSet.close(); + } catch (error) { + console.info("logMessage contact_query_test_3500: query error :" + error); + } + } + + /** + * @tc.number contact_query_test_3600 + * @tc.name Query favorite contacts + * @tc.desc Function test + */ + it("contact_query_test_3600", 0, async function (done) { + console.info("-----------logMessage contact_query_test_3600 is starting!------------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + var rawContactValues = { + "display_name": "xiaoyuzhou", "favorite": 1 + }; + try { + var rawContactId = await DAHelper.insert(rawContactUri, rawContactValues); + sleep(1000); + console.info("logMessage contact_query_test_3600: rawContactId = " + rawContactId); + expect(rawContactId > 0).assertTrue(); + await queryFavorite(); + await deleteRawContact("contact_query_test_3600"); + done(); + } catch (error) { + console.info("logMessage contact_query_test_3600: raw_contact insert error = " + error); + done(); + } + + async function queryFavorite() { + var resultColumns = ["id", "display_name"]; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("favorite", "1"); + condition.and(); + condition.equalTo("is_deleted", "0"); + try { + var resultSet = await DAHelper.query(rawContactUri, resultColumns, condition); + sleep(1000); + if (resultSet.goToFirstRow()) { + do { + console.info('logMessage contact_query_test_3600: id = ' + resultSet.getString(0)); + expect(resultSet.getString(0) == rawContactId.toString()).assertTrue(); + console.info('logMessage contact_query_test_3600: displayName = ' + resultSet.getString(1)); + expect(resultSet.getString(1) == "xiaoyuzhou").assertTrue(); + } while (resultSet.goToNextRow()); + } + resultSet.close(); + } catch (error) { + console.info("logMessage contact_query_test_3600: query error :" + error); + done(); + } + } + }); + + /** + * @tc.number contact_query_test_3700 + * @tc.name Query recent contact ability + * @tc.desc Function test + */ + it("contact_query_test_3700", 0, async function (done) { + console.info("-----------logMessage contact_query_test_3700 is starting!------------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + var rawContactValues = { + "display_name": "xiaoyuzhou", "lastest_contacted_time": 60 + }; + try { + var rawContactId = await DAHelper.insert(rawContactUri, rawContactValues); + sleep(1000); + console.info("logMessage contact_query_test_3700: rawContactId = " + rawContactId); + expect(rawContactId > 0).assertTrue(); + await queryContacted(); + await deleteRawContact("contact_query_test_3700"); + done(); + } catch (error) { + console.info("logMessage contact_query_test_3700: raw_contact insert error = " + error); + done(); + } + + async function queryContacted() { + var resultColumns = ["id", "display_name"]; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.lessThan("lastest_contacted_time", "100"); + condition.and(); + condition.equalTo("is_deleted", "0"); + try { + var resultSet = await DAHelper.query(rawContactUri, resultColumns, condition); + sleep(1000); + if (resultSet.goToFirstRow()) { + do { + console.info('logMessage contact_query_test_3700: id = ' + resultSet.getString(0)); + expect(resultSet.getString(0) == rawContactId.toString()).assertTrue(); + console.info('logMessage contact_query_test_3700: displayName = ' + resultSet.getString(1)); + expect(resultSet.getString(1) == "xiaoyuzhou").assertTrue(); + } while (resultSet.goToNextRow()); + } + resultSet.close(); + } catch (error) { + console.info('logMessage contact_query_test_3700: query error' + error); + done(); + } + } + }); + + /** + * @tc.number contact_query_test_3800 + * @tc.name Query recently deleted contacts + * @tc.desc Function test + */ + it("contact_query_test_3800", 0, async function (done) { + console.info("-----------logMessage contact_query_test_3800 is starting!------------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + var rawContactValues = { + "display_name": "xiaocai" + }; + try { + var rawContactId = await DAHelper.insert(rawContactUri, rawContactValues); + sleep(1000); + console.info("logMessage contact_query_test_3800: rawContactId = " + rawContactId); + expect(rawContactId > 0).assertTrue(); + await rawContactDelete(DAHelper, rawContactId); + await deletedRawContactQuery(DAHelper, rawContactId); + await deleteAll(deletedUri, "contact_query_test_3800") + done(); + } catch (error) { + console.info("logMessage contact_query_test_3800: raw_contact insert error = " + error); + done(); + } + }); + + async function rawContactDelete(DAHelper, rawContactId) { + var condition1 = new ohosDataAbility.DataAbilityPredicates(); + condition1.equalTo("id", rawContactId.toString()); + try { + var deleteCode = await DAHelper.delete(rawContactUri, condition1); + sleep(1000); + console.info('logMessage contact_query_test_3800: deleteCode = ' + deleteCode); + expect(deleteCode == 0).assertTrue(); + } catch (error) { + console.info("logMessage contact_query_test_3800: raw_contact delete error = " + error); + done(); + } + } + + async function deletedRawContactQuery(DAHelper, rawContactId) { + var resultColumns = ["id", "raw_contact_id", "display_name", "is_deleted"]; + var condition2 = new ohosDataAbility.DataAbilityPredicates(); + condition2.equalTo("raw_contact_id", rawContactId.toString()); + try { + var resultSet = await DAHelper.query(deletedRawContactUri, resultColumns, condition2); + sleep(1000); + if (resultSet.goToFirstRow()) { + console.info('logMessage contact_query_test_3800: id = ' + resultSet.getString(0)); + console.info('logMessage contact_query_test_3800: raw_contact_id = ' + resultSet.getString(1)); + expect(resultSet.getString(1) == rawContactId.toString()).assertTrue(); + console.info('logMessage contact_query_test_3800: displayName = ' + resultSet.getString(2)); + expect(resultSet.getString(2) == "xiaocai").assertTrue(); + console.info('logMessage contact_query_test_3800: is_deleted = ' + resultSet.getString(3)); + expect(resultSet.getString(3) == "1").assertTrue(); + } + resultSet.close(); + } catch (error) { + console.info("logMessage contact_query_test_3800: query error :" + error); + done(); + } + } + + /** + * @tc.number contact_query_test_3900 + * @tc.name Query all mobile phone numbers + * @tc.desc Function test + */ + it("contact_query_test_3900", 0, async function (done) { + console.info("-----------logMessage contact_query_test_3900 is starting!------------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + var rawContactValues = { + "display_name": "xiaocai" + }; + try { + var rawContactId = await DAHelper.insert(rawContactUri, rawContactValues); + sleep(1000); + console.info("logMessage contact_query_test_3900: rawContactId = " + rawContactId); + expect(rawContactId > 0).assertTrue(); + await queryPhoneInsert(); + await phoneQuery(rawContactId); + await deleteRawContact("contact_query_test_3900"); + await deleteAll(contactDataUri, "contact_query_test_3900"); + done(); + } catch (error) { + console.info("logMessage contact_query_test_3900: raw_contact insert error = " + error); + done(); + } + }); + + async function queryPhoneInsert(DAHelper, rawContactId) { + var contactDataValues = { + "raw_contact_id": rawContactId, + "content_type": "phone", + "detail_info": "1853696321" + }; + try { + var contactDataId = await DAHelper.insert(contactDataUri, contactDataValues); + sleep(1000); + console.info("logMessage contact_query_test_3900: contactDataId = " + contactDataId); + expect(contactDataId > 0).assertTrue(); + } catch (error) { + console.info("logMessage contact_query_test_3900: contact_data insert error = " + error); + } + } + + async function phoneQuery(DAHelper, rawContactId) { + var resultColumns = ["raw_contact_id", "detail_info"]; + var condition = new ohosDataAbility.DataAbilityPredicates(); + // type_id = 5 data is phone + condition.equalTo("content_type", "phone"); + try { + var resultSet = await DAHelper.query(contactDataUri, resultColumns, condition); + sleep(1000); + if (resultSet.goToFirstRow()) { + do { + console.info('logMessage contact_query_test_3900: raw_contact_id = ' + resultSet.getString(0)); + expect(resultSet.getString(0) == rawContactId.toString()).assertTrue(); + console.info('logMessage contact_query_test_3900: detail_info = ' + resultSet.getString(1)); + expect(resultSet.getString(1) == "1853696321").assertTrue(); + } while (resultSet.goToNextRow()); + } + resultSet.close(); + } catch (error) { + console.info('logMessage contact_query_test_3900: query error' + error); + } + } + + /** + * @tc.number contact_query_test_4000 + * @tc.name Query all mailbox capabilities + * @tc.desc Function test + */ + it("contact_query_test_4000", 0, async function (done) { + console.info("-----------logMessage contact_query_test_4000 is starting!------------"); + + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + var rawContactValues = { + "display_name": "xiaoyu" + }; + try { + var rawContactId = await DAHelper.insert(rawContactUri, rawContactValues); + sleep(1000); + console.info("logMessage contact_query_test_4000: rawContactId = " + rawContactId); + expect(rawContactId > 0).assertTrue(); + await queryEmailInsert(DAHelper, rawContactId); + await emailQuery(DAHelper, contactDataId, rawContactId); + await deleteRawContact("contact_query_test_4000"); + await deleteAll(contactDataUri, "contact_query_test_4000"); + done(); + } catch (error) { + console.info("logMessage contact_query_test_4000: raw_contact insert error = " + error); + done(); + } + }); + + async function queryEmailInsert(DAHelper, rawContactId) { + var contactDataValues = { + "raw_contact_id": rawContactId, + "content_type": "email", + "detail_info": "16658@163.com" + }; + try { + var contactDataId = await DAHelper.insert(contactDataUri, contactDataValues); + sleep(1000); + console.info("logMessage contact_query_test_4000: contactDataId = " + contactDataId); + expect(contactDataId > 0).assertTrue(); + } catch (error) { + console.info("logMessage contact_query_test_4000: contact_data insert error = " + error); + } + } + + async function emailQuery(DAHelper, contactDataId, rawContactId) { + var resultColumns = ["id", "raw_contact_id", "detail_info"]; + var condition = new ohosDataAbility.DataAbilityPredicates(); + // type_id = 1 data content_type is email + condition.equalTo("type_id", "1").limitAs(3).orderByDesc("id"); + try { + var resultSet = await DAHelper.query(contactDataUri, resultColumns, condition); + sleep(1000); + if (resultSet.goToFirstRow()) { + do { + console.info('logMessage contact_query_test_4000: id = ' + resultSet.getString(0)); + expect(resultSet.getString(0) == contactDataId.toString()).assertTrue(); + console.info('logMessage contact_query_test_4000: raw_contact_id = ' + resultSet.getString(1)); + expect(resultSet.getString(1) == rawContactId.toString()).assertTrue(); + console.info('logMessage contact_query_test_4000: detail_info = ' + resultSet.getString(2)); + expect(resultSet.getString(2) == "16658@163.com").assertTrue(); + } while (resultSet.goToNextRow()); + } + resultSet.close(); + } catch (error) { + console.info("logMessage contact_query_test_4000: query error :" + error); + } + } + + /** + * @tc.number contact_query_test_4100 + * @tc.name Query data information of a single contact + * @tc.desc Function test + */ + it("contact_query_test_4100", 0, async function (done) { + console.info("-----------logMessage contact_query_test_4100 is starting!------------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + var rawContactValues = { + "display_name": "xiaoyu" + }; + try { + var rawContactId = await DAHelper.insert(rawContactUri, rawContactValues); + sleep(1000); + console.info("logMessage contact_query_test_4100: rawContactId = " + rawContactId); + expect(rawContactId > 0).assertTrue(); + await queryTwoDataInsert(DAHelper, rawContactId); + await queryTwoDataInsertCompany(DAHelper, rawContactId); + await queryTwo(DAHelper, rawContactId); + await deleteRawContact("contact_query_test_4100"); + await deleteAll(contactDataUri, "contact_query_test_4100"); + del + done(); + } catch (error) { + console.info("logMessage contact_query_test_4100: raw_contact insert error = " + error); + done(); + } + }); + + async function queryTwoDataInsert(DAHelper, rawContactId) { + var contactDataValues = { + "raw_contact_id": rawContactId, "content_type": "name", "detail_info": "xiaoyu" + }; + try { + var contactDataId1 = await DAHelper.insert(contactDataUri, contactDataValues); + sleep(1000); + console.info("logMessage contact_query_test_4100: contactDataId = " + contactDataId1); + expect(contactDataId1 > 0).assertTrue(); + } catch (error) { + console.info("logMessage contact_query_test_4100: contact_data name insert error = " + error); + } + } + + async function queryTwoDataInsertCompany(DAHelper, rawContactId) { + var contactDataValues = { + "raw_contact_id": rawContactId, + "content_type": "organization", + "detail_info": "OOOO", + "position": "Testers" + }; + try { + var contactDataId2 = await DAHelper.insert(contactDataUri, contactDataValues); + console.info("logMessage contact_query_test_4100: contactDataId = " + contactDataId2); + expect(contactDataId2 > 0).assertTrue(); + } catch (error) { + console.info("logMessage contact_query_test_4100: contact_data company insert error = " + error); + } + } + + async function queryTwo(DAHelper, rawContactId) { + var resultColumns = ["id", "raw_contact_id", "detail_info", "position"]; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("raw_contact_id", rawContactId.toString()); + try { + var resultSet = await DAHelper.query(contactDataUri, resultColumns, condition); + sleep(1000); + var array = [{ + detail_info: "xiaoyu", position: "" + }, { + detail_info: "OOOO", position: "Testers" + }]; + var i = 0; + if (resultSet.goToFirstRow()) { + do { + console.info("logMessage contact_query_test_4100: columnNames :" + resultSet.columnNames); + console.info("logMessage contact_query_test_4100: columnCount:" + resultSet.columnCount); + console.info('logMessage contact_query_test_4100: id = ' + resultSet.getString(0)); + console.info('logMessage contact_query_test_4100: raw_contact_id = ' + resultSet.getString(1)); + expect(resultSet.getString(1) == rawContactId.toString()).assertEqual(true); + console.info('logMessage contact_query_test_4100: detail_info = ' + resultSet.getString(2)); + expect(resultSet.getString(2) == array[i].detail_info).assertEqual(true); + console.info('logMessage contact_query_test_4100: position = ' + resultSet.getString(3)); + expect(resultSet.getString(3) == array[i].position).assertEqual(true); + i++; + } while (resultSet.goToNextRow()); + } + resultSet.close(); + } catch (error) { + console.info("logMessage contact_query_test_4100: query error :" + error); + } + } + + /** + * @tc.number contact_delete_test_4400 + * @tc.name Delete the basic raw data of the contact and record the deleted basic raw data + * @tc.desc Function test + */ + it("contact_delete_test_4400", 0, async function (done) { + console.info("-------logMessage contact_delete_test_4400 is starting!-------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + var insertRawContactValues = { + "display_name": "xiaoming" + }; + try { + var rawContactId = await DAHelper.insert(rawContactUri, insertRawContactValues); + sleep(1000); + console.info("logMessage contact_delete_test_4400: rawContactId = " + rawContactId); + expect(rawContactId > 0).assertTrue(); + await deleteRaw(DAHelper, rawContactId); + await queryDelete(DAHelper, rawContactId); + done(); + } catch (error) { + console.info("logMessage contact_delete_test_4400: raw_contact insert error :" + error); + done(); + } + }); + + async function deleteRaw(DAHelper, rawContactId) { + var condition1 = new ohosDataAbility.DataAbilityPredicates(); + condition1.equalTo("id", rawContactId.toString()); + try { + var deleteCode = await DAHelper.delete(rawContactUri, condition1); + sleep(1000); + console.info("logMessage contact_delete_test_4400: deleteCode = " + deleteCode); + expect(deleteCode == 0).assertTrue(); + } catch (error) { + console.info("logMessage contact_delete_test_4400: delete error = " + error); + } + } + + async function queryDelete(DAHelper, rawContactId) { + var resultColumns = ["id", "delete_time", "display_name"]; + var condition2 = new ohosDataAbility.DataAbilityPredicates(); + condition2.equalTo("raw_contact_id", rawContactId.toString()); + try { + var resultSet = await DAHelper.query(deletedRawContactUri, resultColumns, condition2); + sleep(1000); + if (resultSet.goToFirstRow()) { + console.info("logMessage contact_delete_test_4400: columnNames:" + resultSet.columnNames); + console.info("logMessage contact_delete_test_4400: columnCount:" + resultSet.columnCount); + console.info('logMessage contact_delete_test_4400: id = ' + resultSet.getString(0)); + console.info('logMessage contact_delete_test_4400: delete_time = ' + resultSet.getString(1)); + console.info('logMessage contact_delete_test_4400: displayName = ' + resultSet.getString(2)); + expect(resultSet.getString(2) == "xiaoming").assertTrue(); + } + resultSet.close(); + } catch (error) { + console.info("logMessage contact_delete_test_4400: query error:" + error); + } + } + + /** + * @tc.number contact_delete_test_4700 + * @tc.name Delete detailed contact data and record detailed data + * @tc.desc Function test + */ + it("contact_delete_test_4700", 0, async function (done) { + console.info("-------logMessage contact_delete_test_4700 is starting!-------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + var insertRawContactValues = { + "display_name": "xiaozhang", "company": "OOOO", "position": "TestManager" + }; + try { + var rawContactId = await DAHelper.insert(rawContactUri, insertRawContactValues); + sleep(1000); + console.info("logMessage contact_delete_test_4700: rawContactId = " + rawContactId); + expect(rawContactId > 0).assertTrue(); + await queryDeleteCompanyData(DAHelper, rawContactId); + await rawContactDelete(DAHelper, rawContactId); + await companyRawContactDeleteQuery(DAHelper, rawContactId); + await deleteAll(contactDataUri, "contact_delete_test_4700"); + done(); + } catch (error) { + console.info("logMessage contact_delete_test_4700: raw_contact insert error:" + error); + done(); + } + }); + + async function queryDeleteCompanyData(DAHelper, rawContactId) { + var contactDataValues = { + "raw_contact_id": rawContactId, + "content_type": "organization", + "detail_info": "OOOO", + "position": "TestManager" + }; + try { + var contactDataId = await DAHelper.insert(contactDataUri, contactDataValues); + sleep(1000); + console.info("logMessage contact_delete_test_4700: contactDataId = " + contactDataId); + expect(contactDataId > 0).assertTrue(); + } catch (error) { + console.info("logMessage contact_delete_test_4700: contact_data insert error:" + error); + } + } + + async function rawContactDelete(DAHelper, rawContactId) { + var condition1 = new ohosDataAbility.DataAbilityPredicates(); + condition1.equalTo("id", rawContactId.toString()); + try { + var deleteCode = await DAHelper.delete(rawContactUri, condition1); + sleep(1000); + console.info("logMessage contact_delete_test_4700: deleteCode = " + deleteCode); + expect(deleteCode == 0).assertTrue(); + } catch (error) { + console.info("logMessage contact_delete_test_4700: delete error = " + error); + done(); + } + } + + async function companyRawContactDeleteQuery(DAHelper, rawContactId) { + var resultColumns = ["id", "display_name", "backup_data"]; + var condition2 = new ohosDataAbility.DataAbilityPredicates(); + condition2.equalTo("raw_contact_id", rawContactId.toString()); + try { + var resultSet = await DAHelper.query(deletedRawContactUri, resultColumns, condition2); + sleep(1000); + if (resultSet.goToFirstRow()) { + console.info("logMessage contact_delete_test_4700: columnNames:" + resultSet.columnNames); + console.info("logMessage contact_delete_test_4700: columnCount:" + resultSet.columnCount); + console.info('logMessage contact_delete_test_4700: id = ' + resultSet.getString(0)); + console.info('logMessage contact_delete_test_4700: displayName = ' + resultSet.getString(1)); + expect(resultSet.getString(1) == "xiaozhang").assertEqual(true); + console.info('logMessage contact_delete_test_4700: backup_data = ' + resultSet.getString(2)); + } + resultSet.close(); + } catch (error) { + console.info("logMessage contact_delete_test_4700: query error:" + error); + } + } + + /** + * @tc.number contact_delete_test_4800 + * @tc.name Delete and record basic data of a single contact + * @tc.desc Function test + */ + it("contact_delete_test_4800", 0, async function (done) { + console.info("-------logMessage contact_delete_test_4800 is starting!-------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + var insertRawContactValues = { + "display_name": "xiaopeng" + }; + try { + var rawContactId = await DAHelper.insert(rawContactUri, insertRawContactValues); + sleep(1000); + console.info("logMessage contact_delete_test_4800: rawContactId = " + rawContactId); + expect(rawContactId > 0).assertTrue(); + await contactDelete(DAHelper, rawContactId); + await deletedRawContactQuery(DAHelper, rawContactId) + await deleteAll(contactDataUri, "contact_delete_test_4800"); + done(); + } catch (error) { + console.info("logMessage contact_delete_test_4800: raw_contact insert error:" + error); + done(); + } + }); + + async function contactDelete(DAHelper, rawContactId) { + var condition1 = new ohosDataAbility.DataAbilityPredicates(); + condition1.equalTo("name_raw_contact_id", rawContactId.toString()); + try { + var deleteCode = await DAHelper.delete(contactUri, condition1); + sleep(1000); + console.info("logMessage contact_delete_test_4800: deleteCode = " + deleteCode); + expect(deleteCode == 0).assertTrue(); + } catch (error) { + console.info("logMessage contact_delete_test_4800: delete error = " + error); + } + } + + async function deletedRawContactQuery(DAHelper, rawContactId) { + var resultColumns = ["id", "delete_time", "display_name"]; + var condition2 = new ohosDataAbility.DataAbilityPredicates(); + condition2.equalTo("raw_contact_id", rawContactId.toString()); + try { + var resultSet = await DAHelper.query(deletedRawContactUri, resultColumns, condition2); + sleep(1000) + if (resultSet.goToFirstRow()) { + console.info("logMessage contact_delete_test_4800: columnNames:" + resultSet.columnNames); + console.info("logMessage contact_delete_test_4800: columnCount:" + resultSet.columnCount); + console.info('logMessage contact_delete_test_4800: id = ' + resultSet.getString(0)); + console.info('logMessage contact_delete_test_4800: delete_time = ' + resultSet.getString(1)); + console.info('logMessage contact_delete_test_4800: displayName = ' + resultSet.getString(2)); + expect(resultSet.getString(2) == "xiaopeng").assertTrue(); + } + resultSet.close(); + } catch (error) { + console.info("logMessage contact_delete_test_4800: query error:" + error); + } + } + + /** + * @tc.number contact_batchinsert_test_4900 + * @tc.name Insert contacts in batches(raw_contact) + * @tc.desc Function test + */ + it("contact_batchinsert_test_4900", 0, async function (done) { + console.info("--------logMessage contact_batchinsert_test_4900 is starting!-------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + try { + var batchInsertCode = await DAHelper.batchInsert(rawContactUri, common.getContactBatchCompany()); + sleep(1000); + console.info("logMessage contact_batchinsert_test_4900: batchInsertCode = " + batchInsertCode); + expect(batchInsertCode == 0).assertTrue(); + var resultColumns = []; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("company", "TT4900"); + var resultSet = await DAHelper.query(rawContactUri, resultColumns, condition); + console.info( + 'contact_batchinsert_test_4900 : queryBatch start ! resultSet.rowCount = ' + resultSet.rowCount); + expect(resultSet.rowCount == 5).assertEqual(true); + resultSet.close(); + await deleteRawContact("contact_batchinsert_test_4900"); + done(); + } catch (error) { + console.info("logMessage contact_batchinsert_test_4900: batchInsert error = " + error); + done(); + } + }); + + /** + * @tc.number contact_batchinsert_test_5000 + * @tc.name Insert contact_data in batches of address book + * @tc.desc Function test + */ + it("contact_batchinsert_test_5000", 0, async function (done) { + console.info("--------logMessage contact_batchinsert_test_5000 start!-------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + var rawContactValues = { + "display_name": "xiaozhi" + }; + try { + var rawContactId = await DAHelper.insert(rawContactUri, rawContactValues); + sleep(1000); + console.info("logMessage contact_batchinsert_test_5000: rawContactId = " + rawContactId); + expect(rawContactId > 0).assertTrue(); + await contactDataBatchInsert(rawContactId); + done(); + } catch (error) { + console.info("logMessage contact_batchinsert_test_5000: raw_contact insert error = " + error); + done(); + } + async function contactDataBatchInsert(rawContactId) { + try { + var batchInsertCode = await DAHelper.batchInsert(contactDataUri, common.getContactBatchCompanyTwo()); + sleep(1000); + console.info("logMessage contact_batchinsert_test_5000: batchInsertCode = " + batchInsertCode); + expect(batchInsertCode == 0).assertTrue(); + var map = new Map(); + map.set("raw_contact_id", rawContactId.toString()); + await queryBatch(map, "contact_batchinsert_test_5000", 5); + await deleteRawContact("contact_batchinsert_test_5000"); + done(); + } catch (error) { + console.info("logMessage contact_batchinsert_test_5000: batchInsert error = " + error); + done(); + } + } + }); + + /** + * @tc.number contact_batchinsert_test_5400 + * @tc.name Batch operation of contact black list + * @tc.desc Function test + */ + it("contact_batchinsert_test_5400", 0, async function (done) { + console.info("--------logMessage contact_batchinsert_test_5400 is starting!-------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + try { + var batchInsertCode = await DAHelper.batchInsert(contactBlocklistUri, common.getPhoneNumberBatch()); + sleep(1000); + console.info("logMessage contact_batchinsert_test_5400: batchInsertCode = " + batchInsertCode); + expect(batchInsertCode == 0).assertTrue(); + await query(5); + await blocklistDelete(); + done(); + } catch (error) { + console.info("logMessage contact_batchinsert_test_5400: batchInsert error = " + error); + done(); + } + + async function blocklistDelete() { + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("phone_number", "85525040585400"); + try { + var deleteCode = await DAHelper.delete(contactBlocklistUri, condition); + console.info("logMessage contact_batchinsert_test_5400: deleteCode = " + deleteCode); + expect(deleteCode == 0).assertTrue(); + await query(0); + done(); + } catch (error) { + console.info("logMessage contact_batchinsert_test_5400: delete error = " + error); + done(); + } + } + + async function query(size) { + var resultColumns = []; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("phone_number", "85525040585400"); + try { + var resultSet = await DAHelper.query(contactBlocklistUri, resultColumns, condition); + sleep(1000); + console.info( + 'contact_batchinsert_test_5400 : queryBatch start ! resultSet.rowCount = ' + resultSet.rowCount); + expect(resultSet.rowCount == size).assertEqual(true); + resultSet.close(); + } catch (error) { + console.info(" contact_batchinsert_test_5400 logMessage resultSet.rowCount: error = " + error); + } + } + }); + + /** + * @tc.number contact_update_test_5300 + * @tc.name Bulk favorites and unfavorites of contacts + * @tc.desc Function test + */ + it("contact_update_test_5300", 0, async function (done) { + console.info("--------logMessage contact_update_test_5300 is starting!-------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + var rawContactValuesOne = { + "display_name": "fengyuan", "favorite": 1 + }; + var rawContactValuesTwo = { + "display_name": "xiaoli", "favorite": 1 + }; + var rawContactValuesThree = { + "display_name": "xiaoma", "favorite": 1 + }; + var listAddBluk = [] + listAddBluk[0] = rawContactValuesOne; + listAddBluk[1] = rawContactValuesTwo; + listAddBluk[2] = rawContactValuesThree; + try { + var batchInsertCode = await DAHelper.batchInsert(rawContactUri, listAddBluk); + sleep(1000); + console.info("logMessage contact_update_test_5300: batchInsertCode = " + batchInsertCode); + expect(batchInsertCode == 0).assertTrue(); + await rawContactUpdateUnFavorites(DAHelper); + await queryUnFavorites(DAHelper); + await deleteRawContact("contact_update_test_5300"); + done(); + } catch (error) { + console.info("logMessage contact_update_test_5300: batchInsert error = " + error); + done(); + } + }); + + async function rawContactUpdateUnFavorites(DAHelper) { + var updateValues = { + "favorite": 0 + }; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("display_name", "fengyuan"); + condition.or(); + condition.equalTo("display_name", "xiaoma"); + try { + var updateCode = await DAHelper.update(rawContactUri, updateValues, condition); + sleep(1000); + console.info("logMessage contact_update_test_5300: updateCode = " + updateCode); + expect(updateCode == 0).assertTrue(); + } catch (error) { + console.info("logMessage contact_update_test_5300: update error = " + error); + } + } + + async function queryUnFavorites(DAHelper) { + var resultColumns = []; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("display_name", "fengyuan"); + condition.or(); + condition.equalTo("display_name", "xiaoma"); + try { + var resultSet = await DAHelper.query(rawContactUri, resultColumns, condition); + sleep(1000); + console.info('contact_update_test_5300 : queryBatch start ! resultSet.rowCount = ' + + resultSet.rowCount); + expect(resultSet.rowCount == 2).assertEqual(true); + if (resultSet.rowCount > 0) { + if (resultSet.goToFirstRow()) { + do { + var dbresult = resultSet.getString(resultSet.getColumnIndex("favorite")); + console.info(' contact_update_test_5300 :logMessage contactsQuery dbresult :' + dbresult + + ' value : ' + value); + expect(dbresult == "0").assertEqual(true); + } while (resultSet.goToNextRow()); + } + } + resultSet.close(); + } catch (error) { + console.info(" contact_batchinsert_test_5400 logMessage resultSet.rowCount: error = " + error); + } + } + + /** + * @tc.number contact_batchinsert_test_5500 + * @tc.name Contacts are added to and removed from groups in batches + * @tc.desc Function test + */ + it("contact_batchinsert_test_5500", 0, async function (done) { + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + var groupValues = { + "group_name": "ManagerGroup" + }; + try { + var groupId = await DAHelper.insert(groupUri, groupValues); + console.info("logMessage contact_batchinsert_test_5500: groupId = " + groupId); + expect(groupId > 0).assertTrue(); + } catch (error) { + console.info("logMessage contact_batchinsert_test_5500: group insert error = " + error); + done(); + } + try { + var rawContactValues1 = { + "display_name": "xiaohuang" + }; + var rawContactIdOne = await DAHelper.insert(rawContactUri, rawContactValues1); + console.info("logMessage contact_batchinsert_test_5500: rawContactIdOne = " + rawContactIdOne); + expect(rawContactIdOne > 0).assertTrue(); + } catch (error) { + console.info("logMessage contact_batchinsert_test_5500: raw_contact_1 insert error = " + error); + done(); + } + try { + var rawContactValues2 = { + "display_name": "xiaolv" + }; + var rawContactIdTwo = await DAHelper.insert(rawContactUri, rawContactValues2); + console.info("logMessage contact_batchinsert_test_5500: rawContactIdTwo = " + rawContactIdTwo); + expect(rawContactIdTwo > 0).assertTrue(); + } catch (error) { + console.info("logMessage contact_batchinsert_test_5500: raw_contact_2 insert error = " + error); + done(); + } + try { + var rawContactValues3 = { + "display_name": "xiaobai" + }; + var rawContactIdThird = await DAHelper.insert(rawContactUri, rawContactValues3); + console.info("logMessage contact_batchinsert_test_5500: rawContactIdThird = " + rawContactIdThird); + expect(rawContactIdThird > 0).assertTrue(); + } catch (error) { + console.info("logMessage contact_batchinsert_test_5500: raw_contact_3 insert error = " + error); + done(); + } + await threeDataInsert(DAHelper, rawContactIdOne, rawContactIdTwo, rawContactIdThird, groupId); + await deleteRawContact("contact_batchinsert_test_5500"); + await deleteAll(groupUri, "contact_batchinsert_test_5500"); + await deleteAll(contactDataUri, "contact_batchinsert_test_5500"); + done(); + }); + + async function threeDataInsert(DAHelper, rawContactIdOne, rawContactIdTwo, rawContactIdThird, groupId) { + var contactDataValues1 = { + "raw_contact_id": rawContactIdOne, + "content_type": "group_membership", + "detail_info": groupId.toString() + }; + var contactDataValues2 = { + "raw_contact_id": rawContactIdTwo, + "content_type": "group_membership", + "detail_info": groupId.toString() + }; + var contactDataValues3 = { + "raw_contact_id": rawContactIdThird, + "content_type": "group_membership", + "detail_info": groupId.toString() + }; + var listAddBluk = []; + listAddBluk[0] = contactDataValues1; + listAddBluk[1] = contactDataValues2; + listAddBluk[2] = contactDataValues3; + try { + var batchInsertCode = await DAHelper.batchInsert(contactDataUri, listAddBluk); + sleep(1000); + console.info("logMessage contact_batchinsert_test_5500: batchInsertCode = " + batchInsertCode); + expect(batchInsertCode == 0).assertTrue(); + await contactDataDelete(DAHelper, rawContactIdOne, rawContactIdThird); + } catch (error) { + console.info("logMessage contact_batchinsert_test_5500: batchInsert error = " + error); + } + } + + async function contactDataDelete(DAHelper, rawContactIdOne, rawContactIdThird) { + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("raw_contact_id", rawContactIdOne.toString()); + condition.or(); + condition.equalTo("raw_contact_id", rawContactIdThird.toString()); + try { + var deleteCode = await DAHelper.delete(contactDataUri, condition); + sleep(1000); + console.info("logMessage contact_batchinsert_test_5500: deleteCode = " + deleteCode); + expect(deleteCode == 0).assertTrue(); + await queryTwoData(DAHelper, rawContactIdOne, rawContactIdThird); + } catch (error) { + console.info("logMessage contact_batchinsert_test_5500: delete error = " + error); + } + } + + async function queryTwoData(DAHelper, rawContactIdOne, rawContactIdThird) { + var resultColumns = []; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("raw_contact_id", rawContactIdOne.toString()); + condition.or(); + condition.equalTo("raw_contact_id", rawContactIdThird.toString()); + try { + var resultSet = await DAHelper.query(contactDataUri, resultColumns, condition); + sleep(1000); + console.info( + 'contact_batchinsert_test_5500 : queryBatch start ! resultSet.rowCount = ' + resultSet.rowCount); + expect(resultSet.rowCount == 0).assertEqual(true); + resultSet.close(); + } catch (error) { + console.info(" contact_batchinsert_test_5400 logMessage resultSet.rowCount: error = " + error); + } + } + + /** + * @tc.number contact_pinyin_query_test_200 + * @tc.name Contact name to pinyin (Chinese Simplified) + * @tc.desc Function test + */ + it("contact_pinyin_query_test_200", 0, async function (done) { + console.info("--------logMessage contact_pinyin_query_test_200 is starting!-------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + var rawContactValues = { + "display_name": "小黄" + }; + try { + var rawContactId = await DAHelper.insert(rawContactUri, rawContactValues); + console.info('logMessage contact_pinyin_query_test_200 rawContactId = ' + rawContactId); + expect(rawContactId > 0).assertTrue(); + await contactDataInsert(); + await deleteRawContact("contact_pinyin_query_test_100"); + await deleteAll(contactDataUri, "contact_pinyin_query_test_100"); + done(); + } catch (error) { + console.info("logMessage contact_pinyin_query_test_200: raw_contact insert error = " + error); + done(); + } + + async function contactDataInsert() { + var contactDataValues = { + "raw_contact_id": rawContactId, + "content_type": "name", + "detail_info": "xiaohuang" + }; + try { + var contactDataId = await DAHelper.insert(contactDataUri, contactDataValues); + console.info('logMessage contact_pinyin_query_test_200 contactDataId = ' + contactDataId); + expect(contactDataId > 0).assertTrue(); + await searchQuery(DAHelper, rawContactId); + } catch (error) { + console.info('logMessage contact_pinyin_query_test_200 contact_data insert error = ' + error); + done(); + } + } + }); + + async function searchQuery(DAHelper, rawContactId) { + var resultColumns = ["id", "search_name"]; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("raw_contact_id", rawContactId.toString()); + try { + var resultSet = await DAHelper.query(searchContactUri, resultColumns, condition); + var map = common.getSearchMap(); + map.set("raw_contact_id", rawContactId.toString()); + if (resultSet.goToFirstRow()) { + do { + for (var [key, value] of map) { + var dbresult = resultSet.getString(resultSet.getColumnIndex(key)); + console.info(tag + ':contact_pinyin_query_test_200 key = ' + key + ' dbresult :' + dbresult + + ' value : ' + value); + expect(value == dbresult).assertEqual(true); + } + } while (resultSet.goToNextRow()); + } + resultSet.close(); + } catch (error) { + console.info('logMessage contact_pinyin_query_test_200 query error = ' + error); + } + } + + /** + * @tc.number contact_pinyin_query_test_100 + * @tc.name Contact name to pinyin (Chinese Traditional) + * @tc.desc Function test + */ + it("contact_pinyin_query_test_100", 0, async function (done) { + console.info("--------logMessage contact_pinyin_query_test_100 is starting!-------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + var rawContactValues = { + "display_name": "鍵盤" + }; + try { + var rawContactId = await DAHelper.insert(rawContactUri, rawContactValues); + sleep(1000); + console.info('logMessage contact_pinyin_query_test_100 rawContactId = ' + rawContactId); + expect(rawContactId > 0).assertTrue(); + await contactDataInsert(); + await deleteRawContact("contact_pinyin_query_test_100"); + await deleteAll(contactDataUri, "contact_pinyin_query_test_100"); + done(); + } catch (error) { + console.info('logMessage contact_pinyin_query_test_100 raw_contact insert error = ' + error); + done(); + } + + async function contactDataInsert() { + var contactDataValues = { + "raw_contact_id": rawContactId, "content_type": "name", "detail_info": "鍵盤" + }; + try { + var contactDataId = await DAHelper.insert(contactDataUri, contactDataValues); + sleep(1000); + console.info('logMessage contact_pinyin_query_test_100 contactDataId = ' + contactDataId); + expect(contactDataId > 0).assertTrue(); + await searchContactQueryChinese(DAHelper, rawContactId); + } catch (error) { + console.info('logMessage contact_pinyin_query_test_100 contact_data insert error = ' + error); + done(); + } + } + }); + + async function searchContactQueryChinese(DAHelper, rawContactId) { + var resultColumns = ["raw_contact_id", "search_name"]; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("raw_contact_id", rawContactId.toString()); + try { + var resultSet = await DAHelper.query(searchContactUri, resultColumns, condition); + if (resultSet.goToFirstRow()) { + do { + console.info('logMessage contact_pinyin_query_test_100: id = ' + resultSet.getString(0)); + expect(resultSet.getString(0) == rawContactId.toString()).assertEqual(true); + console.info('logMessage contact_pinyin_query_test_100: search_name = ' + resultSet.getString(1)); + expect(resultSet.getString(1) == "鍵盤||jianpan||jp").assertEqual(true); + } while (resultSet.goToNextRow()); + } + resultSet.close(); + } catch (error) { + console.info('logMessage contact_pinyin_query_test_100 query error = ' + error); + } + } + + /** + * @tc.number contact_pinyin_query_test_300 + * @tc.name Contact name to pinyin (English) + * @tc.desc Function test + */ + it("contact_pinyin_query_test_300", 0, async function (done) { + console.info("--------logMessage contact_pinyin_query_test_300 is starting!-------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + var rawContactValues = { + "display_name": "Tom" + }; + try { + var rawContactId = await DAHelper.insert(rawContactUri, rawContactValues); + sleep(1000); + console.info('logMessage contact_pinyin_query_test_300 rawContactId = ' + rawContactId); + expect(rawContactId > 0).assertTrue(); + await contactDataInsert(); + await deleteRawContact("contact_pinyin_query_test_300"); + done(); + } catch (error) { + console.info('logMessage contact_pinyin_query_test_300 raw_contact insert error = ' + error); + done(); + } + + async function contactDataInsert() { + var contactDataValues = { + "raw_contact_id": rawContactId, "content_type": "name", "detail_info": "Tom" + }; + try { + var contactDataId = await DAHelper.insert(contactDataUri, contactDataValues); + console.info('logMessage contact_pinyin_query_test_300 contactDataId = ' + contactDataId); + expect(contactDataId > 0).assertTrue(); + await searchContactQuery(DAHelper, rawContactId); + } catch (error) { + console.info('logMessage contact_pinyin_query_test_300 contact_data insert error = ' + error); + done(); + } + } + }); + + async function searchContactQuery(DAHelper, rawContactId) { + var resultColumns = ["raw_contact_id", "search_name"]; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("raw_contact_id", rawContactId.toString()); + try { + var resultSet = await DAHelper.query(searchContactUri, resultColumns, condition); + if (resultSet.goToFirstRow()) { + do { + console.info('logMessage contact_pinyin_query_test_300: id = ' + resultSet.getString(0)); + expect(resultSet.getString(0) == rawContactId.toString()).assertTrue(); + console.info('logMessage contact_pinyin_query_test_300: search_name = ' + resultSet.getString(1)); + expect(resultSet.getString(1) == "Tom||Tom||Tom").assertTrue(); + } while (resultSet.goToNextRow()); + } + resultSet.close(); + } catch (error) { + console.info('logMessage contact_pinyin_query_test_300 query error = ' + error); + } + } + + /** + * @tc.number contact_fuzzyquery_test_400 + * @tc.name Contact fuzzy search query interface (name) + * @tc.desc Function test + */ + it("contact_fuzzyquery_test_400", 0, async function (done) { + console.info("--------logMessage contact_fuzzyquery_test_400 is starting!-------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + var rawContactValues = { + "display_name": "400xiaoming400" + }; + try { + var rawContactId = await DAHelper.insert(rawContactUri, rawContactValues); + sleep(1000); + console.info('logMessage contact_fuzzyquery_test_400 rawContactId = ' + rawContactId); + expect(rawContactId > 0).assertTrue(); + await rawContactNameQuery(); + await deleteRawContact("contact_fuzzyquery_test_400"); + done(); + } catch (error) { + console.info('logMessage contact_fuzzyquery_test_400 raw_contact insert error = ' + error); + done(); + } + + async function rawContactNameQuery() { + var resultColumns = ["id", "display_name"]; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.like("display_name", "%xiaoming40%"); + condition.and(); + condition.equalTo("is_deleted", "0"); + try { + var resultSet = await DAHelper.query(rawContactUri, resultColumns, condition); + if (resultSet.goToFirstRow()) { + do { + console.info('logMessage contact_fuzzyquery_test_400: id = ' + resultSet.getString(0)); + expect(resultSet.getString(0) == rawContactId.toString()).assertEqual(true); + console.info( + 'logMessage contact_fuzzyquery_test_400: displayName = ' + resultSet.getString(1)); + expect(resultSet.getString(1) == "400xiaoming400").assertEqual(true); + } while (resultSet.goToNextRow()); + } + resultSet.close(); + } catch (error) { + console.info('logMessage contact_fuzzyquery_test_400 query error = ' + error); + done(); + } + } + }); + + /** + * @tc.number contact_fuzzyquery_test_500 + * @tc.name Contact fuzzy search query interface (name pinyin, pinyin name) + * @tc.desc Function test + */ + it("contact_fuzzyquery_test_500", 0, async function (done) { + console.info("--------logMessage contact_fuzzyquery_test_500 is starting!-------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + var rawContactValues = { + "display_name": "500xiaoming500", "phonetic_name": "500xiaoming500||xm" + }; + try { + var rawContactId = await DAHelper.insert(rawContactUri, rawContactValues); + sleep(1000); + console.info('logMessage contact_fuzzyquery_test_500 rawContactId = ' + rawContactId); + expect(rawContactId > 0).assertTrue(); + await rawContactPhoneticNameQuery(); + await deleteRawContact("contact_fuzzyquery_test_500"); + done(); + } catch (error) { + console.info('logMessage contact_fuzzyquery_test_500 raw_contact insert error = ' + error); + done(); + } + + async function rawContactPhoneticNameQuery() { + var resultColumns = ["id", "display_name", "phonetic_name"]; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.like("phonetic_name", "%xiaoming%"); + condition.and(); + condition.equalTo("is_deleted", "0"); + condition.or(); + condition.like("phonetic_name", "%xm%"); + condition.and(); + condition.equalTo("is_deleted", "0"); + try { + var resultSet = await DAHelper.query(rawContactUri, resultColumns, condition); + if (resultSet.goToFirstRow()) { + do { + console.info('logMessage contact_fuzzyquery_test_500: id = ' + resultSet.getString(0)); + expect(resultSet.getString(0) == rawContactId.toString()).assertTrue(); + console.info( + 'logMessage contact_fuzzyquery_test_500: displayName = ' + resultSet.getString(1)); + expect(resultSet.getString(1) == "500xiaoming500").assertTrue(); + console.info( + 'logMessage contact_fuzzyquery_test_500: phoneticName = ' + resultSet.getString(2)); + expect(resultSet.getString(2) == "500xiaoming500||xm").assertTrue(); + } while (resultSet.goToNextRow()); + } + resultSet.close(); + } catch (error) { + console.info('logMessage contact_fuzzyquery_test_500 query error = ' + error); + done(); + } + } + }); + + /** + * @tc.number contact_fuzzyquery_test_600 + * @tc.name Contact fuzzy search query interface (company, position) + * @tc.desc Function test + */ + it("contact_fuzzyquery_test_600", 0, async function (done) { + console.info("--------logMessage contact_fuzzyquery_test_600 is starting!-------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + var rawContactValues = { + "display_name": "xiaoming", "company": "TT600", "position": "Testers600" + }; + try { + var rawContactId = await DAHelper.insert(rawContactUri, rawContactValues); + sleep(1000); + console.info('logMessage contact_fuzzyquery_test_600 rawContactId = ' + rawContactId); + expect(rawContactId > 0).assertTrue(); + await rawContactCompanyQuery(DAHelper, rawContactId); + await deleteRawContact("contact_fuzzyquery_test_600"); + done(); + } catch (error) { + console.info('logMessage contact_fuzzyquery_test_600 raw_contact insert error = ' + error); + done(); + } + }); + + async function rawContactCompanyQuery(DAHelper, rawContactId) { + var resultColumns = ["id", "display_name", "company", "position"]; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.like("company", "%TT6%"); + condition.and(); + condition.equalTo("is_deleted", "0"); + condition.or(); + condition.like("position", "%Testers6%"); + condition.and(); + condition.equalTo("is_deleted", "0"); + try { + var resultSet = await DAHelper.query(rawContactUri, resultColumns, condition); + if (resultSet.goToFirstRow()) { + do { + console.info('logMessage contact_fuzzyquery_test_600: id = ' + resultSet.getString(0)); + expect(resultSet.getString(0) == rawContactId.toString()).assertEqual(true); + console.info('logMessage contact_fuzzyquery_test_600: displayName = ' + resultSet.getString(1)); + expect(resultSet.getString(1) == "xiaoming").assertEqual(true); + console.info('logMessage contact_fuzzyquery_test_600: company = ' + resultSet.getString(2)); + expect(resultSet.getString(2) == "TT600").assertEqual(true); + console.info('logMessage contact_fuzzyquery_test_600: position = ' + resultSet.getString(3)); + expect(resultSet.getString(3) == "Testers600").assertEqual(true); + } while (resultSet.goToNextRow()); + } + resultSet.close(); + } catch (error) { + console.info('logMessage contact_fuzzyquery_test_600 query error = ' + error); + } + } + + /** + * @tc.number contact_fuzzyquery_test_700 + * @tc.name Contact fuzzy search query interface (mobile phone number) + * @tc.desc Function test + */ + it("contact_fuzzyquery_test_700", 0, async function (done) { + console.info("--------logMessage contact_fuzzyquery_test_700 is starting!-------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + var rawContactValues = { + "display_name": "xiaoming" + }; + try { + var rawContactId = await DAHelper.insert(rawContactUri, rawContactValues); + sleep(1000); + console.info('logMessage contact_fuzzyquery_test_700 rawContactId = ' + rawContactId); + expect(rawContactId > 0).assertTrue(); + await contactDataPhoneInsert(); + await deleteRawContact("contact_fuzzyquery_test_700"); + await deleteAll(contactDataUri, "contact_fuzzyquery_test_700"); + done(); + } catch (error) { + console.info('logMessage contact_fuzzyquery_test_700 raw_contact insert error = ' + error); + done(); + } + + async function contactDataPhoneInsert() { + var contactDataValues = { + "raw_contact_id": rawContactId, + "content_type": "phone", + "detail_info": "14528963" + }; + try { + var contactDataId = await DAHelper.insert(contactDataUri, contactDataValues); + sleep(1000); + console.info('logMessage contact_fuzzyquery_test_700 contactDataId = ' + contactDataId); + expect(contactDataId > 0).assertTrue(); + await fuzzyQueryPhone(DAHelper, rawContactId, contactDataId); + } catch (error) { + console.info('logMessage contact_fuzzyquery_test_700 contact_data insert error = ' + contactDataId); + done(); + } + } + }); + + async function fuzzyQueryPhone(DAHelper, rawContactId, contactDataId) { + var resultColumns = ["id", "raw_contact_id", "detail_info"]; + var condition = new ohosDataAbility.DataAbilityPredicates(); + // type_id = 5 data is phone + condition.like("detail_info", "%52896%"); + condition.and(); + condition.equalTo("type_id", "5"); + try { + var resultSet = await DAHelper.query(contactDataUri, resultColumns, condition); + sleep(1000); + if (resultSet.goToFirstRow()) { + do { + console.info('logMessage contact_fuzzyquery_test_700: id = ' + resultSet.getString(0)); + expect(resultSet.getString(0) == contactDataId.toString()).assertEqual(true); + console.info('logMessage contact_fuzzyquery_test_700: raw_contact_id = ' + resultSet.getString(1)); + expect(resultSet.getString(1) == rawContactId.toString()).assertEqual(true); + console.info('logMessage contact_fuzzyquery_test_700: detail_info = ' + resultSet.getString(2)); + expect(resultSet.getString(2) == "14528963").assertEqual(true); + } while (resultSet.goToNextRow()); + } + resultSet.close(); + } catch (error) { + console.info('logMessage contact_fuzzyquery_test_700 query error = ' + error); + } + } + + /** + * @tc.number contact_fuzzyquery_test_800 + * @tc.name Contact fuzzy search query interface (nickname) + * @tc.desc Function test + */ + it("contact_fuzzyquery_test_800", 0, async function (done) { + console.info("--------logMessage contact_fuzzyquery_test_800 is starting!-------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + var rawContactValues = { + "display_name": "xiaoming" + }; + try { + var rawContactId = await DAHelper.insert(rawContactUri, rawContactValues); + sleep(1000); + console.info('logMessage contact_fuzzyquery_test_800 rawContactId = ' + rawContactId); + expect(rawContactId > 0).assertTrue(); + await contactNickNameInsert(); + await deleteRawContact("contact_fuzzyquery_test_800"); + await deleteAll(contactDataUri, "contact_fuzzyquery_test_800"); + done(); + } catch (error) { + console.info('logMessage contact_fuzzyquery_test_800 raw_contact insert error = ' + error); + done(); + } + + async function contactNickNameInsert() { + var contactDataValues = { + "raw_contact_id": rawContactId, + "content_type": "nickname", + "detail_info": "daming" + }; + try { + var contactDataId = await DAHelper.insert(contactDataUri, contactDataValues); + console.info('logMessage contact_fuzzyquery_test_800 contactDataId = ' + contactDataId); + expect(contactDataId > 0).assertTrue(); + await fuzzyQueryPhoneNickName(DAHelper, rawContactId, contactDataId); + } catch (error) { + console.info('logMessage contact_fuzzyquery_test_800 contact_data insert error = ' + contactDataId); + done(); + } + } + }); + + async function fuzzyQueryPhoneNickName(DAHelper, rawContactId, contactDataId) { + var resultColumns = ["id", "raw_contact_id", "detail_info"]; + var condition = new ohosDataAbility.DataAbilityPredicates(); + // type_id = 3 data is nickname + condition.like("detail_info", "%daming%"); + condition.and(); + condition.equalTo("type_id", "3"); + try { + var resultSet = await DAHelper.query(contactDataUri, resultColumns, condition); + sleep(1000); + if (resultSet.goToFirstRow()) { + do { + console.info('logMessage contact_fuzzyquery_test_800: id = ' + resultSet.getString(0)); + expect(resultSet.getString(0) == contactDataId.toString()).assertTrue(); + console.info('logMessage contact_fuzzyquery_test_800: raw_contact_id = ' + resultSet.getString(1)); + expect(resultSet.getString(1) == rawContactId.toString()).assertTrue(); + console.info('logMessage contact_fuzzyquery_test_800: detail_info = ' + resultSet.getString(2)); + expect(resultSet.getString(2) == "daming").assertTrue(); + } while (resultSet.goToNextRow()); + } + resultSet.close(); + } catch (error) { + console.info('logMessage contact_fuzzyquery_test_800 query error = ' + error); + } + } + + /** + * @tc.number contact_fuzzyquery_test_900 + * @tc.name Contact fuzzy search query interface (mailbox) + * @tc.desc Function test + */ + it("contact_fuzzyquery_test_900", 0, async function (done) { + console.info("--------logMessage contact_fuzzyquery_test_900 is starting!-------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + var rawContactValues = { + "display_name": "xiaoming" + }; + try { + var rawContactId = await DAHelper.insert(rawContactUri, rawContactValues); + sleep(1000); + console.info('logMessage contact_fuzzyquery_test_900 rawContactId = ' + rawContactId); + expect(rawContactId > 0).assertTrue(); + await contactDataEmailInsert(); + await deleteRawContact("contact_fuzzyquery_test_900"); + await deleteAll(contactDataUri, "contact_fuzzyquery_test_900"); + done(); + } catch (error) { + console.info('logMessage contact_fuzzyquery_test_900 raw_contact insert error = ' + error); + done(); + } + + async function contactDataEmailInsert() { + var contactDataValues = { + "raw_contact_id": rawContactId, + "content_type": "email", + "detail_info": "1564@163.com" + }; + try { + var contactDataId = await DAHelper.insert(contactDataUri, contactDataValues); + console.info('logMessage contact_fuzzyquery_test_900 ; = ' + contactDataId); + expect(contactDataId > 0).assertTrue(); + await fuzzyQueryEmail(DAHelper, rawContactId, contactDataId); + } catch (error) { + console.info('logMessage contact_fuzzyquery_test_900 contact_data insert error = ' + error); + done(); + } + } + }); + + async function fuzzyQueryEmail(DAHelper, rawContactId, contactDataId) { + var resultColumns = ["id", "raw_contact_id", "detail_info"]; + var condition = new ohosDataAbility.DataAbilityPredicates(); + // type_id = 1 data is email + condition.like("detail_info", "%1564%"); + condition.and(); + condition.equalTo("type_id", "1"); + try { + var resultSet = await DAHelper.query(contactDataUri, resultColumns, condition); + sleep(1000); + if (resultSet.goToFirstRow()) { + do { + console.info('logMessage contact_fuzzyquery_test_900: id = ' + resultSet.getString(0)); + expect(resultSet.getString(0) == contactDataId.toString()).assertTrue(); + console.info('logMessage contact_fuzzyquery_test_900: raw_contact_id = ' + resultSet.getString(1)); + expect(resultSet.getString(1) == rawContactId.toString()).assertTrue(); + console.info('logMessage contact_fuzzyquery_test_900: detail_info = ' + resultSet.getString(2)); + expect(resultSet.getString(2) == "1564@163.com").assertTrue(); + } while (resultSet.goToNextRow()); + } + resultSet.close(); + } catch (error) { + console.info('logMessage contact_fuzzyquery_test_900 query error = ' + error); + } + } + + /** + * @tc.number contact_fuzzyquery_test_1000 + * @tc.name Contact fuzzy search query interface (residential) + * @tc.desc Function test + */ + it("contact_fuzzyquery_test_1000", 0, async function (done) { + console.info("--------logMessage contact_fuzzyquery_test_1000 is starting!-------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + var rawContactValues = { + "display_name": "xiaoming" + }; + try { + var rawContactId = await DAHelper.insert(rawContactUri, rawContactValues); + sleep(1000); + console.info('logMessage contact_fuzzyquery_test_1000 rawContactId = ' + rawContactId); + expect(rawContactId > 0).assertTrue(); + await contactDataPostalInsert(); + await deleteRawContact("contact_fuzzyquery_test_1000"); + await deleteAll(contactDataUri, "contact_fuzzyquery_test_1000"); + done(); + } catch (error) { + console.info('logMessage contact_fuzzyquery_test_1000 raw_contact insert error = ' + error); + done(); + } + + async function contactDataPostalInsert() { + var contactDataValues = { + "raw_contact_id": rawContactId, + "content_type": "postal_address", + "detail_info": "nanjing1000" + }; + try { + var contactDataId = await DAHelper.insert(contactDataUri, contactDataValues); + sleep(1000); + console.info('logMessage contact_fuzzyquery_test_1000 contactDataId = ' + contactDataId); + expect(contactDataId > 0).assertTrue(); + await fuzzyQueryAddress(DAHelper, rawContactId, contactDataId); + } catch (error) { + console.info('logMessage contact_fuzzyquery_test_1000 contact_data insert error = ' + error); + done(); + } + } + }); + + async function fuzzyQueryAddress(DAHelper, rawContactId, contactDataId) { + var resultColumns = ["id", "raw_contact_id", "detail_info"]; + var condition = new ohosDataAbility.DataAbilityPredicates(); + // type_id = 1 data is postal_address + condition.like("detail_info", "%nanjing10%"); + condition.and(); + condition.equalTo("type_id", "7"); + try { + var resultSet = await DAHelper.query(contactDataUri, resultColumns, condition); + sleep(1000); + if (resultSet.goToFirstRow()) { + do { + console.info('logMessage contact_fuzzyquery_test_1000: id = ' + resultSet.getString(0)); + expect(resultSet.getString(0) == contactDataId.toString()).assertTrue(); + console.info('logMessage contact_fuzzyquery_test_1000: raw_contact_id = ' + resultSet.getString(1)); + expect(resultSet.getString(1) == rawContactId.toString()).assertTrue(); + console.info('logMessage contact_fuzzyquery_test_1000: detail_info = ' + resultSet.getString(2)); + expect(resultSet.getString(2) == "nanjing1000").assertTrue(); + } while (resultSet.goToNextRow()); + } + resultSet.close(); + } catch (error) { + console.info('logMessage contact_fuzzyquery_test_1000: query error' + error); + } + } + + /** + * @tc.number contact_fuzzyquery_test_1100 + * @tc.name Contact fuzzy search query interface (remarks) + * @tc.desc Function test + */ + it("contact_fuzzyquery_test_1100", 0, async function (done) { + console.info("--------logMessage contact_fuzzyquery_test_1100 is starting!-------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + var rawContactValues = { + "display_name": "xiaoming" + }; + try { + var rawContactId = await DAHelper.insert(rawContactUri, rawContactValues); + sleep(1000); + console.info('logMessage contact_fuzzyquery_test_1100 rawContactId = ' + rawContactId); + expect(rawContactId > 0).assertTrue(); + await contactDataNoteInsert(); + await deleteRawContact("contact_fuzzyquery_test_1100"); + await deleteAll(contactDataUri, "contact_fuzzyquery_test_1100"); + done(); + } catch (error) { + console.info('logMessage contact_fuzzyquery_test_1100 raw_contact insert error = ' + error); + done(); + } + + async function contactDataNoteInsert() { + var contactDataValues = { + "raw_contact_id": rawContactId, + "content_type": "note", + "detail_info": "java1100" + }; + try { + var contactDataId = await DAHelper.insert(contactDataUri, contactDataValues); + sleep(1000); + console.info('logMessage contact_fuzzyquery_test_1100 contactDataId = ' + contactDataId); + expect(contactDataId > 0).assertTrue(); + await fuzzyQueryNote(DAHelper, rawContactId, contactDataId); + } catch (error) { + console.info('logMessage contact_fuzzyquery_test_1100 contact_data insert error = ' + error); + done(); + } + } + }); + + async function fuzzyQueryNote(DAHelper, rawContactId, contactDataId) { + var resultColumns = ["id", "raw_contact_id", "detail_info"]; + var condition = new ohosDataAbility.DataAbilityPredicates(); + // type_id = 10 data is note + condition.like("detail_info", "%java11%"); + condition.and(); + condition.equalTo("type_id", "10"); + try { + var resultSet = await DAHelper.query(contactDataUri, resultColumns, condition); + if (resultSet.goToFirstRow()) { + do { + console.info('logMessage contact_fuzzyquery_test_1100: id = ' + resultSet.getString(0)); + expect(resultSet.getString(0) == contactDataId.toString()).assertEqual(true); + console.info('logMessage contact_fuzzyquery_test_1100: raw_contact_id = ' + resultSet.getString(1)); + expect(resultSet.getString(1) == rawContactId.toString()).assertEqual(true); + console.info('logMessage contact_fuzzyquery_test_1100: detail_info = ' + resultSet.getString(2)); + expect(resultSet.getString(2) == "java1100").assertEqual(true); + } while (resultSet.goToNextRow()); + } + resultSet.close(); + } catch (error) { + console.info('logMessage contact_fuzzyquery_test_1100: query error' + error); + } + } + + /** + * @tc.number contact_fuzzyquery_test_1200 + * @tc.name Contact fuzzy search query interface (AIM) + * @tc.desc Function test + */ + it("contact_fuzzyquery_test_1200", 0, async function (done) { + console.info("--------logMessage contact_fuzzyquery_test_1200 is starting!-------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + var rawContactValues = { + "display_name": "xiaoming" + }; + try { + var rawContactId = await DAHelper.insert(rawContactUri, rawContactValues); + console.info('logMessage contact_fuzzyquery_test_1200 rawContactId = ' + rawContactId); + expect(rawContactId > 0).assertTrue(); + await contactDataAimInsert(); + await deleteRawContact("contact_fuzzyquery_test_1200"); + await deleteAll(contactDataUri, "contact_fuzzyquery_test_1200"); + done(); + } catch (error) { + console.info('logMessage contact_fuzzyquery_test_1200 raw_contact insert error = ' + error); + done(); + } + + async function contactDataAimInsert() { + var contactDataValues = { + "raw_contact_id": rawContactId, + "content_type": "im", + "detail_info": "aaaa1200" + }; + try { + var contactDataId = await DAHelper.insert(contactDataUri, contactDataValues); + console.info('logMessage contact_fuzzyquery_test_1200 ; = ' + contactDataId); + expect(contactDataId > 0).assertTrue(); + await fuzzyQueryIM(DAHelper, rawContactId, contactDataId); + } catch (error) { + console.info('logMessage contact_fuzzyquery_test_1200 contact_data insert error = ' + error); + done(); + } + } + }); + + async function fuzzyQueryIM(DAHelper, rawContactId, contactDataId) { + var resultColumns = ["id", "raw_contact_id", "detail_info"]; + var condition = new ohosDataAbility.DataAbilityPredicates(); + // type_id = 10 data is im account number + condition.like("detail_info", "%aa12%"); + condition.and(); + condition.equalTo("type_id", "2"); + try { + var resultSet = await DAHelper.query(contactDataUri, resultColumns, condition); + if (resultSet.goToFirstRow()) { + do { + console.info('logMessage contact_fuzzyquery_test_1200: id = ' + resultSet.getString(0)); + expect(resultSet.getString(0) == contactDataId.toString()).assertEqual(true); + console.info('logMessage contact_fuzzyquery_test_1200: raw_contact_id = ' + resultSet.getString(1)); + expect(resultSet.getString(1) == rawContactId.toString()).assertEqual(true); + console.info('logMessage contact_fuzzyquery_test_1200: detail_info = ' + resultSet.getString(2)); + expect(resultSet.getString(2) == "aaaa1200").assertEqual(true); + } while (resultSet.goToNextRow()); + } + resultSet.close(); + } catch (error) { + console.info('logMessage contact_fuzzyquery_test_1200: query error' + error); + } + } + + /** + * @tc.number abnormal_contact_insert_test_200 + * @tc.name Abnormal use case, an incorrect field is passed in when inserting + * @tc.desc Function test + */ + it("abnormal_contact_insert_test_200", 0, async function (done) { + console.info("------------abnormal_contact_insert_test_200 is starting!-----------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + var rawContactValues = { + "display_names": "xiaoshan" + }; + try { + var rawContactId = await DAHelper.insert(rawContactUri, rawContactValues); + console.info("logMessage abnormal_contact_insert_test_200: rawContactId = " + rawContactId); + expect(rawContactId).assertEqual(-1); + done(); + } catch (error) { + console.info('logMessage abnormal_contact_insert_test_200: raw_contact insert error' + error); + done(); + } + }); + + /** + * @tc.number abnormal_contact_insert_test_300 + * @tc.name Abnormal use case, an incorrect table name is passed in when inserting + * @tc.desc Function test + */ + it("abnormal_contact_insert_test_300", 0, async function (done) { + console.info("------------abnormal_contact_insert_test_300 is starting!-----------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + var errorUri = "dataability:///com.ohos.calllogability/contacts/raw_contacts"; + + var rawContactValues = { + "display_name": "xiaoshan" + }; + try { + var rawContactId = await DAHelper.insert(errorUri, rawContactValues); + console.info("logMessage abnormal_contact_insert_test_300: rawContactId = " + rawContactId); + expect(rawContactId == -1).assertTrue(); + done(); + } catch (error) { + console.info('logMessage abnormal_contact_insert_test_300: raw_contact insert error' + error); + done(); + } + }); + + /** + * @tc.number abnormal_contact_update_test_1100 + * @tc.name Abnormal use case, an incorrect field is passed in when updating + * @tc.desc Function test + */ + it("abnormal_contact_update_test_1100", 0, async function (done) { + console.info("------------abnormal_contact_update_test_1100 is starting!-----------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + var rawContactValues = { + "display_name": "xiaoshan" + }; + try { + var rawContactId = await DAHelper.insert(rawContactUri, rawContactValues); + console.info("logMessage abnormal_contact_update_test_1100: rawContactId = " + rawContactId); + expect(rawContactId > 0).assertTrue(); + await abnormalUpdate(); + await deleteRawContact("abnormal_contact_update_test_1100"); + done(); + } catch (error) { + console.info('logMessage abnormal_contact_update_test_1100: raw_contact insert error' + error); + done(); + } + + async function abnormalUpdate() { + var updateValues = { + "display_names": "xiaosan" + }; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("ids", rawContactId.toString()); + try { + var updataCode = await DAHelper.update(rawContactUri, updateValues, condition) + console.info("logMessage abnormal_contact_update_test_1100: updataCode = " + updataCode); + expect(updataCode == -1).assertTrue(); + var map = new Map(); + map.set("id", rawContactId.toString()); + map.set("display_name", "xiaoshan"); + await contactsQuery(map, "abnormal_contact_update_test_1100", rawContactUri); + } catch (error) { + console.info('logMessage abnormal_contact_update_test_1100: update error' + error); + done(); + } + } + }); + + /** + * @tc.number abnormal_contact_update_test_1000 + * @tc.name Abnormal use case, an incorrect table name is passed in when updating + * @tc.desc Function test + */ + it("abnormal_contact_update_test_1000", 0, async function (done) { + console.info("------------abnormal_contact_update_test_1000 is starting!-----------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + var errorUri = "dataability:///com.ohos.calllogability/contacts/raw_contacts"; + + var rawContactValues = { + "display_name": "xiaoshan" + }; + try { + var rawContactId = await DAHelper.insert(rawContactUri, rawContactValues); + console.info("logMessage abnormal_contact_update_test_1000: rawContactId = " + rawContactId); + expect(rawContactId > 0).assertTrue(); + await abnormalUpdate(); + await deleteRawContact("abnormal_contact_update_test_1000"); + done(); + } catch (error) { + console.info('logMessage abnormal_contact_update_test_1000: raw_contact insert error' + error); + done(); + } + + async function abnormalUpdate() { + var updateValues = { + "display_name": "xiaosan" + }; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("id", rawContactId.toString()); + try { + var updataCode = await DAHelper.update(errorUri, updateValues, condition); + console.info("logMessage abnormal_contact_update_test_1000: updataCode = " + updataCode); + expect(updataCode == -1).assertTrue(); + var map = new Map(); + map.set("id", rawContactId.toString()); + map.set("display_name", "xiaoshan"); + await contactsQuery(map, "abnormal_contact_update_test_1000", rawContactUri); + } catch (error) { + console.info("logMessage abnormal_contact_update_test_1000: updata error = " + error); + done(); + } + } + }); + + /** + * @tc.number abnormal_contact_delete_test_4500 + * @tc.name Abnormal use case, an incorrect field is passed in when deleting + * @tc.desc Function test + */ + it("abnormal_contact_delete_test_4500", 0, async function (done) { + console.info("------------abnormal_contact_delete_test_4500 is starting!-----------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + var rawContactValues = { + "display_name": "xiaozhi" + }; + try { + var rawContactId = await DAHelper.insert(rawContactUri, rawContactValues); + console.info("logMessage abnormal_contact_delete_test_4500: rawContactId = " + rawContactId); + expect(rawContactId > 0).assertTrue(); + await abnormalDelete(); + await deleteRawContact("abnormal_contact_delete_test_4500"); + done(); + } catch (error) { + console.info('logMessage abnormal_contact_delete_test_4500: raw_contact insert error' + error); + done(); + } + + async function abnormalDelete() { + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("ids", rawContactId.toString()); + try { + var deleteCode = await DAHelper.delete(rawContactUri, condition); + console.info("logMessage abnormal_contact_delete_test_4500: deleteCode = " + deleteCode); + expect(deleteCode == -1).assertTrue(); + var map = new Map(); + map.set("id", rawContactId.toString()); + map.set("display_name", "xiaozhi"); + await contactsQuery(map, "abnormal_contact_delete_test_4500", rawContactUri); + done(); + } catch (error) { + console.info('logMessage abnormal_contact_delete_test_4500: delete error' + error); + done(); + } + } + }); + + /** + * @tc.number abnormal_contact_delete_test_4600 + * @tc.name Abnormal use case, an incorrect table name is passed in when deleting + * @tc.desc Function test + */ + it("abnormal_contact_delete_test_4600", 0, async function (done) { + console.info("------------abnormal_contact_delete_test_4600 is starting!-----------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + var errorUri = "dataability:///com.ohos.calllogability/contacts/raw_contacts"; + + var rawContactValues = { + "display_name": "xiaoshan" + }; + try { + var rawContactId = await DAHelper.insert(rawContactUri, rawContactValues); + console.info("logMessage abnormal_contact_delete_test_4600: rawContactId = " + rawContactId); + expect(rawContactId > 0).assertTrue(); + await abnormalDelete(); + await deleteRawContact("abnormal_contact_delete_test_4600"); + done(); + } catch (error) { + console.info('logMessage abnormal_contact_delete_test_4600: raw_contact insert error' + error); + done(); + } + + async function abnormalDelete() { + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("id", rawContactId.toString()); + try { + var deleteCode = await DAHelper.delete(errorUri, condition); + console.info("logMessage abnormal_contact_delete_test_4600: deleteCode = " + deleteCode); + expect(deleteCode == -1).assertTrue(); + var map = new Map(); + map.set("id", rawContactId.toString()); + map.set("display_name", "xiaoshan"); + await contactsQuery(map, "abnormal_contact_delete_test_4600", rawContactUri); + done(); + } catch (error) { + console.info('logMessage abnormal_contact_delete_test_4600: delete error' + error); + done(); + } + } + }); + + /** + * @tc.number abnormal_contact_query_test_4200 + * @tc.name Abnormal use case, an incorrect field is passed in when querying + * @tc.desc Function test + */ + it("abnormal_contact_query_test_4200", 0, async function (done) { + console.info("------------abnormal_contact_query_test_4200 is starting!-----------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + var rawContactValues = { + "display_name": "xiaozhicheng" + }; + try { + var rawContactId = await DAHelper.insert(rawContactUri, rawContactValues); + console.info("logMessage abnormal_contact_query_test_4200: rawContactId = " + rawContactId); + expect(rawContactId > 0).assertTrue(); + await abnormalQuery(); + await deleteRawContact("abnormal_contact_query_test_4200"); + done(); + } catch (error) { + console.info('logMessage abnormal_contact_query_test_4200: raw_contact insert error' + error); + done(); + } + + async function abnormalQuery() { + var resultColumns = ["id", "display_name"]; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("ids", rawContactId.toString()); + try { + var resultSet = await DAHelper.query(rawContactUri, resultColumns, condition); + expect(resultSet.goToFirstRow()).assertEqual(false); + console.info('logMessage abnormal_contact_query_test_4200: goToFirstRow' + resultSet.goToFirstRow()); + resultSet.close(); + } catch (error) { + console.info('logMessage abnormal_contact_query_test_4200: query error = ' + error); + done(); + } + } + }); + + /** + * @tc.number abnormal_contact_batchinsert_test_5100 + * @tc.name Abnormal use cases, when adding data in batches, some of them failed, check the processing logic + * @tc.desc Function test + */ + it("abnormal_contact_batchinsert_test_5100", 0, async function (done) { + console.info("--------logMessage abnormal_contact_batchinsert_test_5100 is starting!------------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + var addBulkValue1 = { + "display_name": "zhangsan" + }; + var addBulkValue2 = { + "display_names": "lisi" + }; + var addBulkValue3 = { + "display_name": "wangwu" + }; + var addBulkValue4 = { + "display_names": "laoliu" + }; + var addBulkValue5 = { + "display_name": "xiaozhang" + }; + var listAddBluk = []; + listAddBluk[0] = addBulkValue1; + listAddBluk[1] = addBulkValue2; + listAddBluk[2] = addBulkValue3; + listAddBluk[3] = addBulkValue4; + listAddBluk[4] = addBulkValue5; + try { + var batchInsertCode = await DAHelper.batchInsert(rawContactUri, listAddBluk); + console.info("logMessage abnormal_contact_batchinsert_test_5100: batchInsertCode = " + batchInsertCode); + expect(batchInsertCode == -1).assertTrue(); + done(); + } catch (error) { + console.info("logMessage abnormal_contact_batchinsert_test_5100: batch insert error = " + error); + done(); + } + }); + + /** + * @tc.number abnormal_contact_insert_data_5300 + * @tc.name insert_data error no rawContactId + * @tc.desc Function test + */ + it("abnormal_contact_insert_data_5300", 0, async function (done) { + console.info("--------logMessage abnormal_contact_insert_data_5300 is starting!-------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + var rawContactValues = { + "display_name": "xiaotian" + }; + try { + var rawContactId = await DAHelper.insert(rawContactUri, rawContactValues); + sleep(1000); + console.info('logMessage abnormal_contact_insert_data_5300 rawContactId = ' + rawContactId); + expect(rawContactId > 0).assertTrue(); + await contactDataAimInsert(); + await deleteRawContact("abnormal_contact_insert_data_5300"); + done(); + } catch (error) { + console.info('logMessage abnormal_contact_insert_data_5300 raw_contact insert error = ' + error); + done(); + } + + async function contactDataAimInsert() { + var contactDataValues = { + "content_type": "im", "detail_info": "aaaa" + }; + try { + var contactDataId = await DAHelper.insert(contactDataUri, contactDataValues); + console.info('logMessage abnormal_contact_insert_data_5300 ; = ' + contactDataId); + expect(contactDataId == -1).assertTrue(); + } catch (error) { + console.info('logMessage abnormal_contact_insert_data_5300 contact_data insert error = ' + error); + done(); + } + } + }); + + /** + * @tc.number abnormal_contact_insert_data_5400 + * @tc.name insert_data error no content_type + * @tc.desc Function test + */ + it("abnormal_contact_insert_data_5400", 0, async function (done) { + console.info("--------logMessage abnormal_contact_insert_data_5400 is starting!-------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + var rawContactValues = { + "display_name": "xiaotian" + }; + try { + var rawContactId = await DAHelper.insert(rawContactUri, rawContactValues); + console.info('logMessage abnormal_contact_insert_data_5400 rawContactId = ' + rawContactId); + expect(rawContactId > 0).assertTrue(); + await contactDataAimInsert(); + await deleteRawContact("abnormal_contact_insert_data_5400"); + done(); + } catch (error) { + console.info('logMessage abnormal_contact_insert_data_5400 raw_contact insert error = ' + error); + done(); + } + + async function contactDataAimInsert() { + var contactDataValues = { + "raw_contact_id": rawContactId, "detail_info": "aaaa" + }; + try { + var contactDataId = await DAHelper.insert(contactDataUri, contactDataValues); + console.info('logMessage abnormal_contact_insert_data_5400 ; = ' + contactDataId); + expect(contactDataId == -1).assertTrue(); + } catch (error) { + console.info('logMessage abnormal_contact_insert_data_5400 contact_data insert error = ' + error); + done(); + } + } + }); + + /** + * @tc.number contact_delete_test_5500 + * @tc.name batchDelete + * @tc.desc Function test + */ + it("contact_delete_test_5500", 0, async function (done) { + console.info("--------logMessage contact_delete_test_5500 is starting!------------"); + if(utils.notCheck){ + expect(true).assertTrue(); + done(); + return; + } + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + try { + var rawContactId = await DAHelper.insert(rawContactUri, common.getProfileRawContact()); + console.info("logMessage contact_delete_test_5500: rawContactId = " + rawContactId); + expect(rawContactId > 0).assertTrue(); + var map = common.getProfileRawContactMap(); + map.set("id", rawContactId.toString()); + await contactsQuery(map, "contact_delete_test_5500", rawContactUri); + await executeBatch(); + } catch (error) { + console.info("logMessage contact_delete_test_5500: insert error = " + error); + done(); + } + async function executeBatch() { + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("id", rawContactId.toString()); + DAHelper.executeBatch(URI_CONTACTS, [{ + uri: rawContactUri, + type: featureAbility.DataAbilityOperationType.TYPE_DELETE, + predicates: condition, + expectedCount: 0, + PredicatesBackReferences: {}, + interrupted: true, + }], + (error, data) => { + console.info("logMessage contact_delete_test_5500: executeBatch data = " + JSON.stringify(data)); + console.info("logMessage contact_delete_test_5500: data_3 = " + data); + console.info("logMessage contact_delete_test_5500: data_1= " + data[0].count); + expect(data[0].count == 0).assertTrue(); + done(); + }); + } + }); + + /** + * @tc.number contact_update_test_5600 + * @tc.name batchUpdate + * @tc.desc Function test + */ + it("contact_update_test_5600", 0, async function (done) { + console.info("--------logMessage contact_update_test_5600 is starting!------------"); + if(utils.notCheck){ + expect(true).assertTrue(); + done(); + return; + } + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + try { + var rawContactId = await DAHelper.insert(rawContactUri, common.getProfileRawContact()); + console.info("logMessage contact_update_test_5600: rawContactId = " + rawContactId); + expect(rawContactId > 0).assertTrue(); + var map = common.getProfileRawContactMap(); + map.set("id", rawContactId.toString()); + await contactsQuery(map, "contact_update_test_5600", rawContactUri); + await executeBatch(); + } catch (error) { + console.info("logMessage contact_update_test_5600: insert error = " + error); + done(); + } + + async function executeBatch() { + var updateValues = { + "display_name": "xiaoxiaoxiao" + }; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("id", rawContactId.toString()); + DAHelper.executeBatch(URI_CONTACTS, [{ + uri: rawContactUri, + type: featureAbility.DataAbilityOperationType.TYPE_UPDATE, + valuesBucket: updateValues, + predicates: condition, + expectedCount: 0, + PredicatesBackReferences: {}, + interrupted: true, + }], + (error, data) => { + console.info("logMessage contact_update_test_5600: executeBatch data = " + JSON.stringify(data)); + console.info("logMessage contact_update_test_5600: data_3 = " + data); + console.info("logMessage contact_update_test_5600: data_1= " + data[0].count); + expect(data[0].count == 0).assertTrue(); + done(); + }); + } + }); + + /** + * @tc.number contact_insert_test_5700 + * @tc.name Insert Multiple raw_contact essential information + * @tc.desc Function test + */ + it("contact_insert_test_5700", 0, async function (done) { + console.info("------logMessage contact_insert_test_5700 is starting!-----"); + if(utils.notCheck){ + expect(true).assertTrue(); + done(); + return; + } + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + try { + var rawContactId = await DAHelper.insert(rawContactUri, common.getProfileRawContact()); + sleep(1000); + console.info('logMessage contact_insert_test_5700: rawContactId = ' + rawContactId); + expect(rawContactId > 0).assertTrue(); + var map = common.getProfileRawContactMap(); + map.set("id", rawContactId.toString()); + await contactsQuery(map, "contact_insert_test_5700", rawContactUri); + var rawContactIdOne = await DAHelper.insert(rawContactUri, common.getProfileRawContact()); + sleep(1000); + console.info('logMessage contact_insert_test_5700: rawContactIdOne = ' + rawContactIdOne); + expect(rawContactIdOne > 0).assertTrue(); + var map = common.getProfileRawContactMap(); + map.set("id", rawContactIdOne.toString()); + await contactsQuery(map, "contact_insert_test_5700", rawContactUri); + var rawContactIdTwo = await DAHelper.insert(rawContactUri, common.getProfileRawContact()); + sleep(1000); + console.info('logMessage contact_insert_test_5700: rawContactIdTwo = ' + rawContactIdTwo); + expect(rawContactIdTwo > 0).assertTrue(); + var map = common.getProfileRawContactMap(); + map.set("id", rawContactIdTwo.toString()); + await contactsQuery(map, "contact_insert_test_5700", rawContactUri); + await deleteRawContact("contact_insert_test_5700"); + done(); + } catch (error) { + console.info('logMessage contact_insert_test_5700: insert error = ' + error); + done(); + } + }); + + /** + * @tc.number contact_insert_test_5800 + * @tc.name Add 20000 bytes of basic contact information and verify whether the text insertion is successful + * @tc.desc Function test + */ + it("contact_insert_test_5800", 0, async function (done) { + console.info("------logMessage contact_insert_test_5800 is starting!-----"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + var name; + for (var i = 0; i < 20000; i++) { + name += "i"; + } + var contcatvalues = { + "display_name": name + } + try { + var rawContactId = await DAHelper.insert(rawContactUri, contcatvalues); + sleep(1000); + console.info('logMessage contact_insert_test_5800: rawContactId = ' + rawContactId); + expect(rawContactId > 0).assertTrue(); + var map = new Map(); + map.set("id", rawContactId.toString()); + map.set("display_name", name); + await contactsQuery(map, "contact_insert_test_5800", rawContactUri); + await deleteRawContact("contact_insert_test_5800"); + done(); + } catch (error) { + console.info('logMessage contact_insert_test_5800: insert error = ' + error); + done(); + } + }); + + /** + * @tc.number contact_insert_test_5900 + * @tc.name Add multiple contact details and verify that the insertion was successful + * @tc.desc Function test + */ + it("contact_insert_test_5900", 0, async function (done) { + console.info("------logMessage contact_insert_test_5900 is starting!-----"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + var contcatvalues = { + "display_name": "xiao5900" + } + try { + var rawContactId = await DAHelper.insert(rawContactUri, contcatvalues); + console.info('logMessage contact_insert_test_5900: rawContactId = ' + rawContactId); + expect(rawContactId > 0).assertTrue(); + var contactDataValues1 = { + "raw_contact_id": rawContactId, + "content_type": "phone", + "detail_info": "19960229" + }; + var contactDataId = await DAHelper.insert(contactDataUri, contactDataValues1); + console.info('logMessage contact_insert_test_5900: contactDataId = ' + contactDataId); + expect(contactDataId > 0).assertTrue(); + + var map = new Map(); + map.set("id", contactDataId.toString()); + map.set("detail_info", "19960229"); + await contactsQuery(map, "contact_insert_test_5900", contactDataUri); + + var rawContactIdOne = await DAHelper.insert(rawContactUri, contcatvalues); + console.info('logMessage contact_insert_test_5900: rawContactId = ' + rawContactIdOne); + expect(rawContactIdOne > 0).assertTrue(); + var contactDataValues2 = { + "raw_contact_id": rawContactIdOne, + "content_type": "phone", + "detail_info": "111111032" + }; + var contactDataId1 = await DAHelper.insert(contactDataUri, contactDataValues2); + console.info('logMessage contact_insert_test_5900: contactDataId = ' + contactDataId1); + expect(contactDataId1 > 0).assertTrue(); + + var map = new Map(); + map.set("id", contactDataId1.toString()); + map.set("detail_info", "111111032"); + await contactsQuery(map, "contact_insert_test_5900", contactDataUri); + + await deleteRawContact("contact_insert_test_5900"); + await deleteAll(contactDataUri, "contact_insert_test_5900"); + done(); + } catch (error) { + console.info('logMessage contact_insert_test_5900: insert error = ' + error); + done(); + } + }); + + /** + * @tc.number contact_insert_test_6000 + * @tc.name Add the basic information of a single contact and verify whether the insertion is successful (name, + * Pinyin, company, position, favorite) + * @tc.desc Function test + */ + it("contact_insert_test_6000", 0, async function (done) { + console.info("------logMessage contact_insert_test_6000 is starting!-----"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + var insertRawContactValues = { + "display_name": "licheng", + "company": "TT", + "position": "developer", + "favorite": 1, + "phonetic_name": "licheng||lc" + }; + try { + var rawContactId = await DAHelper.insert(rawContactUri, insertRawContactValues); + console.info("logMessage contact_insert_test_6000: rawContactId = " + rawContactId); + expect(rawContactId > 0).assertTrue(); + + var map = new Map(); + map.set("id", rawContactId.toString()); + map.set("display_name", "licheng"); + map.set("company", "TT"); + map.set("position", "developer"); + map.set("favorite", "1"); + map.set("phonetic_name", "licheng||lc"); + await contactsQuery(map, "contact_insert_test_6000", rawContactUri); + await deleteRawContact("contact_insert_test_6000"); + await deleteAll(contactDataUri, "contact_insert_test_6000"); + done(); + } catch (error) { + console.info("logMessage contact_insert_test_6000: raw_contact insert error = " + error); + done(); + } + }); + + /** + * @tc.number contact_insertData_test_6100 + * @tc.name To contact_data Add a full field data to the data table and verify whether the insertion is + * successful + * @tc.desc Function test + */ + it("contact_insertData_test_6100", 0, async function (done) { + console.info("------logMessage contact_insertData_test_6100 is starting!-----"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + var insertRawContactValues = { + "display_name": "xiaocai", + }; + try { + var rawContactId = await DAHelper.insert(rawContactUri, insertRawContactValues); + console.info("logMessage contact_insertData_test_6100: rawContactId = " + rawContactId); + expect(rawContactId > 0).assertTrue(); + var contactDataValues = common.getProfileContactData(); + contactDataValues["raw_contact_id"] = rawContactId; + console.info('logMessage contact_insertData_test_6100: contactDataValues["raw_contact_id"] = ' + + contactDataValues.raw_contact_id); + var contactDataId = await DAHelper.insert(contactDataUri, contactDataValues); + console.info('logMessage contact_insertData_test_6100: contactDataId = ' + contactDataId); + expect(contactDataId > 0).assertTrue(); + var map = common.getProfileContactDataMap(); + map.set("id", contactDataId.toString()); + map.set("raw_contact_id", rawContactId.toString()); + await contactsQuery(map, "contact_insertData_test_6100", contactDataUri); + await deleteRawContact("contact_insertData_test_6100"); + await deleteAll(contactDataUri, "contact_insertData_test_6100"); + done(); + } catch (error) { + console.info("logMessage contact_insertData_test_6100: raw_contact insert error = " + error); + done(); + } + }); + + /** + * @tc.number contact_update_test_6200 + * @tc.name Modify the basic information of multiple contacts and verify whether the modification is successful + * @tc.desc Function test + */ + it("contact_update_test_6200", 0, async function (done) { + console.info("--------logMessage contact_update_test_6200 is starting!------------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + try { + var insertRawContactValues = { + "display_name": "xiaocai", + }; + var rawContactId = await DAHelper.insert(rawContactUri, insertRawContactValues); + expect(rawContactId > 0).assertTrue(); + console.info("logMessage contact_update_test_6200: rawContactId = " + rawContactId); + var insertRawContactValuesOne = { + "display_name": "xiaocai1", + }; + var rawContactIdOne = await DAHelper.insert(rawContactUri, insertRawContactValuesOne); + expect(rawContactIdOne > 0).assertTrue(); + console.info("logMessage contact_update_test_6200: rawContactIdOne = " + rawContactIdOne); + var insertRawContactValuesTwo = { + "display_name": "xiaocai1", + }; + var rawContactIdTwo = await DAHelper.insert(rawContactUri, insertRawContactValuesTwo); + expect(rawContactIdTwo > 0).assertTrue(); + console.info("logMessage contact_update_test_6200: rawContactIdTwo = " + rawContactIdTwo); + + var updateValues = { + "display_name": "xiaosan" + }; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("id", rawContactId.toString()); + condition.or(); + condition.equalTo("id", rawContactIdOne.toString()); + condition.or(); + condition.equalTo("id", rawContactIdTwo.toString()); + var updataCode = await DAHelper.update(rawContactUri, updateValues, condition); + console.info("logMessage contact_update_test_6200: updataCode = " + updataCode); + expect(updataCode == 0).assertTrue(); + sleep(1000); + await queryUpdateThree( + "contact_update_test_6200", DAHelper, rawContactId, rawContactIdOne, rawContactIdTwo); + await deleteRawContact("contact_update_test_6200"); + done(); + } catch (error) { + console.info("logMessage contact_update_test_6200: insert error = " + error); + done(); + } + }); + + async function queryUpdateThree(tag, DAHelper, rawContactId, rawContactIdOne, rawContactIdTwo) { + + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info(tag + ': contactsQuery start ! DAHelper = ' + DAHelper); + var resultColumns = ["display_name"]; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("id", rawContactId.toString()); + condition.or(); + condition.equalTo("id", rawContactIdOne.toString()); + condition.or(); + condition.equalTo("id", rawContactIdTwo.toString()); + try { + var resultSet = await DAHelper.query(rawContactUri, resultColumns, condition); + if (resultSet.rowCount > 0) { + if (resultSet.goToFirstRow()) { + do { + var name = resultSet.getString(resultSet.getColumnIndex("display_name")); + expect(name == "xiaosan").assertEqual(true); + } while (resultSet.goToNextRow()); + } + } + resultSet.close(); + } catch (error) { + console.info(tag + "logMessage contactsQuery: error = " + error); + } + } + + /** + * @tc.number contact_UpdateRawContcat_test_6300 + * @tc.name Update raw_contact The full field data of the contact table and verify whether the modification is + * successful + * @tc.desc Function test + */ + it("contact_UpdateRawContcat_test_6300", 0, async function (done) { + console.info("------logMessage contact_UpdateRawContcat_test_6300 is starting!-----"); + if(utils.notCheck){ + expect(true).assertTrue(); + done(); + return; + } + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + try { + var rawContactId = await DAHelper.insert(rawContactUri, common.getProfileRawContact()); + console.info("logMessage contact_UpdateRawContcat_test_6300: rawContactId = " + rawContactId); + expect(rawContactId > 0).assertTrue(); + sleep(2000); + var updateValues = common.getProfileRawContactUpdate(); + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("id", rawContactId.toString()); + var updataCode = await DAHelper.update(rawContactUri, updateValues, condition); + console.info('logMessage contact_UpdateRawContcat_test_6300: updataCode = ' + updataCode); + sleep(3000); + var map = common.getProfileRawContactUpdateMap(); + map.set("id", rawContactId.toString()); + await contactsQuery(map, "contact_UpdateRawContcat_test_6300", rawContactUri); + await deleteRawContact("contact_UpdateRawContcat_test_6300"); + await deleteAll(contactDataUri, "contact_UpdateRawContcat_test_6300"); + done(); + } catch (error) { + console.info("logMessage contact_UpdateRawContcat_test_6300: raw_contact insert error = " + error); + done(); + } + }); + + /** + * @tc.number contact_insertDataUpdate_test_6400 + * @tc.name Update contact_data table, and verify whether the modification is successful + * @tc.desc Function test + */ + it("contact_insertDataUpdate_test_6400", 0, async function (done) { + console.info("------logMessage contact_insertDataUpdate_test_6400 is starting!-----"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + var insertRawContactValues = { + "display_name": "xiaocai", + }; + try { + var rawContactId = await DAHelper.insert(rawContactUri, insertRawContactValues); + console.info("logMessage contact_insertDataUpdate_test_6400: rawContactId = " + rawContactId); + expect(rawContactId > 0).assertTrue(); + + var contactDataValues = common.getProfileContactData(); + contactDataValues["raw_contact_id"] = rawContactId; + console.info('logMessage contact_insertDataUpdate_test_6400: contactDataValues.raw_contact_id = ' + + contactDataValues.raw_contact_id); + var contactDataId = await DAHelper.insert(contactDataUri, contactDataValues); + console.info('logMessage contact_insertDataUpdate_test_6400: contactDataId = ' + contactDataId); + expect(contactDataId > 0).assertTrue(); + + var updateValues = common.getProfileContactDataUpdate(); + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("id", contactDataId.toString()); + var updataCode = await DAHelper.update(contactDataUri, updateValues, condition); + console.info('logMessage contact_insertDataUpdate_test_6400: updataCode = ' + updataCode); + sleep(1000); + var map = common.getProfileContactDataUpdateMap(); + map.set("id", contactDataId.toString()); + map.set("raw_contact_id", rawContactId.toString()); + await contactsQuery(map, "contact_insertDataUpdate_test_6400", contactDataUri); + await deleteRawContact("contact_insertDataUpdate_test_6400"); + await deleteAll(contactDataUri, "contact_insertDataUpdate_test_6400"); + done(); + } catch (error) { + console.info("logMessage contact_insertDataUpdate_test_6400: raw_contact insert error = " + error); + done(); + } + }); + + /** + * @tc.number contact_insertDataUpdateAll_test_6500 + * @tc.name Update all contact details and verify that the modification was successful + * @tc.desc Function test + */ + it("contact_insertDataUpdateAll_test_6500", 0, async function (done) { + console.info("------logMessage contact_insertDataUpdateAll_test_6500 is starting!-----"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + var insertRawContactValues = { + "display_name": "xiaocai", + }; + try { + var rawContactId = await DAHelper.insert(rawContactUri, insertRawContactValues); + console.info("logMessage contact_insertDataUpdateAll_test_6500: rawContactId = " + rawContactId); + expect(rawContactId > 0).assertTrue(); + await insertData(rawContactId, "name", "xiaocai", ""); + await insertData(rawContactId, "phone", "6500", ""); + await insertData(rawContactId, "organization", "TTTTT", "Deve"); + await insertData(rawContactId, "nickname", "xxxxcai", ""); + await insertData(rawContactId, "email", "111@fox.com", ""); + await insertData(rawContactId, "postal_address", "dddd", ""); + await insertData(rawContactId, "note", "caicai", ""); + await insertData(rawContactId, "im", "999999999", ""); + await insertData(rawContactId, "contact_event", "1125", ""); + await insertData(rawContactId, "website", "wwww.xxx.com", ""); + await insertData(rawContactId, "relation", "xiaobai", ""); + await insertData(rawContactId, "group_membership", 1, ""); + await insertData(rawContactId, "contact_misc", "5678", ""); + var updateValues = { + "detail_info": "xiaocai" + }; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("raw_contact_id", rawContactId.toString()); + var updataCode = await DAHelper.update(contactDataUri, updateValues, condition); + console.info('logMessage contact_insertDataUpdateAll_test_6500: updataCode = ' + updataCode); + sleep(1000); + await queryUpdateAllData("contact_insertDataUpdateAll_test_6500", DAHelper, rawContactId); + await deleteRawContact("contact_insertDataUpdateAll_test_6500"); + await deleteAll(contactDataUri, "contact_insertDataUpdateAll_test_6500"); + done(); + } catch (error) { + console.info("logMessage contact_insertDataUpdateAll_test_6500: raw_contact insert error = " + error); + done(); + } + }); + + async function queryUpdateAllData(tag, DAHelper, rawContactId) { + + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info(tag + ': contactsQuery start ! DAHelper = ' + DAHelper); + var resultColumns = ["detail_info"]; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("row_contact_id", rawContactId.toString()); + try { + var resultSet = await DAHelper.query(contactDataUri, resultColumns, condition); + if (resultSet.rowCount > 0) { + if (resultSet.goToFirstRow()) { + do { + var detail_info = resultSet.getString(resultSet.getColumnIndex("detail_info")); + expect(detail_info == "xiaocai").assertEqual(true); + } while (resultSet.goToNextRow()); + } + } + resultSet.close(); + } catch (error) { + console.info(tag + "logMessage contactsQuery: error = " + error); + } + } + + /** + * @tc.number contact_insertFavorite_test_6600 + * @tc.name Add multiple contacts to favorites and verify that the favorites field is changed + * @tc.desc Function test + */ + it("contact_insertFavorite_test_6600", 0, async function (done) { + console.info("------logMessage contact_insertFavorite_test_6600 is starting!-----"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + try { + var insertRawContactValues = { + "display_name": "xiaocai", "favorite": 1 + }; + var rawContactId = await DAHelper.insert(rawContactUri, insertRawContactValues); + console.info("logMessage contact_insertFavorite_test_6600: rawContactId = " + rawContactId); + + var insertRawContactValuesOne = { + "display_name": "xiaotian", "favorite": 1 + }; + var rawContactIdOne = await DAHelper.insert(rawContactUri, insertRawContactValuesOne); + console.info("logMessage contact_insertFavorite_test_6600: rawContactId = " + rawContactIdOne); + + var insertRawContactValuesTwo = { + "display_name": "xiaoli", "favorite": 1 + }; + var rawContactIdTwo = await DAHelper.insert(rawContactUri, insertRawContactValuesTwo); + console.info("logMessage contact_insertFavorite_test_6600: rawContactId = " + rawContactIdTwo); + + sleep(1000); + await queryThreeFavorite( + "contact_insertFavorite_test_6600", DAHelper, rawContactId, rawContactIdOne, rawContactIdTwo, 1); + await deleteRawContact("contact_insertFavorite_test_6600"); + done(); + } catch (error) { + console.info("logMessage contact_insertFavorite_test_6600: raw_contact insert error = " + error); + done(); + } + }); + + async function queryThreeFavorite(tag, DAHelper, rawContactId, rawContactIdOne, rawContactIdTwo, favoritevalue) { + + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info(tag + ': queryThreeFavorite start ! DAHelper = ' + DAHelper); + var resultColumns = ["favorite"]; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("id", rawContactId.toString()); + condition.or(); + condition.equalTo("id", rawContactIdOne.toString()); + condition.or(); + condition.equalTo("id", rawContactIdTwo.toString()); + try { + var resultSet = await DAHelper.query(rawContactUri, resultColumns, condition); + if (resultSet.rowCount > 0) { + if (resultSet.goToFirstRow()) { + do { + var favorite = resultSet.getInt(resultSet.getColumnIndex("favorite")); + expect(favorite == favoritevalue).assertEqual(true); + } while (resultSet.goToNextRow()); + } + } + resultSet.close(); + } catch (error) { + console.info(tag + "logMessage queryThreeFavorite: error = " + error); + } + } + + /** + * @tc.number contact_unFavorite_test_6700 + * @tc.name Remove favorites from multiple contacts and verify that the favorites field has changed + * @tc.desc Function test + */ + it("contact_unFavorite_test_6700", 0, async function (done) { + console.info("------logMessage contact_unFavorite_test_6700 is starting!-----"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + try { + var insertRawContactValues = { + "display_name": "xiaocai", "favorite": 1 + }; + var rawContactId = await DAHelper.insert(rawContactUri, insertRawContactValues); + console.info("logMessage contact_unFavorite_test_6700: rawContactId = " + rawContactId); + + var insertRawContactValuesOne = { + "display_name": "xiaotian", "favorite": 1 + }; + var rawContactIdOne = await DAHelper.insert(rawContactUri, insertRawContactValuesOne); + console.info("logMessage contact_unFavorite_test_6700: rawContactId = " + rawContactIdOne); + + var insertRawContactValuesTwo = { + "display_name": "xiaoli", "favorite": 1 + }; + var rawContactIdTwo = await DAHelper.insert(rawContactUri, insertRawContactValuesTwo); + console.info("logMessage contact_unFavorite_test_6700: rawContactId = " + rawContactIdTwo); + + var updateValues = { + "favorite": 0 + }; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("id", rawContactId.toString()); + condition.or(); + condition.equalTo("id", rawContactIdOne.toString()); + condition.or(); + condition.equalTo("id", rawContactIdTwo.toString()); + var updataCode = await DAHelper.update(rawContactUri, updateValues, condition); + console.info("logMessage contact_unFavorite_test_6700: updataCode = " + updataCode); + sleep(1000); + await queryThreeFavorite( + "contact_unFavorite_test_6700", DAHelper, rawContactId, rawContactIdOne, rawContactIdTwo, 0); + await deleteRawContact("contact_unFavorite_test_6700"); + done(); + } catch (error) { + console.info("logMessage contact_unFavorite_test_6700: raw_contact insert error = " + error); + done(); + } + }); + + /** + * @tc.number contact_insertContactBlocklist_test_6800 + * @tc.name Add multiple records to the black list and verify whether the insertion is successful + * @tc.desc Function test + */ + it("contact_insertContactBlocklist_test_6800", 0, async function (done) { + console.info("--------logMessage contact_insertContactBlocklist_test_6800 is starting!-------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + try { + var batchInsertCode = await DAHelper.insert(contactBlocklistUri, common.getProfileBlockList()); + console.info("logMessage contact_insertContactBlocklist_test_6800: insert = " + batchInsertCode); + var batchInsertCodeOne = await DAHelper.insert(contactBlocklistUri, common.getProfileBlockList()); + console.info("logMessage contact_insertContactBlocklist_test_6800: insert = " + batchInsertCodeOne); + var batchInsertCodeTwo = await DAHelper.insert(contactBlocklistUri, common.getProfileBlockList()); + console.info("logMessage contact_insertContactBlocklist_test_6800: insert = " + batchInsertCodeTwo); + sleep(1000); + expect(batchInsertCode > 0).assertTrue(); + await query(3); + await deleteAll(contactBlocklistUri, "contact_insertContactBlocklist_test_6800"); + done(); + } catch (error) { + console.info("logMessage contact_insertContactBlocklist_test_6800: insert error = " + error); + done(); + } + + async function query(size) { + var resultColumns = []; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("phone_number", "123456789"); + try { + var resultSet = await DAHelper.query(contactBlocklistUri, resultColumns, condition); + sleep(1000); + console.info('contact_insertContactBlocklist_test_6800 :resultSet.goToFirstRow() = ' + + resultSet.goToFirstRow()); + console.info( + 'contact_insertContactBlocklist_test_6800 : query result is = ' + resultSet.rowCount == size); + expect(resultSet.rowCount == size).assertEqual(true); + resultSet.close(); + } catch (error) { + console.info(" contact_insertContactBlocklist_test_6800 error = " + error); + } + } + }); + + /** + * @tc.number contact_removeContactBlocklist_test_6900 + * @tc.name Delete multiple records from the black list and verify whether the deletion is successful + * @tc.desc Function test + */ + it("contact_removeContactBlocklist_test_6900", 0, async function (done) { + console.info("--------logMessage contact_removeContactBlocklist_test_6900 is starting!-------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + try { + var batchInsertCode = await DAHelper.insert(contactBlocklistUri, common.getProfileBlockList()); + console.info("logMessage contact_removeContactBlocklist_test_6900: batchInsertCode = " + batchInsertCode); + var batchInsertCodeOne = await DAHelper.insert(contactBlocklistUri, common.getProfileBlockList()); + console.info("logMessage contact_removeContactBlocklist_test_6900: insert = " + batchInsertCodeOne); + var batchInsertCodeTwo = await DAHelper.insert(contactBlocklistUri, common.getProfileBlockList()); + console.info("logMessage contact_removeContactBlocklist_test_6900: insert = " + batchInsertCodeTwo); + sleep(1000); + expect(batchInsertCode > 0).assertTrue(); + await deleteAll(contactBlocklistUri, "contact_removeContactBlocklist_test_6900"); + await query(0); + done(); + } catch (error) { + console.info("logMessage contact_removeContactBlocklist_test_6900: batchInsert error = " + error); + done(); + } + async function query(size) { + var resultColumns = []; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("phone_number", "123456789"); + try { + var resultSet = await DAHelper.query(contactBlocklistUri, resultColumns, condition); + console.info('contact_removeContactBlocklist_test_6900 : resultSet = ' + resultSet); + expect(resultSet.rowCount == size).assertEqual(true); + resultSet.close(); + } catch (error) { + console.info(" contact_removeContactBlocklist_test_6900 error = " + error); + } + } + }); + + /** + * @tc.number contact_insertGroup_test_7000 + * @tc.name Add multiple contacts to favorites and verify that the favorites field is changed + * @tc.desc Function test + */ + it("contact_insertGroup_test_7000", 0, async function (done) { + console.info("------logMessage contact_insertGroup_test_7000 is starting!-----"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + try { + var insertRawContactValues = { + "display_name": "xiaocai", + }; + var rawContactId = await DAHelper.insert(rawContactUri, insertRawContactValues); + console.info("logMessage contact_insertGroup_test_7000: rawContactId = " + rawContactId); + await insertData(rawContactId, "group_membership", 1, ""); + + var insertRawContactValuesOne = { + "display_name": "xiaotian", + }; + var rawContactIdOne = await DAHelper.insert(rawContactUri, insertRawContactValuesOne); + console.info("logMessage contact_insertGroup_test_7000: rawContactId = " + rawContactIdOne); + await insertData(rawContactIdOne, "group_membership", 1, ""); + var insertRawContactValuesTwo = { + "display_name": "xiaoli", + }; + var rawContactIdTwo = await DAHelper.insert(rawContactUri, insertRawContactValuesTwo); + console.info("logMessage contact_insertGroup_test_7000: rawContactId = " + rawContactIdTwo); + await insertData(rawContactIdTwo, "group_membership", 1, ""); + sleep(1000); + await queryThreeGroup( + "contact_insertGroup_test_7000", DAHelper, rawContactId, rawContactIdOne, rawContactIdTwo, 1); + await deleteRawContact("contact_insertGroup_test_7000"); + done(); + } catch (error) { + console.info("logMessage contact_insertGroup_test_7000: raw_contact insert error = " + error); + done(); + } + }); + + async function queryThreeGroup(tag, DAHelper, rawContactId, rawContactIdOne, rawContactIdTwo, groupId) { + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info(tag + ': queryThreeGroup start ! DAHelper = ' + DAHelper); + var resultColumns = ["detail_info"]; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("id", rawContactId.toString()); + condition.or(); + condition.equalTo("id", rawContactIdOne.toString()); + condition.or(); + condition.equalTo("id", rawContactIdTwo.toString()); + try { + var resultSet = await DAHelper.query(rawContactUri, resultColumns, condition); + if (resultSet.rowCount > 0) { + if (resultSet.goToFirstRow()) { + do { + var group = resultSet.getInt(resultSet.getColumnIndex("detail_info")); + expect(group == groupId).assertEqual(true); + } while (resultSet.goToNextRow()); + } + } + resultSet.close(); + } catch (error) { + console.info(tag + "logMessage queryThreeGroup: error = " + error); + } + } + + /** + * @tc.number contact_insert_test_7100 + * @tc.name Add a full field data to the groups table and verify whether the insertion is successful + * @tc.desc Function test + */ + it("contact_insert_test_7100", 0, async function (done) { + console.info("---------logMessage contact_insert_test_7100 is starting!----------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + try { + var groupId = await DAHelper.insert(groupUri, common.getProfileGroup()); + console.info("logMessage contact_insert_test_7100: groupId = " + groupId); + expect(groupId > 0).assertTrue(); + var map = common.getProfileGroupMap(); + map.set("id", groupId.toString()); + await contactsQuery(map, "contact_insert_test_7100", groupUri); + await deleteAll(groupUri, "contact_insert_test_7100"); + done(); + } catch (error) { + console.info("logMessage contact_insert_test_7100: group insert error = " + error); + done(); + } + }); + + /** + * @tc.number contact_delete_test_7200 + * @tc.name Add a full field data to the groups table and verify whether the insertion is successful + * @tc.desc Function test + */ + it("contact_delete_test_7200", 0, async function (done) { + console.info("------logMessage contact_delete_test_7200 is starting!-----"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + try { + var insertRawContactValues = { + "display_name": "xiaocai", + }; + var rawContactId = await DAHelper.insert(rawContactUri, insertRawContactValues); + console.info("logMessage contact_delete_test_7200: rawContactId = " + rawContactId); + await insertData(rawContactId, "group_membership", 1, ""); + + var insertRawContactValuesOne = { + "display_name": "xiaotian", + }; + var rawContactIdOne = await DAHelper.insert(rawContactUri, insertRawContactValuesOne); + console.info("logMessage contact_delete_test_7200: rawContactId = " + rawContactIdOne); + await insertData(rawContactIdOne, "group_membership", 1, ""); + var insertRawContactValuesTwo = { + "display_name": "xiaoli", + }; + var rawContactIdTwo = await DAHelper.insert(rawContactUri, insertRawContactValuesTwo); + console.info("logMessage contact_delete_test_7200: rawContactId = " + rawContactIdTwo); + await insertData(rawContactIdTwo, "group_membership", 1, ""); + sleep(1000); + await deleteAll(contactDataUri, "contact_delete_test_7200"); + sleep(1000); + await queryZeroGroup("contact_delete_test_7200", DAHelper, rawContactId, rawContactIdOne, rawContactIdTwo); + await deleteRawContact("contact_delete_test_7200"); + done(); + } catch (error) { + console.info("logMessage contact_delete_test_7200: raw_contact insert error = " + error); + done(); + } + }); + + async function queryZeroGroup(tag, DAHelper, rawContactId, rawContactIdOne, rawContactIdTwo) { + + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info(tag + ': queryZeroGroup start ! DAHelper = ' + DAHelper); + var resultColumns = ["detail_info"]; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("raw_contact_id", rawContactId.toString()); + condition.or(); + condition.equalTo("raw_contact_id", rawContactIdOne.toString()); + condition.or(); + condition.equalTo("raw_contact_id", rawContactIdTwo.toString()); + try { + var resultSet = await DAHelper.query(contactDataUri, resultColumns, condition); + console.info(tag + ': queryZeroGroup! resultSet.rowCount = ' + resultSet.rowCount); + expect(resultSet.rowCount == 0).assertEqual(true); + resultSet.close(); + } catch (error) { + console.info(tag + "logMessage queryZeroGroup: error = " + error); + } + } + + /** + * @tc.number contact_delete_test_7300 + * @tc.name Delete the full field data of a groups table and verify whether the deletion is successful + * @tc.desc Function test + */ + it("contact_delete_test_7300", 0, async function (done) { + console.info("---------logMessage contact_delete_test_7300 is starting!----------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + try { + var groupId = await DAHelper.insert(groupUri, common.getProfileGroup()); + console.info("logMessage contact_delete_test_7300: groupId = " + groupId); + expect(groupId > 0).assertTrue(); + var map = common.getProfileGroupMap(); + map.set("id", groupId.toString()); + await contactsQuery(map, "contact_delete_test_7300", groupUri); + await deleteAll(groupUri, "contact_delete_test_7300"); + done(); + } catch (error) { + console.info("logMessage contact_delete_test_7300: group insert error = " + error); + done(); + } + }); + + /** + * @tc.number contact_delete_test_7400 + * @tc.name Add a raw_contact all fields, delete raw_contact + * @tc.desc Function test + */ + it("contact_delete_test_7400", 0, async function (done) { + console.info("------logMessage contact_Delete_test_7400 is starting!-----"); + if(utils.notCheck){ + expect(true).assertTrue(); + done(); + return; + } + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + try { + var rawContactId = await DAHelper.insert(rawContactUri, common.getProfileRawContact()); + sleep(1000); + console.info('logMessage contact_Delete_test_7400: rawContactId = ' + rawContactId); + expect(rawContactId > 0).assertTrue(); + var map = common.getProfileRawContactMap(); + map.set("id", rawContactId.toString()); + map.set("version", "2"); + map.set("is_deleted", "1"); + await deleteAll(rawContactUri, "contact_Delete_test_7400"); + sleep(1000); + await contactsQuery(map, "contact_Delete_test_7400", rawContactUri); + var conditionAll = new ohosDataAbility.DataAbilityPredicates(); + conditionAll.greaterThan("id", "0"); + var code = await DAHelper.delete(deletedUri, conditionAll); + console.info('contact_Delete_test_7400 : Completely delete code = ' + code); + expect(code == 0).assertTrue(); + done(); + } catch (error) { + console.info('logMessage contact_Delete_test_7400: insert error = ' + error); + done(); + } + }); + + /** + * @tc.number contact_delete_test_7500 + * @tc.name Delete contact_data Single full field data in data table + * @tc.desc Function test + */ + it("contact_delete_test_7500", 0, async function (done) { + console.info("------logMessage contact_delete_test_7500 is starting!-----"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + var insertRawContactValues = { + "display_name": "xiaocai", + }; + try { + var rawContactId = await DAHelper.insert(rawContactUri, insertRawContactValues); + console.info("logMessage contact_delete_test_7500: rawContactId = " + rawContactId); + expect(rawContactId > 0).assertTrue(); + var contactDataValues = common.getProfileContactData(); + contactDataValues["raw_contact_id"] = rawContactId; + var contactDataId = await DAHelper.insert(contactDataUri, contactDataValues); + console.info('logMessage contact_delete_test_7500: contactDataId = ' + contactDataId); + expect(contactDataId > 0).assertTrue(); + await deleteAll(contactDataUri, "contact_delete_test_7500"); + var map = new Map(); + map.set("id", contactDataId.toString()); + await queryIdForDelete(map, "contact_delete_test_7500", contactDataUri); + await deleteRawContact("contact_delete_test_7500"); + done(); + } catch (error) { + console.info("logMessage contact_delete_test_7500: raw_contact insert error = " + error); + done(); + } + }); + + /** + * @tc.number contact_insertDataAll_test_7600 + * @tc.name Add all details of a single contact and verify whether the insertion is successful (name, mobile + * number, company, position, nickname, email, home, remarks, aim) + * @tc.desc Function test + */ + it("contact_insertDataAll_test_7600", 0, async function (done) { + console.info("------logMessage contact_insertDataAll_test_7600 is starting!-----"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + var insertRawContactValues = { + "display_name": "xiaocai", + }; + try { + var rawContactId = await DAHelper.insert(rawContactUri, insertRawContactValues); + console.info("logMessage contact_insertDataAll_test_7600: rawContactId = " + rawContactId); + expect(rawContactId > 0).assertTrue(); + var contactdata1 = await insertData(rawContactId, "name", "xiaocai", ""); + await queryAlldata("contact_insertDataAll_test_7600", DAHelper, rawContactId, contactdata1, "xiaocai"); + var contactdata2 = await insertData(rawContactId, "phone", "6500", ""); + await queryAlldata("contact_insertDataAll_test_7600", DAHelper, rawContactId, contactdata2, "6500"); + var contactdatd3 = await insertData(rawContactId, "organization", "TTTTT", "Deve"); + await queryAlldata("contact_insertDataAll_test_7600", DAHelper, rawContactId, contactdatd3, "TTTTT"); + var contactdatd4 = await insertData(rawContactId, "nickname", "xxxxcai", ""); + await queryAlldata("contact_insertDataAll_test_7600", DAHelper, rawContactId, contactdatd4, "xxxxcai"); + var contactdatd5 = await insertData(rawContactId, "email", "111@fox.com", ""); + await queryAlldata("contact_insertDataAll_test_7600", DAHelper, rawContactId, contactdatd5, "111@fox.com"); + var contactdatd6 = await insertData(rawContactId, "postal_address", "dddd", ""); + await queryAlldata("contact_insertDataAll_test_7600", DAHelper, rawContactId, contactdatd6, "dddd"); + var contactdatd7 = await insertData(rawContactId, "note", "caicai", ""); + await queryAlldata("contact_insertDataAll_test_7600", DAHelper, rawContactId, contactdatd7, "caicai"); + var contactdatd8 = await insertData(rawContactId, "im", "999999999", ""); + await queryAlldata("contact_insertDataAll_test_7600", DAHelper, rawContactId, contactdatd8, "999999999"); + sleep(1000); + await deleteRawContact("contact_insertDataAll_test_7600"); + await deleteAll(contactDataUri, "contact_insertDataAll_test_7600"); + done(); + } catch (error) { + console.info("logMessage contact_insertDataAll_test_7600: raw_contact insert error = " + error); + done(); + } + }); + + async function queryAlldata(tag, DAHelper, rawContactId, contactdata, values) { + var resultColumns = ["raw_contact_id", "detail_info"]; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("id", contactdata.toString()); + try { + var resultSet = await DAHelper.query(contactDataUri, resultColumns, condition); + if (resultSet.rowCount > 0) { + if (resultSet.goToFirstRow()) { + do { + var id = resultSet.getString(resultSet.getColumnIndex("raw_contact_id")); + console.info(tag + " result raw_contact_id = " + id); + expect(id == rawContactId).assertEqual(true); + var info = resultSet.getString(resultSet.getColumnIndex("detail_info")); + console.info(tag + " result info = " + info + " value = " + values); + expect(info == values).assertEqual(true); + } while (resultSet.goToNextRow()); + } + } + resultSet.close(); + } catch (error) { + console.info(tag + " :logMessage queryIdForDelete: error = " + error); + } + } + + /** + * @tc.number contact_insertDataAll_test_7700 + * @tc.name Add all details of a single contact and verify whether the insertion is successful (name, mobile + * number, company, position, nickname, email, home, remarks, aim, birthday, website, assistant, group, phone ring) + * @tc.desc Function test + */ + it("contact_insertDataAll_test_7700", 0, async function (done) { + console.info("------logMessage contact_insertDataAll_test_7700 is starting!-----"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + var insertRawContactValues = { + "display_name": "xiaocai", + }; + try { + var rawContactId = await DAHelper.insert(rawContactUri, insertRawContactValues); + console.info("logMessage contact_insertDataAll_test_7700: rawContactId = " + rawContactId); + expect(rawContactId > 0).assertTrue(); + var contactdata1 = await insertData(rawContactId, "name", "xiaocai", ""); + await queryAlldata("contact_insertDataAll_test_7700", DAHelper, rawContactId, contactdata1, "xiaocai"); + var contactdata2 = await insertData(rawContactId, "phone", "6500", ""); + await queryAlldata("contact_insertDataAll_test_7700", DAHelper, rawContactId, contactdata2, "6500"); + var contactdatd3 = await insertData(rawContactId, "organization", "TTTTT", "Deve"); + await queryAlldata("contact_insertDataAll_test_7700", DAHelper, rawContactId, contactdatd3, "TTTTT"); + var contactdatd4 = await insertData(rawContactId, "nickname", "xxxxcai", ""); + await queryAlldata("contact_insertDataAll_test_7700", DAHelper, rawContactId, contactdatd4, "xxxxcai"); + var contactdatd5 = await insertData(rawContactId, "email", "111@fox.com", ""); + await queryAlldata("contact_insertDataAll_test_7700", DAHelper, rawContactId, contactdatd5, "111@fox.com"); + var contactdatd6 = await insertData(rawContactId, "postal_address", "dddd", ""); + await queryAlldata("contact_insertDataAll_test_7700", DAHelper, rawContactId, contactdatd6, "dddd"); + var contactdatd7 = await insertData(rawContactId, "note", "caicai", ""); + await queryAlldata("contact_insertDataAll_test_7700", DAHelper, rawContactId, contactdatd7, "caicai"); + var contactdatd8 = await insertData(rawContactId, "im", "999999999", ""); + await queryAlldata("contact_insertDataAll_test_7700", DAHelper, rawContactId, contactdatd8, "999999999"); + var contactdatd9 = await insertData(rawContactId, "contact_event", "1125", ""); + await queryAlldata("contact_insertDataAll_test_7700", DAHelper, rawContactId, contactdatd9, "1125"); + var contactdatd10 = await insertData(rawContactId, "website", "wwww.xxx.com", ""); + await queryAlldata( + "contact_insertDataAll_test_7700", DAHelper, rawContactId, contactdatd10, "wwww.xxx.com"); + var contactdatd11 = await insertData(rawContactId, "relation", "xiaobai", ""); + await queryAlldata("contact_insertDataAll_test_7700", DAHelper, rawContactId, contactdatd11, "xiaobai"); + var contactdatd12 = await insertData(rawContactId, "group_membership", 1, ""); + await queryAlldata("contact_insertDataAll_test_7700", DAHelper, rawContactId, contactdatd12, 1); + var contactdatd13 = await insertData(rawContactId, "contact_misc", "5678", ""); + await queryAlldata("contact_insertDataAll_test_7700", DAHelper, rawContactId, contactdatd13, "5678"); + sleep(1000); + await deleteRawContact("contact_insertDataAll_test_7700"); + await deleteAll(contactDataUri, "contact_insertDataAll_test_7700"); + done(); + } catch (error) { + console.info("logMessage contact_insertDataAll_test_7700: raw_contact insert error = " + error); + done(); + } + }); + + /** + * @tc.number contact_insertDataUpdateMore_test_7800 + * @tc.name Modify multiple contact details and verify whether the modification is successful + * @tc.desc Function test + */ + it("contact_insertDataUpdateMore_test_7800", 0, async function (done) { + console.info("------logMessage contact_insertDataUpdateMore_test_7800 is starting!-----"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + try { + var insertRawContactValues = { + "display_name": "xiaocai" + }; + var rawContactId = await DAHelper.insert(rawContactUri, insertRawContactValues); + console.info("logMessage contact_insertDataUpdateMore_test_7800: rawContactId = " + rawContactId); + expect(rawContactId > 0).assertTrue(); + await insertData(rawContactId, "name", "xiaotian", ""); + + var insertRawContactValues1 = { + "display_name": "xiaotian" + }; + var rawContactIdFirst = await DAHelper.insert(rawContactUri, insertRawContactValues1); + console.info("logMessage contact_insertDataUpdateMore_test_7800: rawContactIdFirst = " + rawContactIdFirst); + expect(rawContactIdFirst > 0).assertTrue(); + await insertData(rawContactId, "name", "xiaotian", ""); + + var updateValues = { + "detail_info": "xiaocai7800" + }; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("raw_contact_id", rawContactId.toString()); + condition.or(); + condition.equalTo("raw_contact_id", rawContactIdFirst.toString()) + var updataCode = await DAHelper.update(contactDataUri, updateValues, condition); + console.info('logMessage contact_insertDataUpdateMore_test_7800: updataCode = ' + updataCode); + sleep(1000); + await insertDataUpdateMoreQuery( + "contact_insertDataUpdateMore_test_7800", DAHelper, rawContactId, rawContactIdFirst); + await deleteRawContact("contact_insertDataUpdateMore_test_7800"); + await deleteAll(contactDataUri, "contact_insertDataUpdateMore_test_7800"); + done(); + } catch (error) { + console.info("logMessage contact_insertDataUpdateMore_test_7800: raw_contact insert error = " + error); + done(); + } + }); + + async function insertDataUpdateMoreQuery(tag, DAHelper, rawContactId, rawContactIdFirst) { + var resultColumns = ["detail_info"]; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("raw_contact_id", rawContactId.toString()); + condition.or(); + condition.equalTo("raw_contact_id", rawContactIdFirst.toString()) + try { + var resultSet = await DAHelper.query(contactDataUri, resultColumns, condition); + if (resultSet.rowCount > 0) { + if (resultSet.goToFirstRow()) { + do { + var info = resultSet.getString(resultSet.getColumnIndex("detail_info")); + console.info(tag + " result info = " + info); + expect(info == "xiaocai7800").assertEqual(true); + } while (resultSet.goToNextRow()); + } + } + resultSet.close(); + } catch (error) { + console.info(tag + " :logMessage : error = " + error); + } + } + + /** + * @tc.number contact_deleterestore_test_7900 + * @tc.name Delete contacts and restore + * @tc.desc Function test + */ + it("contact_deleterestore_test_7900", 0, async function (done) { + console.info("------logMessage contact_deleterestore_test_7900 is starting!-----"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + try { + var insertRawContactValues = { + "display_name": "xaioli7900" + }; + var rawContactId = await DAHelper.insert(rawContactUri, insertRawContactValues); + console.info("logMessage contact_deleterestore_test_7900: rawContactId = " + rawContactId); + expect(rawContactId > 0).assertTrue(); + sleep(1000); + var condition1 = new ohosDataAbility.DataAbilityPredicates(); + condition1.equalTo("id", rawContactId.toString()); + var deleteCode = await DAHelper.delete(rawContactUri, condition1); + console.info("contact_deleterestore_test_7900 " + + ': deleteCode = ' + deleteCode); + expect(deleteCode == 0).assertTrue(); + sleep(1000); + + var condition2 = new ohosDataAbility.DataAbilityPredicates(); + condition2.equalTo("id", rawContactId.toString()); + var updatevalue = { + "is_deleted": 0 + }; + var updateCode = await DAHelper.update(rawContactUri, updatevalue, condition2); + console.info('contact_deleterestore_test_7900 : update = ' + updateCode); + sleep(1000); + + var condition3 = new ohosDataAbility.DataAbilityPredicates(); + condition3.equalTo("id", rawContactId.toString()); + var code = await DAHelper.delete(deletedRawContactRecord, condition3); + console.info('contact_deleterestore_test_7900 : record code = ' + code); + var map = new Map(); + map.set("id", rawContactId.toString()); + map.set("is_deleted", "0"); + await contactsQuery(map, "contact_deleterestore_test_7900", rawContactUri); + await deleteRawContact("contact_deleterestore_test_7900"); + done(); + } catch (error) { + console.info("logMessage contact_deleterestore_test_7900: raw_contact insert error = " + error); + done(); + } + }); + + /** + * @tc.number abnormal_contact_updateData_test_8000 + * @tc.name When modifying contact_data table, incorrect field or table name or nonexistent value is passed in + * @tc.desc Function test + */ + it("abnormal_contact_updateData_test_8000", 0, async function (done) { + console.info("------logMessage abnormal_contact_updateData_test_8000 is starting!-----"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + try { + var insertRawContactValues = { + "display_name": "xaioli8000" + }; + var rawContactId = await DAHelper.insert(rawContactUri, insertRawContactValues); + console.info("logMessage abnormal_contact_updateData_test_8000: rawContactId = " + rawContactId); + expect(rawContactId > 0).assertTrue(); + sleep(1000); + var contactDataId = await insertData(rawContactId, "name", "xaioli8000", ""); + console.info("logMessage abnormal_contact_updateData_test_8000: contactDataId = " + contactDataId); + expect(contactDataId > 0).assertTrue(); + + var condition = new ohosDataAbility.DataAbilityPredicates(); + var updateValues = { + "display_namess": "xaioli80000000" + }; + condition.equalTo("id", contactDataId.toString()); + var code = await DAHelper.update(contactDataUri, updateValues, condition); + console.info('abnormal_contact_updateData_test_8000 : update code = ' + code); + expect(code == -1).assertTrue(); + var map = new Map(); + map.set("id", contactDataId.toString()); + map.set("display_name", "xaioli8000"); + await contactsQuery(map, "abnormal_contact_updateData_test_8000", contactDataUri); + await deleteRawContact("abnormal_contact_updateData_test_8000"); + await deleteAll(contactDataUri, "abnormal_contact_updateData_test_8000"); + done(); + } catch (error) { + console.info("logMessage abnormal_contact_updateData_test_8000: raw_contact insert error = " + error); + done(); + } + }); + + /** + * @tc.number abnormal_contact_favorite_test_8100 + * @tc.name When collecting contacts, an incorrect field was passed in + * @tc.desc Function test + */ + it("abnormal_contact_favorite_test_8100", 0, async function (done) { + console.info("------logMessage abnormal_contact_favorite_test_8100 is starting!-----"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + try { + var insertRawContactValues = { + "display_name": "xaioli8100", "favoriteeee": 1 + }; + var rawContactId = await DAHelper.insert(rawContactUri, insertRawContactValues); + console.info("logMessage abnormal_contact_favorite_test_8100: rawContactId = " + rawContactId); + expect(rawContactId == -1).assertTrue(); + sleep(1000); + done(); + } catch (error) { + console.info("logMessage abnormal_contact_favorite_test_8100: raw_contact insert error = " + error); + done(); + } + }); + + /** + * @tc.number abnormal_contact_blocklist_test_8200 + * @tc.name When adding to the blocklist, an error field is passed in + * @tc.desc Function test + */ + it("abnormal_contact_blocklist_test_8200", 0, async function (done) { + console.info("------logMessage abnormal_contact_blocklist_test_8200 is starting!-----"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + try { + var insertValues = { + "phone_numberss": "9999999", + }; + var id = await DAHelper.insert(contactBlocklistUri, insertValues); + console.info("logMessage abnormal_contact_blocklist_test_8200: id = " + id); + expect(id == -1).assertTrue(); + sleep(1000); + done(); + } catch (error) { + console.info("logMessage abnormal_contact_blocklist_test_8200: raw_contact insert error = " + error); + done(); + } + }); + + /** + * @tc.number abnormal_contact_group_test_8300 + * @tc.name When joining a group, an incorrect field is passed in + * @tc.desc Function test + */ + it("abnormal_contact_group_test_8300", 0, async function (done) { + console.info("------logMessage abnormal_contact_group_test_8300 is starting!-----"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + try { + var insertRawContactValues = { + "display_name": "xaioli8100" + }; + var rawContactId = await DAHelper.insert(rawContactUri, insertRawContactValues); + console.info("logMessage abnormal_contact_group_test_8300: rawContactId = " + rawContactId); + expect(rawContactId > 0).assertTrue(); + var contactDataValues1 = { + "raw_contact_id": rawContactId, + "content_typess": "group_membership", + "detail_info": 1 + }; + var contactDataId = await DAHelper.insert(contactDataUri, contactDataValues1); + console.info("abnormal_contact_group_test_8300 logMessage : contactDataId " + contactDataId); + expect(contactDataId == -1).assertTrue(); + done(); + } catch (error) { + console.info("logMessage abnormal_contact_group_test_8300: raw_contact insert error = " + error); + done(); + } + }); + + /** + * @tc.number abnormal_contact_query_test_8400 + * @tc.name When querying the basic information of multiple contacts, an error field is passed in + * @tc.desc Function test + */ + it("abnormal_contact_query_test_8400", 0, async function (done) { + console.info("------------abnormal_contact_query_test_8400 is starting!-----------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + try { + var rawContactValues = { + "display_name": "xiaotian8400" + }; + var rawContactId = await DAHelper.insert(rawContactUri, rawContactValues); + console.info("logMessage abnormal_contact_query_test_8400: rawContactId = " + rawContactId); + expect(rawContactId > 0).assertTrue(); + var rawContactValues = { + "display_name": "xiaoli8400" + }; + var rawContactIdFirst = await DAHelper.insert(rawContactUri, rawContactValues); + console.info("logMessage abnormal_contact_query_test_8400: rawContactIdFirst = " + rawContactIdFirst); + expect(rawContactIdFirst > 0).assertTrue(); + await abnormalQuery(); + await deleteRawContact("abnormal_contact_query_test_8400"); + done(); + } catch (error) { + console.info('logMessage abnormal_contact_query_test_8400: raw_contact insert error' + error); + done(); + } + + async function abnormalQuery() { + var resultColumns = ["id", "display_name"]; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("ids", rawContactId.toString()); + condition.or(); + condition.equalTo("ids", rawContactIdFirst.toString()); + try { + var resultSet = await DAHelper.query(rawContactUri, resultColumns, condition); + expect(resultSet.goToFirstRow()).assertEqual(false); + console.info('logMessage abnormal_contact_query_test_8400: goToFirstRow' + resultSet.goToFirstRow()); + resultSet.close(); + } catch (error) { + console.info('logMessage abnormal_contact_query_test_8400: query error = ' + error); + done(); + } + } + }); + + /** + * @tc.number abnormal_contact_query_test_8500 + * @tc.name When querying the basic information of all contacts, an error field is passed in + * @tc.desc Function test + */ + it("abnormal_contact_query_test_8500", 0, async function (done) { + console.info("------------abnormal_contact_query_test_8500 is starting!-----------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + try { + var rawContactValues = { + "display_name": "xiaotian8500" + }; + var rawContactId = await DAHelper.insert(rawContactUri, rawContactValues); + console.info("logMessage abnormal_contact_query_test_8500: rawContactId = " + rawContactId); + expect(rawContactId > 0).assertTrue(); + var rawContactValues = { + "display_name": "xiaoli8500" + }; + var rawContactIdFirst = await DAHelper.insert(rawContactUri, rawContactValues); + console.info("logMessage abnormal_contact_query_test_8500: rawContactIdFirst = " + rawContactIdFirst); + expect(rawContactIdFirst > 0).assertTrue(); + await abnormalQuery(); + await deleteRawContact("abnormal_contact_query_test_8500"); + done(); + } catch (error) { + console.info('logMessage abnormal_contact_query_test_8500: raw_contact insert error' + error); + done(); + } + + async function abnormalQuery() { + var resultColumns = ["id", "display_name"]; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.greaterThan("ids", "0"); + try { + var resultSet = await DAHelper.query(rawContactUri, resultColumns, condition); + expect(resultSet.goToFirstRow()).assertEqual(false); + console.info('logMessage abnormal_contact_query_test_8500: goToFirstRow' + resultSet.goToFirstRow()); + resultSet.close(); + } catch (error) { + console.info('logMessage abnormal_contact_query_test_8500: query error = ' + error); + done(); + } + } + }); + + /** + * @tc.number abnormal_contact_query_test_8600 + * @tc.name When querying all the information of a single contact, an error field is passed in + * @tc.desc Function test + */ + it("abnormal_contact_query_test_8600", 0, async function (done) { + console.info("------------abnormal_contact_query_test_8600 is starting!-----------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + try { + var rawContactValues = { + "display_name": "xiaotian8600" + }; + var rawContactId = await DAHelper.insert(rawContactUri, rawContactValues); + console.info("logMessage abnormal_contact_query_test_8600: rawContactId = " + rawContactId); + expect(rawContactId > 0).assertTrue(); + await abnormalQuery(); + await deleteRawContact("abnormal_contact_query_test_8600"); + done(); + } catch (error) { + console.info('logMessage abnormal_contact_query_test_8600: raw_contact insert error' + error); + done(); + } + + async function abnormalQuery() { + var resultColumns = ["id", "display_names"]; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("id", rawContactId.toString()); + try { + var resultSet = await DAHelper.query(rawContactUri, resultColumns, condition); + expect(resultSet.goToFirstRow()).assertEqual(false); + console.info('logMessage abnormal_contact_query_test_8600: goToFirstRow' + resultSet.goToFirstRow()); + resultSet.close(); + } catch (error) { + console.info('logMessage abnormal_contact_query_test_8600: query error = ' + error); + done(); + } + } + }); + + /** + * @tc.number abnormal_contact_query_test_8700 + * @tc.name An incorrect field was passed in when querying group members + * @tc.desc Function test + */ + it("abnormal_contact_query_test_8700", 0, async function (done) { + console.info("------------abnormal_contact_query_test_8700 is starting!-----------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + try { + var rawContactValues = { + "display_name": "xiaotian8700" + }; + var rawContactId = await DAHelper.insert(rawContactUri, rawContactValues); + console.info("logMessage abnormal_contact_query_test_8700: rawContactId = " + rawContactId); + expect(rawContactId > 0).assertTrue(); + var dataId = await insertData(rawContactId, "group_membership", 1, ""); + console.info("logMessage abnormal_contact_query_test_8700: dataId = " + dataId); + expect(dataId > 0).assertTrue(); + await abnormalQuery(); + await deleteRawContact("abnormal_contact_query_test_8700"); + done(); + } catch (error) { + console.info('logMessage abnormal_contact_query_test_8700: raw_contact insert error' + error); + done(); + } + + async function abnormalQuery() { + var resultColumns = ["raw_contact_id"]; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("content_typess", "group_membership"); + try { + var resultSet = await DAHelper.query(contactDataUri, resultColumns, condition); + expect(resultSet.goToFirstRow()).assertEqual(false); + console.info('logMessage abnormal_contact_query_test_8700: goToFirstRow' + resultSet.goToFirstRow()); + resultSet.close(); + } catch (error) { + console.info('logMessage abnormal_contact_query_test_8700: query error = ' + error); + done(); + } + } + }); + + /** + * @tc.number abnormal_contact_query_test_8800 + * @tc.name An incorrect field was passed in when querying favorite contacts + * @tc.desc Function test + */ + it("abnormal_contact_query_test_8800", 0, async function (done) { + console.info("------------abnormal_contact_query_test_8800 is starting!-----------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + try { + var rawContactValues = { + "display_name": "xiaotian8700", "favorite": 1 + }; + var rawContactId = await DAHelper.insert(rawContactUri, rawContactValues); + console.info("logMessage abnormal_contact_query_test_8800: rawContactId = " + rawContactId); + expect(rawContactId > 0).assertTrue(); + await abnormalQuery(); + await deleteRawContact("abnormal_contact_query_test_8800"); + done(); + } catch (error) { + console.info('logMessage abnormal_contact_query_test_8800: raw_contact insert error' + error); + done(); + } + + async function abnormalQuery() { + var resultColumns = []; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("ids", rawContactId.toString()); + try { + var resultSet = await DAHelper.query(rawContactUri, resultColumns, condition); + expect(resultSet.goToFirstRow()).assertEqual(false); + console.info('logMessage abnormal_contact_query_test_8800: goToFirstRow' + resultSet.goToFirstRow()); + resultSet.close(); + } catch (error) { + console.info('logMessage abnormal_contact_query_test_8800: query error = ' + error); + done(); + } + } + }); + + /** + * @tc.number abnormal_contact_query_test_8900 + * @tc.name An incorrect field was passed in when querying recent contacts + * @tc.desc Function test + */ + it("abnormal_contact_query_test_8900", 0, async function (done) { + console.info("------------abnormal_contact_query_test_8900 is starting!-----------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + try { + var rawContactValues = { + "display_name": "xiaoyuzhou", "lastest_contacted_time": 60 + }; + var rawContactId = await DAHelper.insert(rawContactUri, rawContactValues); + console.info("logMessage abnormal_contact_query_test_8900: rawContactId = " + rawContactId); + expect(rawContactId > 0).assertTrue(); + await abnormalQuery(); + await deleteRawContact("abnormal_contact_query_test_8900"); + done(); + } catch (error) { + console.info('logMessage abnormal_contact_query_test_8900: raw_contact insert error' + error); + done(); + } + + async function abnormalQuery() { + var resultColumns = []; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.greaterThan("lastest_contacted_timess", "50"); + try { + var resultSet = await DAHelper.query(rawContactUri, resultColumns, condition); + expect(resultSet.goToFirstRow()).assertEqual(false); + console.info('logMessage abnormal_contact_query_test_8900: goToFirstRow' + resultSet.goToFirstRow()); + resultSet.close(); + } catch (error) { + console.info('logMessage abnormal_contact_query_test_8900: query error = ' + error); + done(); + } + } + }); + + /** + * @tc.number abnormal_contact_query_test_9000 + * @tc.name An error field was passed in when querying the recently deleted contact + * @tc.desc Function test + */ + it("abnormal_contact_query_test_9000", 0, async function (done) { + console.info("------------abnormal_contact_query_test_9000 is starting!-----------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + try { + var rawContactValues = { + "display_name": "xiaotian" + }; + var rawContactId = await DAHelper.insert(rawContactUri, rawContactValues); + console.info("logMessage abnormal_contact_query_test_9000: rawContactId = " + rawContactId); + expect(rawContactId > 0).assertTrue(); + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("id", rawContactId.toString()); + var deleteCode = await DAHelper.delete(rawContactUri, condition); + console.info(tag + ': deleteRawContact deleteCode = ' + deleteCode); + expect(deleteCode == 0).assertTrue(); + await abnormalQuery(); + await deleteRawContact("abnormal_contact_query_test_9000"); + done(); + } catch (error) { + console.info('logMessage abnormal_contact_query_test_9000: raw_contact insert error' + error); + done(); + } + + async function abnormalQuery() { + var resultColumns = []; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.orderByDesc("delete_timess"); + try { + var resultSet = await DAHelper.query(deletedRawContactUri, resultColumns, condition); + expect(resultSet.goToFirstRow()).assertEqual(false); + console.info('logMessage abnormal_contact_query_test_9000: goToFirstRow' + resultSet.goToFirstRow()); + resultSet.close(); + } catch (error) { + console.info('logMessage abnormal_contact_query_test_9000: query error = ' + error); + done(); + } + } + }); + + /** + * @tc.number abnormal_contact_query_test_9100 + * @tc.name When querying all mobile phone numbers, an error field is passed in + * @tc.desc Function test + */ + it("abnormal_contact_query_test_9100", 0, async function (done) { + console.info("------------abnormal_contact_query_test_9100 is starting!-----------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + try { + var rawContactValues = { + "display_name": "xiaotian9100" + }; + var rawContactId = await DAHelper.insert(rawContactUri, rawContactValues); + console.info("logMessage abnormal_contact_query_test_9100: rawContactId = " + rawContactId); + expect(rawContactId > 0).assertTrue(); + var dataId = await insertData(rawContactId, "phone", "11159100", ""); + console.info("logMessage abnormal_contact_query_test_9100: dataId = " + dataId); + var dataId1 = await insertData(rawContactId, "phone", "111591009100", ""); + console.info("logMessage abnormal_contact_query_test_9100: dataId1 = " + dataId1); + await abnormalQuery(); + await deleteRawContact("abnormal_contact_query_test_9100"); + await deleteAll(contactDataUri, "abnormal_contact_query_test_9100"); + done(); + } catch (error) { + console.info('logMessage abnormal_contact_query_test_9100: raw_contact insert error' + error); + done(); + } + + async function abnormalQuery() { + var resultColumns = ["detail_info"]; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("content_typess", "phone"); + try { + var resultSet = await DAHelper.query(contactDataUri, resultColumns, condition); + expect(resultSet.goToFirstRow()).assertEqual(false); + console.info('logMessage abnormal_contact_query_test_9100: goToFirstRow' + resultSet.goToFirstRow()); + resultSet.close(); + } catch (error) { + console.info('logMessage abnormal_contact_query_test_9100: query error = ' + error); + done(); + } + } + }); + + /** + * @tc.number abnormal_contact_query_test_9200 + * @tc.name When querying all mailboxes, an error field was passed in + * @tc.desc Function test + */ + it("abnormal_contact_query_test_9200", 0, async function (done) { + console.info("------------abnormal_contact_query_test_9200 is starting!-----------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + try { + var rawContactValues = { + "display_name": "xiaotian9100" + }; + var rawContactId = await DAHelper.insert(rawContactUri, rawContactValues); + console.info("logMessage abnormal_contact_query_test_9200: rawContactId = " + rawContactId); + expect(rawContactId > 0).assertTrue(); + var dataId = await insertData(rawContactId, "email", "fox@1.com", ""); + console.info("logMessage abnormal_contact_query_test_9200: dataId = " + dataId); + var dataId1 = await insertData(rawContactId, "phone", "fox@2.com", ""); + console.info("logMessage abnormal_contact_query_test_9200: dataId1 = " + dataId1); + await abnormalQuery(); + await deleteRawContact("abnormal_contact_query_test_9200"); + await deleteAll(contactDataUri, "abnormal_contact_query_test_9200"); + done(); + } catch (error) { + console.info('logMessage abnormal_contact_query_test_9200: raw_contact insert error' + error); + done(); + } + + async function abnormalQuery() { + var resultColumns = ["detail_info"]; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("content_typess", "email"); + try { + var resultSet = await DAHelper.query(contactDataUri, resultColumns, condition); + expect(resultSet.goToFirstRow()).assertEqual(false); + console.info('logMessage abnormal_contact_query_test_9200: goToFirstRow' + resultSet.goToFirstRow()); + resultSet.close(); + } catch (error) { + console.info('logMessage abnormal_contact_query_test_9200: query error = ' + error); + done(); + } + } + }); + + /** + * @tc.number abnormal_contact_delete_test_10000 + * @tc.name When querying all mailboxes, an error field was passed in + * @tc.desc Function test + */ + it("abnormal_contact_delete_test_10000", 0, async function (done) { + console.info("------------abnormal_contact_delete_test_10000 is starting!-----------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + try { + var rawContactValues = { + "display_name": "xiaotian9300" + }; + var rawContactId = await DAHelper.insert(rawContactUri, rawContactValues); + console.info("logMessage abnormal_contact_delete_test_10000: rawContactId = " + rawContactId); + expect(rawContactId > 0).assertTrue(); + var dataId = await insertData(rawContactId, "email", "fox@1.com", ""); + console.info("logMessage abnormal_contact_delete_test_10000: dataId = " + dataId); + var dataId1 = await insertData(rawContactId, "phone", "fox@2.com", ""); + console.info("logMessage abnormal_contact_delete_test_10000: dataId1 = " + dataId1); + + var errorUri = "dataability:///com.ohos.contactsdataability/contacts/contact_datasss"; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("id", dataId.toString()); + var deleteCode = await DAHelper.delete(errorUri, condition); + console.info(tag + ': deleteAll deleteCode = ' + deleteCode); + expect(deleteCode == -1).assertTrue(); + var map = new Map(); + map.set("id", dataId.toString()); + map.set("datail_info", "fox@1.com"); + await contactsQuery(map, "abnormal_contact_delete_test_10000", contactDataUri); + await deleteRawContact("abnormal_contact_delete_test_10000"); + await deleteAll(contactDataUri, "abnormal_contact_delete_test_10000"); + done(); + } catch (error) { + console.info('logMessage abnormal_contact_delete_test_10000: raw_contact insert error' + error); + done(); + } + }); + + /** + * @tc.number abnormal_contact_delete_test_9300 + * @tc.name When deleting, an incorrect URI was passed in + * @tc.desc Function test + */ + it("abnormal_contact_delete_test_9300", 0, async function (done) { + console.info("------------abnormal_contact_delete_test_9300 is starting!-----------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + try { + var rawContactValues = { + "display_name": "xiaotian9300" + }; + var rawContactId = await DAHelper.insert(rawContactUri, rawContactValues); + console.info("logMessage abnormal_contact_delete_test_9300: rawContactId = " + rawContactId); + expect(rawContactId > 0).assertTrue(); + var dataId = await insertData(rawContactId, "email", "fox@1.com", ""); + console.info("logMessage abnormal_contact_delete_test_9300: dataId = " + dataId); + var dataId1 = await insertData(rawContactId, "phone", "fox@2.com", ""); + console.info("logMessage abnormal_contact_delete_test_9300: dataId1 = " + dataId1); + + var errorUri = "dataability:///com.ohos.contactsdataability/contacts/raw_contactsss"; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("id", rawContactId.toString()); + var deleteCode = await DAHelper.delete(errorUri, condition); + console.info(tag + ': deleteAll deleteCode = ' + deleteCode); + expect(deleteCode == -1).assertTrue(); + var map = new Map(); + map.set("id", rawContactId.toString()); + map.set("display_name", "xiaotian9300"); + await contactsQuery(map, "abnormal_contact_delete_test_9300", rawContactUri); + await deleteRawContact("abnormal_contact_delete_test_9300"); + await deleteAll(contactDataUri, "abnormal_contact_delete_test_9300"); + done(); + } catch (error) { + console.info('logMessage abnormal_contact_delete_test_9300: raw_contact insert error' + error); + done(); + } + }); + + /** + * @tc.number abnormal_contact_delete_test_9400 + * @tc.name When deleting contacts in batch, an error field is passed in + * @tc.desc Function test + */ + it("abnormal_contact_delete_test_9400", 0, async function (done) { + console.info("------------abnormal_contact_delete_test_9400 is starting!-----------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + try { + var rawContactValues = { + "display_name": "xiaotian9400" + }; + var rawContactId = await DAHelper.insert(rawContactUri, rawContactValues); + console.info("logMessage abnormal_contact_delete_test_9400: rawContactId = " + rawContactId); + expect(rawContactId > 0).assertTrue(); + var rawContactValues = { + "display_name": "xiaoli9400" + }; + var rawContactIdFirst = await DAHelper.insert(rawContactUri, rawContactValues); + console.info("logMessage abnormal_contact_delete_test_9400: rawContactIdFirst = " + rawContactIdFirst); + expect(rawContactIdFirst > 0).assertTrue(); + + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("ids", rawContactId.toString()); + condition.or(); + condition.equalTo("ids", rawContactIdFirst.toString()) + var deleteCode = await DAHelper.delete(rawContactUri, condition); + console.info('abnormal_contact_delete_test_9400 : deleteCode = ' + deleteCode); + expect(deleteCode == -1).assertTrue(); + await deleteRawContact("abnormal_contact_delete_test_9400"); + done(); + } catch (error) { + console.info('logMessage abnormal_contact_delete_test_9400: raw_contact insert error' + error); + done(); + } + }); + + /** + * @tc.number abnormal_contact_favorite_test_9500 + * @tc.name When collecting contacts in batch, the error field is transferred + * @tc.desc Function test + */ + it("abnormal_contact_favorite_test_9500", 0, async function (done) { + console.info("------------abnormal_contact_favorite_test_9500 is starting!-----------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + try { + var rawContactValues = { + "display_name": "xiaotian9500", "favorite": 0 + }; + var rawContactId = await DAHelper.insert(rawContactUri, rawContactValues); + console.info("logMessage abnormal_contact_favorite_test_9500: rawContactId = " + rawContactId); + expect(rawContactId > 0).assertTrue(); + var rawContactValues = { + "display_name": "xiaoli9500", "favorite": 0 + }; + var rawContactIdFirst = await DAHelper.insert(rawContactUri, rawContactValues); + console.info("logMessage abnormal_contact_favorite_test_9500: rawContactIdFirst = " + rawContactIdFirst); + expect(rawContactIdFirst > 0).assertTrue(); + + var condition = new ohosDataAbility.DataAbilityPredicates(); + var updateValues = { + "favorites": 1 + }; + condition.equalTo("id", rawContactId.toString()); + condition.or(); + condition.equalTo("id", rawContactIdFirst.toString()) + var code = await DAHelper.update(rawContactUri, updateValues, condition); + console.info(' abnormal_contact_favorite_test_9500 : update code = ' + deleteCode); + expect(code == -1).assertTrue(); + await deleteRawContact("abnormal_contact_favorite_test_9500"); + done(); + } catch (error) { + console.info('logMessage abnormal_contact_favorite_test_9500: raw_contact insert error' + error); + done(); + } + }); + + /** + * @tc.number abnormal_contact_insertblocklist_test_9600 + * @tc.name When collecting contacts in batch, the error field is transferred + * @tc.desc Function test + */ + it("abnormal_contact_insertblocklist_test_9600", 0, async function (done) { + console.info("------------abnormal_contact_insertblocklist_test_9600 is starting!-----------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + try { + var rawContactValues = { + "display_name": "xiaotian9600", + }; + var rawContactId = await DAHelper.insert(rawContactUri, rawContactValues); + console.info("logMessage abnormal_contact_insertblocklist_test_9600: rawContactId = " + rawContactId); + expect(rawContactId > 0).assertTrue(); + var dataId = await insertData(rawContactId, "phone", "1234567899600", ""); + console.info("logMessage abnormal_contact_insertblocklist_test_9600: dataId = " + dataId); + var rawContactValues = { + "display_name": "xiaoli9600", + }; + var rawContactIdFirst = await DAHelper.insert(rawContactUri, rawContactValues); + console.info("logMessage abnormal_contact_insertblocklist_test_9600: rawContactIdFirst = " + rawContactIdFirst); + expect(rawContactIdFirst > 0).assertTrue(); + var dataId1 = await insertData(rawContactIdFirst, "phone", "1234567899600", ""); + console.info("logMessage abnormal_contact_insertblocklist_test_9600: dataId1 = " + dataId1); + + var blist = { + "phone_numbers": "1234567899600" + }; + var code = await DAHelper.insert(contactBlocklistUri, blist); + expect(code == -1).assertTrue(); + await deleteRawContact("abnormal_contact_insertblocklist_test_9600"); + await deleteAll(contactDataUri, "abnormal_contact_insertblocklist_test_9600"); + done(); + } catch (error) { + console.info('logMessage abnormal_contact_insertblocklist_test_9600: raw_contact insert error' + error); + done(); + } + }); + + /** + * @tc.number abnormal_contact_insertGroup_test_9700 + * @tc.name When a contact joins a group in batch, an error field is passed + * @tc.desc Function test + */ + it("abnormal_contact_insertGroup_test_9700", 0, async function (done) { + console.info("------------abnormal_contact_insertGroup_test_9700 is starting!-----------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + try { + var rawContactValues = { + "display_name": "xiaotian9700" + }; + var rawContactId = await DAHelper.insert(rawContactUri, rawContactValues); + console.info("logMessage abnormal_contact_insertGroup_test_9700: rawContactId = " + rawContactId); + expect(rawContactId > 0).assertTrue(); + var contactDataValues1 = { + "raw_contact_id": rawContactId, + "content_typess": "group_membership", + "detail_info": 1 + }; + var contactDataId = await DAHelper.insert(contactDataUri, contactDataValues1); + console.info("abnormal_contact_insertGroup_test_9700 logMessage : contactDataId " + contactDataId); + expect(contactDataId == -1).assertTrue(); + var rawContactValues = { + "display_name": "xiaoli9700" + }; + var rawContactIdFirst = await DAHelper.insert(rawContactUri, rawContactValues); + console.info("logMessage abnormal_contact_insertGroup_test_9700: rawContactIdFirst = " + rawContactIdFirst); + expect(rawContactIdFirst > 0).assertTrue(); + var contactDataValues2 = { + "raw_contact_id": rawContactIdFirst, + "content_typess": "group_membership", + "detail_info": 1 + }; + var contactDataId1 = await DAHelper.insert(contactDataUri, contactDataValues2); + console.info("abnormal_contact_insertGroup_test_9700 logMessage : contactDataId1 " + contactDataId1); + expect(contactDataId1 == -1).assertTrue(); + await deleteRawContact("abnormal_contact_insertblocklist_test_9600"); + done(); + } catch (error) { + console.info('logMessage abnormal_contact_insertblocklist_test_9600: raw_contact insert error' + error); + done(); + } + }); + + /** + * @tc.number abnormal_contact_pinyinquery_test_9800 + * @tc.name Insert a name with special characters to view the converted Pinyin + * @tc.desc Function test + */ + it("abnormal_contact_pinyinquery_test_9800", 0, async function (done) { + console.info("--------logMessage abnormal_contact_pinyinquery_test_9800 is starting!-------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + var rawContactValues = { + "display_name": "李bp玉成욱" + }; + try { + var rawContactId = await DAHelper.insert(rawContactUri, rawContactValues); + sleep(1000); + console.info('logMessage abnormal_contact_pinyinquery_test_9800 rawContactId = ' + rawContactId); + expect(rawContactId > 0).assertTrue(); + var dataId = await insertData(rawContactId, "name", "李bp玉成욱", ""); + console.info('logMessage abnormal_contact_pinyinquery_test_9800 dataId = ' + dataId); + expect(dataId > 0).assertTrue(); + await query(); + await deleteRawContact("abnormal_contact_pinyinquery_test_9800"); + await deleteAll(contactDataUri, "abnormal_contact_pinyinquery_test_9800") + done(); + } catch (error) { + console.info('logMessage abnormal_contact_pinyinquery_test_9800 raw_contact insert error = ' + error); + done(); + } + + async function query() { + var resultColumns = ["search_name"]; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("raw_contact_id", rawContactId.toString()); + try { + var resultSet = await DAHelper.query(searchContactUri, resultColumns, condition); + if (resultSet.rowCount > 0) { + if (resultSet.goToFirstRow()) { + do { + var name = resultSet.getString(resultSet.getColumnIndex("search_name")); + console.info( + ' abnormal_contact_pinyinquery_test_9800 :logMessage contactsQuery name = ' + name); + expect(name == "李bp玉成욱||libpyucheng욱||lbpyc욱").assertEqual(true); + } while (resultSet.goToNextRow()); + } + } + resultSet.close(); + } catch (error) { + console.info('logMessage abnormal_contact_pinyinquery_test_9800 query error = ' + error); + done(); + } + } + }); + + /** + * @tc.number abnormal_contact_query_test_9900 + * @tc.name An incorrect field name was passed in during retrieval + * @tc.desc Function test + */ + it("abnormal_contact_query_test_9900", 0, async function (done) { + console.info("--------logMessage abnormal_contact_query_test_9900 is starting!-------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + var rawContactValues = { + "display_name": "键盘" + }; + try { + var rawContactId = await DAHelper.insert(rawContactUri, rawContactValues); + sleep(1000); + console.info('logMessage abnormal_contact_query_test_9900 rawContactId = ' + rawContactId); + expect(rawContactId > 0).assertTrue(); + var dataId = await insertData(rawContactId, "name", "键盘", ""); + console.info('logMessage abnormal_contact_query_test_9900 dataId = ' + dataId); + expect(dataId > 0).assertTrue(); + await query(); + await deleteRawContact("abnormal_contact_query_test_9900"); + await deleteAll(contactDataUri, "abnormal_contact_query_test_9900") + done(); + } catch (error) { + console.info('logMessage abnormal_contact_query_test_9900 raw_contact insert error = ' + error); + done(); + } + + async function query() { + var resultColumns = []; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.like("search_namesss", "%jp%"); + try { + var resultSet = await DAHelper.query(searchContactUri, resultColumns, condition); + console.info( + ' abnormal_contact_query_test_9900 :resultSet.goToFirstRow() = ' + resultSet.goToFirstRow()); + expect(resultSet.goToFirstRow() == false).assertTrue(); + resultSet.close(); + } catch (error) { + console.info('logMessage abnormal_contact_pinyinquery_test_9800 query error = ' + error); + done(); + } + } + }); + + afterAll(async function () { + var tag = "Contacts_test_start_deleted"; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.greaterThan("id", "0"); + var DAHelperContact = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info(tag + ': start ! DAHelperContact = ' + DAHelperContact); + var deleteBlockList = await DAHelperContact.delete(contactBlocklistUri, condition); + console.info(tag + " : logMessage : deleteBlockList = " + deleteBlockList); + var deletedGroup = await DAHelperContact.delete(groupUri, condition); + console.info(tag + " : logMessage : deletedGroup = " + deletedGroup); + var dataDeletedCode = await DAHelperContact.delete(contactDataUri, condition); + sleep(2000); + console.info(tag + " : logMessage : dataDeletedCode = " + dataDeletedCode); + var rawContactDeleted = await DAHelperContact.delete(rawContactUri, condition); + sleep(2000); + console.info(tag + " : logMessage : rawContactDeleted = " + rawContactDeleted); + var deleted = await DAHelperContact.delete(deletedUri, condition); + sleep(2000); + console.info(tag + " : logMessage : deleted = " + deleted); + }); + }); +} diff --git a/telephony/telephonyjstest/contact_function/entry/src/main/ets/MainAbility/test/contact/Groups_test.js b/telephony/telephonyjstest/contact_function/entry/src/main/ets/MainAbility/test/contact/Groups_test.js new file mode 100644 index 000000000..e3faa5030 --- /dev/null +++ b/telephony/telephonyjstest/contact_function/entry/src/main/ets/MainAbility/test/contact/Groups_test.js @@ -0,0 +1,574 @@ +/* + * 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 featureAbility from '@ohos.ability.featureAbility'; +import ohosDataAbility from '@ohos.data.dataability'; +import utils from '../Utils.ets' +import {afterAll, afterEach, beforeAll, beforeEach, describe, expect, it} from 'deccjsunit/index' + +const URI_CONTACTS = "dataability:///com.ohos.contactsdataability"; +const groupUri = "dataability:///com.ohos.contactsdataability/contacts/groups"; +import common from './common.js'; + +export default function GroupsTest() { + describe('GroupsTest', function () { + console.info('logMessage GroupsTest start! '); + + async function groupsQuery(map, tag) { + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info(tag + ': groupsQuery start ! DAHelper = ' + DAHelper); + var resultColumns = []; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("id", map.get("id")); + try { + if (resultSet.rowCount > 0 && resultSet.goToFirstRow()) { + do { + for (var [key, value] of map) { + var dbresult = resultSet.getString(resultSet.getColumnIndex(key)); + console.info(tag + ': logMessage groupsQuery key =' + key + 'dbresult :' + dbresult + + ' value : ' + value); + expect(value == dbresult).assertTrue(); + } + } while (resultSet.goToNextRow()); + } + resultSet.close(); + } catch (error) { + console.info(tag + ': logMessage groupsQuery: error = ' + error); + } + } + + async function queryIdForDelete(map, tag) { + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info(tag + ': queryIdForDelete start ! DAHelper = ' + DAHelper); + var resultColumns = common.getCallLogResultColumns(); + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("id", map.get("id")); + try { + var resultSet = await DAHelper.query(groupUri, resultColumns, condition); + expect(resultSet.goToFirstRow() == false).assertTrue(); + console.info(tag + " :logMessage queryIdForDelete: goToFirstRow " + resultSet.goToFirstRow()); + resultSet.close(); + } catch (error) { + console.info(tag + " :logMessage queryIdForDelete: error = " + error); + } + } + + async function deleteAll(uri, tag) { + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.greaterThan("id", "0"); + var deleteCode = await DAHelper.delete(uri, condition); + console.info(tag + ': deleteAll deleteCode = ' + deleteCode); + expect(deleteCode == 0).assertTrue(); + } + + /** + * @tc.number group_insert_test_100 + * @tc.name Insert group + * @tc.desc Function test + */ + it("group_insert_test_100", 0, async function (done) { + console.info("---------logMessage group_insert_test_100 is starting!----------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + try { + var groupId = await DAHelper.insert(groupUri, common.getProfileGroup()); + console.info("logMessage group_insert_test_100: groupId = " + groupId); + expect(groupId > 0).assertTrue(); + var map = common.getProfileGroupMap(); + map.set("id", groupId.toString()); + await groupsQuery(map, "group_insert_test_100"); + await deleteAll(groupUri, "group_insert_test_100"); + done(); + } catch (error) { + console.info("logMessage group_insert_test_100: group insert error = " + error); + done(); + } + }); + + /** + * @tc.number group_update_test_500 + * @tc.name Update group + * @tc.desc Function test + */ + it("group_update_test_500", 0, async function (done) { + console.info("---------logMessage group_update_test_500 is starting!----------"); + if(utils.notCheck){ + expect(true).assertTrue(); + done(); + return; + } + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + try { + var groupId = await DAHelper.insert(groupUri, common.getProfileGroup()); + console.info("logMessage group_update_test_500: groupId = " + groupId); + expect(groupId > 0).assertTrue(); + await groupUpdate(); + await deleteAll(groupUri, "group_update_test_500"); + done(); + } catch (error) { + console.info("logMessage group_update_test_500: group insert error = " + error); + done(); + } + + async function groupUpdate() { + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("id", groupId.toString()); + try { + var updateCode = await DAHelper.update(groupUri, common.getProfileUpdateGroup(), condition); + console.info("logMessage group_update_test_500: updateCode = " + updateCode); + expect(updateCode == 0).assertTrue(); + var map = common.getProfileUpdateGroupMap(); + map.set("id", groupId.toStirng()); + await groupsQuery(map, "group_update_test_500"); + } catch (error) { + console.info("logMessage group_update_test_500: update error = " + error); + done(); + } + } + }); + + /** + * @tc.number group_delete_test_200 + * @tc.name Delete group + * @tc.desc Function test + */ + it("group_delete_test_200", 0, async function (done) { + console.info("---------logMessage group_delete_test_200 is starting!----------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + try { + var groupId = await DAHelper.insert(groupUri, common.getProfileGroup()); + console.info("logMessage group_delete_test_200: groupId = " + groupId); + expect(groupId > 0).assertTrue(); + await groupDelete(); + done(); + } catch (error) { + console.info("logMessage group_delete_test_200: group insert error = " + error); + done(); + } + async function groupDelete() { + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("id", groupId.toString()); + try { + var deleteCode = await DAHelper.delete(groupUri, condition); + console.info("logMessage group_delete_test_200 : deleteCode = " + deleteCode); + expect(deleteCode == 0).assertTrue(); + var map = new Map(); + map.set("id", groupId.toString()); + await queryIdForDelete(map, "group_delete_test_200"); + } catch (error) { + console.info("logMessage group_delete_test_200 : delete error = " + error); + done(); + } + } + }); + + /** + * @tc.number group_query_test_300 + * @tc.name Query a group + * @tc.desc Function test + */ + it("group_query_test_300", 0, async function (done) { + console.info("------------logMessage group_query_test_300 is starting!-----------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + try { + var groupId = await DAHelper.insert(groupUri, common.getProfileGroup()); + console.info("logMessage group_query_test_300: groupId = " + groupId); + expect(groupId > 0).assertTrue(); + var map = common.getProfileGroupMap(); + map.set("id", groupId.toString()); + await groupsQuery(map, "logMessage group_query_test_300"); + await deleteAll(groupUri, "group_query_test_300"); + done(); + } catch (error) { + console.info("logMessage group_query_test_300: group insert error = " + error); + done(); + } + }); + + /** + * @tc.number group_query_test_400 + * @tc.name Query all groups + * @tc.desc Function test + */ + it("group_query_test_400", 0, async function (done) { + console.info("------------logMessage group_query_test_400 is starting!-----------"); + console.info("---------logMessage getDbHelper start!----------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + console.info('logMessage uri = ' + URI_CONTACTS); + var groupUri = "dataability:///com.ohos.contactsdataability/contacts/groups"; + + var insertValues = { + "group_name": "ManagerSecondGroup" + }; + try { + var groupId = await DAHelper.insert(groupUri, insertValues); + console.info("logMessage group_query_test_400: groupId = " + groupId); + expect(groupId > 0).assertTrue(); + await groupQuery(); + await deleteAll(groupUri, "group_query_test_400"); + done(); + } catch (error) { + console.info("logMessage group_query_test_400: group insert error = " + error); + done(); + } + + async function groupQuery() { + var resultColumns = ["id", "group_name"]; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.greaterThan("id", "0"); + try { + var resultSet = await DAHelper.query(groupUri, resultColumns, condition); + console.info("logMessage group_query_test_400: resultSet.rowCount = " + resultSet.rowCount); + expect(resultSet.rowCount == 1).assertTrue(); + resultSet.close(); + } catch (error) { + console.info("group_query_test_400 resultSet query error = " + error); + done(); + } + } + }); + + /** + * @tc.number abnormal_group_insert_test_600 + * @tc.name abnormal insert + * @tc.desc Function test + */ + it("abnormal_group_insert_test_600", 0, async function (done) { + console.info("---------logMessage abnormal_group_insert_test_600 is starting!----------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + const errorUri = "dataability:///com.ohos.contactsdataability/contacts/groupssss"; + try { + var groupId = await DAHelper.insert(errorUri, common.getProfileGroup()); + console.info("logMessage abnormal_group_insert_test_600: groupId = " + groupId); + expect(groupId == -1).assertTrue(); + done(); + } catch (error) { + console.info("logMessage abnormal_group_insert_test_600: group insert error = " + error); + done(); + } + }); + + /** + * @tc.number abnormal_group_update_test_700 + * @tc.name abnormal update + * @tc.desc Function test + */ + it("abnormal_group_update_test_700", 0, async function (done) { + console.info("---------logMessage abnormal_group_update_test_700 is starting!----------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + try { + var groupId = await DAHelper.insert(groupUri, common.getProfileGroup()); + console.info("logMessage abnormal_group_update_test_700: groupId = " + groupId); + expect(groupId > 0).assertTrue(); + await groupUpdate(); + await deleteAll(groupUri, "abnormal_group_update_test_700"); + done(); + } catch (error) { + console.info("logMessage abnormal_group_update_test_700: group insert error = " + error); + done(); + } + + async function groupUpdate() { + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("id", groupId.toString()); + var updateValue = { + "group_notesss": "6666" + } + try { + var updateCode = await DAHelper.update(groupUri, updateValue, condition); + console.info("logMessage abnormal_group_update_test_700: updateCode = " + updateCode); + expect(updateCode == -1).assertTrue(); + var map = common.getProfileUpdateGroupMap(); + map.set("id", groupId.toStirng()); + await groupsQuery(map, "abnormal_group_update_test_700"); + } catch (error) { + console.info("logMessage abnormal_group_update_test_700: update error = " + error); + done(); + } + } + }); + + /** + * @tc.number abnormal_group_delete_test_800 + * @tc.name abnormal delete + * @tc.desc Function test + */ + it("abnormal_group_delete_test_800", 0, async function (done) { + console.info("---------logMessage abnormal_group_delete_test_800 is starting!----------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + try { + var groupId = await DAHelper.insert(groupUri, common.getProfileGroup()); + console.info("logMessage abnormal_group_delete_test_800: groupId = " + groupId); + expect(groupId > 0).assertTrue(); + await groupDelete(); + await deleteAll(groupUri, "abnormal_group_delete_test_800"); + done(); + } catch (error) { + console.info("logMessage abnormal_group_delete_test_800: group insert error = " + error); + done(); + } + async function groupDelete() { + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("idss", groupId.toString()); + try { + var deleteCode = await DAHelper.delete(groupUri, condition); + console.info("logMessage abnormal_group_delete_test_800 : deleteCode = " + deleteCode); + expect(deleteCode == -1).assertTrue(); + var map = common.getProfileUpdateGroupMap(); + map.set("id", groupId.toStirng()); + await groupsQuery(map, "abnormal_group_delete_test_800"); + } catch (error) { + console.info("logMessage abnormal_group_delete_test_800 : delete error = " + error); + done(); + } + } + }); + + /** + * @tc.number abnormal_group_query_test_900 + * @tc.name abnormal query + * @tc.desc Function test + */ + it("abnormal_group_query_test_900", 0, async function (done) { + console.info("------------logMessage abnormal_group_insert_test_900 is starting!-----------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + var insertValues = { + "group_name": "PersonnelDepartment" + }; + try { + var groupId = await DAHelper.insert(groupUri, insertValues); + console.info("logMessage abnormal_group_insert_test_900: groupId = " + groupId); + expect(groupId > 0).assertTrue(); + await groupQuery(DAHelper); + await deleteAll(groupUri, "abnormal_group_insert_test_900"); + done(); + } catch (error) { + console.info("logMessage abnormal_group_insert_test_900: group insert error = " + error); + done(); + } + + async function groupQuery(DAHelper) { + var resultColumns = ["id", "group_namesss"]; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("id", groupId.toString()); + try { + var resultSet = await DAHelper.query(groupUri, resultColumns, condition); + console.info('abnormal_group_insert_test_900 resultSet.goToFirstRow() = ' + resultSet.goToFirstRow()); + expect(resultSet.goToFirstRow() == false).assertTrue(); + resultSet.close(); + } catch (error) { + console.info('abnormal_group_insert_test_900 query error ' + error); + done(); + } + } + }); + + /** + * @tc.number group_insert_test_1000 + * @tc.name Adding multiple groups + * @tc.desc Function test + */ + it("group_insert_test_1000", 0, async function (done) { + console.info("------------logMessage group_insert_test_1000 is starting!-----------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + var insertValuesOne = { + "group_name": "test1000" + }; + var insertValuesTwo = { + "group_name": "test1000" + }; + var insertValuesThree = { + "group_name": "test1000" + }; + var array = [] + array[0] = insertValuesOne; + array[1] = insertValuesTwo; + array[2] = insertValuesThree; + try { + var code = await DAHelper.batchInsert(groupUri, array); + console.info("logMessage group_insert_test_1000: batchInsert code = " + code); + expect(code == 0).assertTrue(); + await groupQuery(DAHelper); + await deleteAll(groupUri, "group_insert_test_1000"); + done(); + } catch (error) { + console.info("logMessage group_insert_test_1000: group insert error = " + error); + done(); + } + + async function groupQuery(DAHelper) { + var groupSize = 3; + var resultColumns = ["id", "group_name"]; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("group_name", "test1000"); + try { + var resultSet = await DAHelper.query(groupUri, resultColumns, condition); + console.info('group_insert_test_1000 resultSet.rowCount = ' + resultSet.rowCount); + expect(resultSet.rowCount == groupSize).assertTrue(); + resultSet.close(); + } catch (error) { + console.info('group_insert_test_1000 query error ' + error); + done(); + } + } + }); + + /** + * @tc.number group_delete_test_1100 + * @tc.name delete multiple groups + * @tc.desc Function test + */ + it("group_delete_test_1100", 0, async function (done) { + console.info("------------logMessage group_delete_test_1100 is starting!-----------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + var insertValuesOne = { + "group_name": "test1100" + }; + var insertValuesTwo = { + "group_name": "test1100" + }; + var insertValuesThree = { + "group_name": "test1100" + }; + var array = [] + array[0] = insertValuesOne; + array[1] = insertValuesTwo; + array[2] = insertValuesThree; + try { + var code = await DAHelper.batchInsert(groupUri, array); + console.info("logMessage group_delete_test_1100: batchInsert code = " + code); + expect(code == 0).assertTrue(); + await deleteAll(groupUri, "group_delete_test_1100"); + await groupQuery(DAHelper); + done(); + } catch (error) { + console.info("logMessage group_delete_test_1100: group insert error = " + error); + done(); + } + + async function groupQuery(DAHelper) { + var groupSize = 0; + var resultColumns = ["id", "group_name"]; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("group_name", "test1100"); + try { + var resultSet = await DAHelper.query(groupUri, resultColumns, condition); + console.info('group_delete_test_1100 resultSet.rowCount = ' + resultSet.rowCount); + expect(resultSet.rowCount == groupSize).assertTrue(); + resultSet.close(); + } catch (error) { + console.info('group_delete_test_1100 query error ' + error); + done(); + } + } + }); + + /** + * @tc.number group_update_test_1200 + * @tc.name update multiple groups + * @tc.desc Function test + */ + it("group_update_test_1200", 0, async function (done) { + console.info("------------logMessage group_update_test_1200 is starting!-----------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + var insertValuesOne = { + "group_name": "test1200" + }; + var insertValuesTwo = { + "group_name": "test1200" + }; + var insertValuesThree = { + "group_name": "test1200" + }; + var array = [] + array[0] = insertValuesOne; + array[1] = insertValuesTwo; + array[2] = insertValuesThree; + try { + var code = await DAHelper.batchInsert(groupUri, array); + console.info("logMessage group_update_test_1200: batchInsert code = " + code); + expect(code == 0).assertTrue(); + await groupUpdateThree(DAHelper); + await groupQuery(DAHelper); + await deleteAll(groupUri, "group_update_test_1200"); + done(); + } catch (error) { + console.info("logMessage group_update_test_1200: group insert error = " + error); + done(); + } + + async function groupQuery(DAHelper) { + var groupSize = 3; + var resultColumns = ["id", "group_name"]; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("group_name", "test120000"); + try { + var resultSet = await DAHelper.query(groupUri, resultColumns, condition); + console.info("logMessage group_update_test_1200: resultSet.rowCount = " + resultSet.rowCount); + expect(resultSet.rowCount == groupSize).assertTrue(); + resultSet.close(); + } catch (error) { + console.info('group_update_test_1200 query error ' + error); + done(); + } + } + }); + + async function groupUpdateThree(DAHelper) { + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("group_name", "test1200"); + var updateValue = { + "group_name": "test120000" + } + try { + var updateCode = await DAHelper.update(groupUri, updateValue, condition); + console.info("logMessage group_update_test_1200: updateCode = " + updateCode); + expect(updateCode == 0).assertTrue(); + } catch (error) { + console.info("logMessage group_update_test_1200: update error = " + error); + } + } + + afterAll(async function (done) { + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.notEqualTo("id", "0"); + try { + var deleteCode = await DAHelper.delete(groupUri, condition); + console.info("logMessage group_deleted : deleteCode = " + deleteCode); + done(); + } catch (error) { + console.info("logMessage group_deleted: group insert error = " + error); + done(); + } + }); + }) +} \ No newline at end of file diff --git a/telephony/telephonyjstest/contact_function/entry/src/main/ets/MainAbility/test/contact/ObjectInterface_test.js b/telephony/telephonyjstest/contact_function/entry/src/main/ets/MainAbility/test/contact/ObjectInterface_test.js new file mode 100644 index 000000000..955a22329 --- /dev/null +++ b/telephony/telephonyjstest/contact_function/entry/src/main/ets/MainAbility/test/contact/ObjectInterface_test.js @@ -0,0 +1,915 @@ +/* + * 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 contactsapi from "@ohos.contactsapi"; +import utils from '../Utils.ets' +import {afterAll, afterEach, beforeAll, beforeEach, describe, expect, it} from 'deccjsunit/index' +import common from './common.js'; + +const URI_CONTACTS = "dataability:///com.ohos.contactsdataability"; +const groupUri = "dataability:///com.ohos.contactsdataability/contacts/groups"; +const rawContactUri = "dataability:///com.ohos.contactsdataability/contacts/raw_contact"; +const profileRawContactUri = "dataability:///com.ohos.contactsdataability/profile/raw_contact"; + +export default function ObjectInterfaceTest() { + describe('ObjectInterfaceTest', function () { + function sleep(numberMillis) { + var now = new Date(); + var exitTime = now.getTime() + numberMillis; + while (true) { + now = new Date(); + if (now.getTime() > exitTime) + return; + } + } + + var contactData = { + id: 0, + key: "0", + contactAttributes: { + attributes: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14] + }, + emails: [{ + email: "email", labelName: "自定义邮箱", labelId: 1, displayName: "emailDisplayName" + }], + events: [{ + eventDate: "event", labelName: "自定义event", labelId: 2 + }], + groups: [{ + groupId: 1, title: "群组" + }], + imAddresses: [{ + imAddress: "imAddress", labelName: "自定义", labelId: 3 + }], + phoneNumbers: [{ + phoneNumber: "183", labelName: "自定义phoneNumbers", labelId: 4 + }], + portrait: { + uri: "content://head/0" + }, + postalAddresses: [{ + city: "南京", + country: "中国", + labelName: "labelName", + neighborhood: "neighborhood", + pobox: "pobox", + postalAddress: "postalAddress", + postcode: "postcode", + region: "region", + street: "street", + labelId: 5 + }], + relations: [{ + relationName: "relationName", labelName: "自定义relationName", labelId: 6 + }], + sipAddresses: [{ + sipAddress: "sipAddress", labelName: "自定义sipAddress", labelId: 6 + }], + websites: [{ + website: "website" + }], + name: { + familyName: "familyName", + familyNamePhonetic: "familyNamePhonetic", + fullName: "小李", + givenName: "givenName", + givenNamePhonetic: "givenNamePhonetic", + middleName: "middleName", + middleNamePhonetic: "middleNamePhonetic", + namePrefix: "namePrefix", + nameSuffix: "nameSuffix" + }, + nickName: { + nickName: "nickName" + }, + note: { + noteContent: "note" + }, + organization: { + name: "TT", title: "开发" + } + }; + + var gRawContactId; + var gGroup; + + /** + * @tc.number contactsApi_insert_test_100 + * @tc.name Insert contact information + * @tc.desc Function test + */ + it("contactsApi_insert_test_100", 0, async function (done) { + try { + var rawContactId = await contactsapi.addContact(contactData); + console.info("contactsApi_insert_test_100 : rawContactId = " + rawContactId); + gRawContactId = rawContactId; + expect(gRawContactId > 0).assertTrue(); + done(); + } catch (error) { + console.info("contactsApi_insert_test_100 : raw_contact insert error = " + error); + done(); + } + sleep(2000) + }); + + /** + * @tc.number contactsApi_delete_test_200 + * @tc.name Delete contact information + * @tc.desc Function test + */ + it("contactsApi_delete_test_200", 0, async function (done) { + var deleteId = gRawContactId; + try { + var deleteCode = await contactsapi.deleteContact(deleteId); + var gDelete = deleteCode; + console.info("contactsApi_delete_test_200 : deleteCode = " + deleteCode); + expect(gDelete == 0).assertTrue(); + done(); + } catch (error) { + console.info("contactsApi_delete_test_200 : delete error = " + error); + done(); + } + sleep(2000) + }); + + /** + * @tc.number contactsApi_update_test_300 + * @tc.name Update contact information + * @tc.desc Function test + */ + it("contactsApi_update_test_300", 0, async function (done) { + if(utils.notCheck){ + expect(true).assertTrue(); + done(); + return; + } + var rawContactId = await contactsapi.addContact(contactData); + console.info("contactsApi_insert_test_300 : rawContactId = " + rawContactId); + gRawContactId = rawContactId; + expect(rawContactId > 0).assertTrue(); + + var updateValues = { + id: gRawContactId, name: { + fullName: "小红" + } + }; + var condition = { + attributes: [6] + } + try { + var updateCode = await contactsapi.updateContact(updateValues, condition); + console.info("contactsApi_update_test_300 : updateCode = " + updateCode); + expect(updateCode == 0).assertTrue(); + done(); + } catch (error) { + console.info("contactsApi_update_test_300 : update error = " + error); + done(); + } + sleep(2000) + }); + + /** + * @tc.number contactsApi_query_contact_test_400 + * @tc.name Query contacts information + * @tc.desc Function test + */ + it("contactsApi_query_contact_test_400", 0, async function (done) { + var queryId = gRawContactId; + try { + var resultSet = await contactsapi.queryContact(queryId); + console.info("contactsApi_query_contact_test_400 : query resultSet = " + JSON.stringify(resultSet)); + expect(resultSet != null).assertTrue(); + done(); + } catch (error) { + console.info("contactsApi_query_contact_test_400 query error = " + error); + done(); + } + sleep(2000) + }); + + /** + * @tc.number contactsApi_query_contact_test_500 + * @tc.name Query contacts information + * @tc.desc Function test + */ + it("contactsApi_query_contact_test_500", 0, async function (done) { + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + var queryId = gRawContactId.toString(); + var holder = { + bundleName: "com.ohos.contacts", displayName: "phone", holderId: 1 + } + try { + var resultSet = await contactsapi.queryContact(queryId, holder); + console.info("contactsApi_query_contact_test_500 : query resultSet = " + JSON.stringify(resultSet)); + expect(resultSet != null).assertTrue(); + done(); + } catch (error) { + console.info("contactsApi_query_contact_test_500 query error = " + error); + done(); + } + sleep(2000) + }); + + /** + * @tc.number contactsApi_query_contact_test_600 + * @tc.name Query contacts information + * @tc.desc Function test + */ + it("contactsApi_query_contact_test_600", 0, async function (done) { + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + var queryId = gRawContactId.toString(); + var holder = { + bundleName: "com.ohos.contacts", displayName: "phone", holderId: 1 + }; + var ContactAttributes = { + attributes: [1, 5, 6] + } + try { + var resultSet = await contactsapi.queryContact(queryId, holder, ContactAttributes); + console.info("contactsApi_query_contact_test_600 : query resultSet = " + JSON.stringify(resultSet)); + expect(resultSet != null).assertTrue(); + done(); + } catch (error) { + console.info("contactsApi_query_contact_test_600 query error = " + error); + done(); + } + sleep(2000) + }); + + /** + * @tc.number contactsApi_query_contacts_test_700 + * @tc.name Query contacts information + * @tc.desc Function test + */ + it("contactsApi_query_contacts_test_700", 0, async function (done) { + try { + var resultSet = await contactsapi.queryContacts(); + console.info("contactsApi_query_contacts_test_700 : query resultSet = " + JSON.stringify(resultSet)); + expect(resultSet != null).assertTrue(); + done(); + } catch (error) { + console.info("contactsApi_query_contacts_test_700 query error = " + error); + done(); + } + sleep(2000) + }); + + /** + * @tc.number contactsApi_query_contacts_test_800 + * @tc.name Query contacts information + * @tc.desc Function test + */ + it("contactsApi_query_contacts_test_800", 0, async function (done) { + var holder = { + bundleName: "com.ohos.contacts", displayName: "phone", holderId: 1 + } + try { + var resultSet = await contactsapi.queryContacts(holder); + console.info("contactsApi_query_contacts_test_800 : query resultSet = " + JSON.stringify(resultSet)); + expect(resultSet != null).assertTrue(); + done(); + } catch (error) { + console.info("contactsApi_query_contacts_test_800 query error = " + error); + done(); + } + sleep(2000) + }); + + /** + * @tc.number contactsApi_query_contacts_test_900 + * @tc.name Query contacts information + * @tc.desc Function test + */ + it("contactsApi_query_contacts_test_900", 0, async function (done) { + var ContactAttributes = { + attributes: [1, 5, 6] + } + try { + var resultSet = await contactsapi.queryContacts(ContactAttributes); + console.info("contactsApi_query_contacts_test_900 : query resultSet = " + JSON.stringify(resultSet)); + expect(resultSet != null).assertTrue(); + done(); + } catch (error) { + console.info("contactsApi_query_contacts_test_900 query error = " + error); + done(); + } + sleep(2000) + }); + + /** + * @tc.number contactsApi_query_contacts_test_1000 + * @tc.name Query contacts information + * @tc.desc Function test + */ + it("contactsApi_query_contacts_test_1000", 0, async function (done) { + var holder = { + bundleName: "com.ohos.contacts", displayName: "phone", holderId: 1 + }; + var ContactAttributes = { + attributes: [1, 5, 6] + } + try { + var resultSet = await contactsapi.queryContacts(holder, ContactAttributes); + console.info("contactsApi_query_contacts_test_1000 : query resultSet = " + JSON.stringify(resultSet)); + expect(resultSet != null).assertTrue(); + done(); + } catch (error) { + console.info("contactsApi_query_contacts_test_1000 query error = " + error); + done(); + } + sleep(2000) + }); + + /** + * @tc.number contactsApi_query_email_test_1100 + * @tc.name Query email information + * @tc.desc Function test + */ + it("contactsApi_query_email_test_1100", 0, async function (done) { + var email = "email"; + var holder = { + bundleName: "com.ohos.contacts", displayName: "phone", holderId: 1 + } + try { + var resultSet = await contactsapi.queryContactsByEmail(email, holder); + console.info("contactsApi_query_email_test_1100 : query resultSet = " + JSON.stringify(resultSet)); + expect(resultSet != null).assertTrue(); + done(); + } catch (error) { + console.info("contactsApi_query_email_test_1100 query error = " + error); + done(); + } + sleep(2000) + }); + + /** + * @tc.number contactsApi_query_email_test_1200 + * @tc.name Query email information + * @tc.desc Function test + */ + it("contactsApi_query_email_test_1200", 0, async function (done) { + var email = "email"; + try { + var resultSet = await contactsapi.queryContactsByEmail(email); + console.info("contactsApi_query_email_test_1200 : query resultSet = " + JSON.stringify(resultSet)); + expect(resultSet != null).assertTrue(); + done(); + } catch (error) { + console.info("contactsApi_query_email_test_1200 query error = " + error); + done(); + } + sleep(2000) + }); + + /** + * @tc.number contactsApi_query_email_test_1300 + * @tc.name Query email information + * @tc.desc Function test + */ + it("contactsApi_query_email_test_1300", 0, async function (done) { + var email = "email"; + var holder = { + bundleName: "com.ohos.contacts", displayName: "phone", holderId: 1 + }; + var ContactAttributes = { + attributes: [1, 5, 6] + } + try { + var resultSet = await contactsapi.queryContactsByEmail(email, holder, ContactAttributes); + console.info("contactsApi_query_email_test_1300 : query resultSet = " + JSON.stringify(resultSet)); + expect(resultSet != null).assertTrue(); + done(); + } catch (error) { + console.info("contactsApi_query_email_test_1300 query error = " + error); + done(); + } + sleep(2000) + }); + + /** + * @tc.number contactsApi_query_email_test_1400 + * @tc.name Query email information + * @tc.desc Function test + */ + it("contactsApi_query_email_test_1400", 0, async function (done) { + var email = "email"; + var ContactAttributes = { + attributes: [1, 5, 6] + } + try { + var resultSet = await contactsapi.queryContactsByEmail(email, ContactAttributes); + console.info("contactsApi_query_email_test_1400 : query resultSet = " + JSON.stringify(resultSet)); + expect(resultSet != null).assertTrue(); + done(); + } catch (error) { + console.info("contactsApi_query_email_test_1400 query error = " + error); + done(); + } + sleep(2000) + }); + + /** + * @tc.number contactsApi_query_phoneNumber_test_1500 + * @tc.name Query phoneNumber information + * @tc.desc Function test + */ + it("contactsApi_query_phoneNumber_test_1500", 0, async function (done) { + var phoneNumber = "183"; + var holder = { + bundleName: "com.ohos.contacts", displayName: "phone", holderId: 1 + } + try { + var resultSet = await contactsapi.queryContactsByPhoneNumber(phoneNumber, holder); + console.info("contactsApi_query_phoneNumber_test_1500 : query resultSet = " + JSON.stringify(resultSet)); + expect(resultSet != null).assertTrue(); + done(); + } catch (error) { + console.info("contactsApi_query_phoneNumber_test_1500 query error = " + error); + done(); + } + sleep(2000) + }); + + /** + * @tc.number contactsApi_query_phoneNumber_test_1600 + * @tc.name Query phoneNumber information + * @tc.desc Function test + */ + it("contactsApi_query_phoneNumber_test_1600", 0, async function (done) { + var phoneNumber = "183"; + var holder = { + bundleName: "com.ohos.contacts", displayName: "phone", holderId: 1 + }; + var ContactAttributes = { + attributes: [1, 5, 6] + } + try { + var resultSet = await contactsapi.queryContactsByPhoneNumber(phoneNumber, holder, ContactAttributes); + console.info("contactsApi_query_phoneNumber_test_1600 : query resultSet = " + JSON.stringify(resultSet)); + expect(resultSet != null).assertTrue(); + done(); + } catch (error) { + console.info("contactsApi_query_phoneNumber_test_1600 query error = " + error); + done(); + } + sleep(2000) + }); + + /** + * @tc.number contactsApi_query_phoneNumber_test_1700 + * @tc.name Query phoneNumber information + * @tc.desc Function test + */ + it("contactsApi_query_phoneNumber_test_1700", 0, async function (done) { + var phoneNumber = "183"; + try { + var resultSet = await contactsapi.queryContactsByPhoneNumber(phoneNumber); + console.info("contactsApi_query_phoneNumber_test_1700 : query resultSet = " + JSON.stringify(resultSet)); + expect(resultSet != null).assertTrue(); + done(); + } catch (error) { + console.info("contactsApi_query_phoneNumber_test_1700 query error = " + error); + done(); + } + sleep(2000) + }); + + /** + * @tc.number contactsApi_query_phoneNumber_test_1800 + * @tc.name Query phoneNumber information + * @tc.desc Function test + */ + it("contactsApi_query_phoneNumber_test_1800", 0, async function (done) { + var phoneNumber = "183"; + var ContactAttributes = { + attributes: [1, 5, 6] + } + try { + var resultSet = await contactsapi.queryContactsByPhoneNumber(phoneNumber, ContactAttributes); + console.info("contactsApi_query_phoneNumber_test_1800 : query resultSet = " + JSON.stringify(resultSet)); + expect(resultSet != null).assertTrue(); + done(); + } catch (error) { + console.info("contactsApi_query_phoneNumber_test_1800 query error = " + error); + done(); + } + sleep(2000) + }); + + /** + * @tc.number contactsApi_query_group_test_1900 + * @tc.name Query group + * @tc.desc Function test + */ + it("contactsApi_query_group_test_1900", 0, async function (done) { + try { + var resultSet = await contactsapi.queryGroups(); + console.info("contactsApi_query_group_test_1900 : query resultSet = " + JSON.stringify(resultSet)); + expect(resultSet.length == 0).assertTrue(); + done(); + } catch (error) { + console.info("contactsApi_query_group_test_1900 query error = " + error); + done(); + } + sleep(2000) + }); + + /** + * @tc.number contactsApi_query_group_test_2000 + * @tc.name Query group + * @tc.desc Function test + */ + it("contactsApi_query_group_test_2000", 0, async function (done) { + var holder = { + bundleName: "com.ohos.contacts", displayName: "phone", holderId: 1 + } + try { + var resultSet = await contactsapi.queryGroups(holder); + console.info("contactsApi_query_group_test_2000 : query resultSet = " + JSON.stringify(resultSet)); + expect(resultSet.length == 0).assertTrue(); + done(); + } catch (error) { + console.info("contactsApi_query_group_test_2000 query error = " + error); + done(); + } + sleep(2000) + }); + + /** + * @tc.number contactsApi_query_holders_test_2200 + * @tc.name Query holders information + * @tc.desc Function test + */ + it("contactsApi_query_holders_test_2200", 0, async function (done) { + try { + var resultSet = await contactsapi.queryHolders(); + console.info("contactsApi_query_holders_test_2200 : query resultSet = " + JSON.stringify(resultSet)); + expect(resultSet != null).assertTrue(); + done(); + } catch (error) { + console.info("contactsApi_query_holders_test_2200 query error = " + error); + done(); + } + sleep(2000) + }); + + /** + * @tc.number contactsApi_query_key_test_2300 + * @tc.name Query key information + * @tc.desc Function test + */ + it("contactsApi_query_key_test_2300", 0, async function (done) { + var idtest = gRawContactId; + var holder = { + bundleName: "com.ohos.contacts", displayName: "phone", holderId: 1 + } + try { + var resultSet = await contactsapi.queryKey(idtest, holder); + console.info("contactsApi_query_key_test_2300 : query resultSet = " + JSON.stringify(resultSet)); + expect(resultSet.length != 0).assertTrue(); + done(); + } catch (error) { + console.info("contactsApi_query_key_test_2300 query error = " + error); + done(); + } + sleep(2000) + }); + + /** + * @tc.number contactsApi_query_key_test_2400 + * @tc.name Query key information + * @tc.desc Function test + */ + it("contactsApi_query_key_test_2400", 0, async function (done) { + var idtest = gRawContactId; + console.info("contactsApi_query_key_test_2400 : query gRawContactId = " + idtest); + try { + var resultSet = await contactsapi.queryKey(idtest); + console.info("contactsApi_query_key_test_2400 : query resultSet = " + JSON.stringify(resultSet)); + expect(resultSet.length != 0).assertTrue(); + done(); + } catch (error) { + console.info("contactsApi_query_key_test_2400 query error = " + error); + done(); + } + sleep(2000) + }); + + /** + * @tc.number contactsApi_query_mycard_test_2500 + * @tc.name Query mycard information + * @tc.desc Function test + */ + it("contactsApi_query_mycard_test_2500", 0, async function (done) { + var holder = { + bundleName: "com.ohos.contacts", displayName: "phone", holderId: 1 + } + try { + var resultSet = await contactsapi.queryMyCard(holder); + console.info("contactsApi_query_mycard_test_2500 : query resultSet = " + JSON.stringify(resultSet)); + expect(resultSet.length == 0).assertTrue(); + done(); + } catch (error) { + console.info("contactsApi_query_mycard_test_2500 query error = " + error); + done(); + } + sleep(2000) + }); + + /** + * @tc.number contactsApi_isMyCard_test_2600 + * @tc.name Query mycard exist + * @tc.desc Function test + */ + it("contactsApi_isMyCard_test_2600", 0, async function (done) { + var id = 1; + try { + var isExist = await contactsapi.isMyCard(id); + console.info("contactsApi_isMyCard_test_2600 : query isExist = " + isExist); + expect(isExist == 0).assertTrue(); + done(); + } catch (error) { + console.info("contactsApi_isMyCard_test_2600 query error = " + error); + done(); + } + sleep(2000) + }); + + /** + * @tc.number contactsApi_isLocalContact_test_2700 + * @tc.name Query isLocalContact exist + * @tc.desc Function test + */ + it("contactsApi_isLocalContact_test_2700", 0, async function (done) { + var id = gRawContactId; + try { + var isExist = await contactsapi.isLocalContact(id); + console.info("logMessage contactsApi_isLocalContact_test_2700 isExist = " + isExist); + expect(isExist == 1).assertTrue(); + done(); + } catch (error) { + console.info("contactsApi_isLocalContact_test_2700 query error = " + error); + done(); + } + sleep(2000) + }); + + /** + * @tc.number abnormal_contactsApi_insert_test_2800 + * @tc.name contactsApi_insert error + * @tc.desc Function test + */ + it("abnormal_contactsApi_insert_test_2800", 0, async function (done) { + var contactDataError = {}; + try { + var rawContactId = await contactsapi.addContact(contactDataError); + console.info("abnormal_contactsApi_insert_test_2800 : rawContactId = " + rawContactId); + expect(rawContactId == -1).assertTrue(); + done(); + } catch (error) { + console.info("contactsApi_insert_test_100 : raw_contact insert error = " + error); + done(); + } + sleep(2000) + }); + + /** + * @tc.number abnormal_contactsApi_update_test_3000 + * @tc.name contactsApi_update error + * @tc.desc Function test + */ + it("abnormal_contactsApi_update_test_3000", 0, async function (done) { + var rawContactId = -1; + var updateValues = { + id: rawContactId, name: { + fullName: "小红" + } + }; + var condition = { + attributes: [6] + } + try { + var updateCode = await contactsapi.updateContact(updateValues, condition); + console.info("abnormal_contactsApi_update_test_3000 : updateCode = " + updateCode); + expect(updateCode == -1).assertTrue(); + done(); + } catch (error) { + console.info("abnormal_contactsApi_update_test_3000 : update error = " + error); + done(); + } + sleep(2000) + }); + + /** + * @tc.number abnormal_contactsApi_query_contact_test_3100 + * @tc.name contactsApi_query_contact error + * @tc.desc Function test + */ + it("abnormal_contactsApi_query_contact_test_3100", 0, async function (done) { + var queryId = "-1"; + try { + var resultSet = await contactsapi.queryContact(queryId); + if (resultSet == null) { + console.info("abnormal_contactsApi_query_contact_test_3100 is null"); + } + if (resultSet == undefined) { + console.info("abnormal_contactsApi_query_contact_test_3100 is undefined"); + } + console.info("abnormal_contactsApi_query_contact_test_3100 : updateCode = " + JSON.stringify(resultSet)); + expect(resultSet == undefined).assertTrue(); + done(); + } catch (error) { + console.info("abnormal_contactsApi_query_contact_test_3100 query error = " + error); + done(); + } + sleep(2000) + }); + + /** + * @tc.number abnormal_contactsApi_query_contacts_test_3200 + * @tc.name contactsApi_query_contacts error + * @tc.desc Function test + */ + it("abnormal_contactsApi_query_contacts_test_3200", 0, async function (done) { + var ContactAttributes = { + attributes: [100] + } + try { + var resultSet = await contactsapi.queryContacts(ContactAttributes); + if (resultSet == null) { + console.info("abnormal_contactsApi_query_contacts_test_3200 is null"); + } + if (resultSet == undefined) { + console.info("abnormal_contactsApi_query_contacts_test_3200 is undefined"); + } + console.info( + "abnormal_contactsApi_query_contacts_test_3200 : query resultSet = " + JSON.stringify(resultSet)); + expect(resultSet.length == 0).assertTrue(); + done(); + } catch (error) { + console.info("abnormal_contactsApi_query_contacts_test_3200 query error = " + error); + done(); + } + sleep(2000) + }); + + /** + * @tc.number abnormal_contactsApi_query_email_test_3300 + * @tc.name contactsApi_query_email error + * @tc.desc Function test + */ + it("abnormal_contactsApi_query_email_test_3300", 0, async function (done) { + var email = "email2222"; + try { + var resultSet = await contactsapi.queryContactsByEmail(email); + console.info("abnormal_contactsApi_query_email_test_3300 : query resultSet = " + JSON.stringify(resultSet)); + expect(resultSet.length == 0).assertTrue(); + done(); + } catch (error) { + console.info("abnormal_contactsApi_query_email_test_3300 query error = " + error); + done(); + } + sleep(2000) + }); + + /** + * @tc.number abnormal_contactsApi_query_phoneNumber_test_3400 + * @tc.name contactsApi_query_phoneNumber error + * @tc.desc Function test + */ + it("abnormal_contactsApi_query_phoneNumber_test_3400", 0, async function (done) { + var phoneNumber = "19999999"; + try { + var resultSet = await contactsapi.queryContactsByPhoneNumber(phoneNumber); + console.info( + "abnormal_contactsApi_query_phoneNumber_test_3400 : query resultSet = " + JSON.stringify(resultSet)); + expect(resultSet.length == 0).assertTrue(); + done(); + } catch (error) { + console.info("abnormal_contactsApi_query_phoneNumber_test_3400 query error = " + error); + done(); + } + sleep(2000) + }); + + /** + * @tc.number abnormal_contactsApi_query_group_test_3500 + * @tc.name contactsApi_query_group error + * @tc.desc Function test + */ + it("abnormal_contactsApi_query_group_test_3500", 0, async function (done) { + var holder = { + bundleName: "com.ohos.contacts2", displayName: "phone2", holderId: 2 + } + try { + var resultSet = await contactsapi.queryGroups(holder); + console.info("abnormal_contactsApi_query_group_test_3500 : query resultSet = " + JSON.stringify(resultSet)); + expect(resultSet.length == 0).assertTrue(); + done(); + } catch (error) { + console.info("contactsApi_query_group_test_2000 query error = " + error); + done(); + } + sleep(2000) + }); + + /** + * @tc.number abnormal_contactsApi_query_key_test_3600 + * @tc.name contactsApi_query_key error + * @tc.desc Function test + */ + it("abnormal_contactsApi_query_key_test_3600", 0, async function (done) { + var idtest = -1; + try { + var resultSet = await contactsapi.queryKey(idtest); + console.info("abnormal_contactsApi_query_key_test_3600 : query resultSet = " + JSON.stringify(resultSet)); + expect(resultSet.length == 0).assertTrue(); + done(); + } catch (error) { + console.info("abnormal_contactsApi_query_key_test_3600 query error = " + error); + done(); + } + sleep(2000) + }); + + /** + * @tc.number abnormal_contactsApi_query_mycard_test_3700 + * @tc.name contactsApi_query_mycard error + * @tc.desc Function test + */ + it("abnormal_contactsApi_query_mycard_test_3700", 0, async function (done) { + var ContactAttributes = { + attributes: [100] + }; + try { + var resultSet = await contactsapi.queryMyCard(ContactAttributes); + console.info( + "abnormal_contactsApi_query_mycard_test_3700 : query resultSet = " + JSON.stringify(resultSet)); + expect(resultSet.length == 0).assertTrue(); + done(); + } catch (error) { + console.info("abnormal_contactsApi_query_mycard_test_3700 query error = " + error); + done(); + } + sleep(2000) + }); + + /** + * @tc.number abnormal_contactsApi_isMyCard_test_3800 + * @tc.name isMyCard is not exist + * @tc.desc Function test + */ + it("abnormal_contactsApi_isMyCard_test_3800", 0, async function (done) { + var id = 999; + try { + var isExist = await contactsapi.isMyCard(id); + console.info("abnormal_contactsApi_isMyCard_test_3800 : query isExist = " + isExist); + expect(isExist == 0).assertTrue(); + done(); + } catch (error) { + console.info("abnormal_contactsApi_isMyCard_test_3800 query error = " + error); + done(); + } + sleep(2000) + }); + + /** + * @tc.number abnormal_contactsApi_isLocalContact_test_3900 + * @tc.name contactsApi_isLocalContact is not exist + * @tc.desc Function test + */ + it("abnormal_contactsApi_isLocalContact_test_3900", 0, async function (done) { + var id = 999; + try { + var isExist = await contactsapi.isLocalContact(id); + console.info("abnormal_contactsApi_isLocalContact_test_3900 : query isExist = " + isExist); + expect(isExist == 0).assertTrue(); + done(); + } catch (error) { + console.info("abnormal_contactsApi_isLocalContact_test_3900 query error = " + error); + done(); + } + sleep(2000) + }); + }); +} \ No newline at end of file diff --git a/telephony/telephonyjstest/contact_function/entry/src/main/ets/MainAbility/test/contact/Voicemail_test.js b/telephony/telephonyjstest/contact_function/entry/src/main/ets/MainAbility/test/contact/Voicemail_test.js new file mode 100644 index 000000000..d311fbdc5 --- /dev/null +++ b/telephony/telephonyjstest/contact_function/entry/src/main/ets/MainAbility/test/contact/Voicemail_test.js @@ -0,0 +1,1329 @@ +/* + * 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 featureAbility from '@ohos.ability.featureAbility'; +import ohosDataAbility from '@ohos.data.dataability'; +import {afterAll, afterEach, beforeAll, beforeEach, describe, expect, it} from 'deccjsunit/index' +import common from './common.js'; + +const URI_VOICEMAIL = "dataability:///com.ohos.voicemailability"; +const voicemailUri = "dataability:///com.ohos.voicemailability/calls/voicemail"; + +export default function VoicemailTest() { + describe('VoicemailTest', function () { + console.log("----------VoicemailTest is starting!----------"); + + async function voiceMailQuery(map, tag) { + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_VOICEMAIL); + console.info(tag + ':calllogInsertQuery start ! DAHelper = ' + DAHelper); + var resultColumns = []; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("id", map.get("id")); + try { + var resultSet = await DAHelper.query(voicemailUri, resultColumns, condition); + if (resultSet.rowCount > 0 && resultSet.goToFirstRow()) { + do { + for (var [key, value] of map) { + var dbresult = resultSet.getString(resultSet.getColumnIndex(key)); + console.info(tag + ' :logMessage voiceMailQuery key = ' + key + ' dbresult :' + dbresult + + ' value : ' + value); + expect(value == dbresult).assertTrue(); + } + } while (resultSet.goToNextRow()); + } + resultSet.close(); + } catch (error) { + console.info(tag + ":logMessage voiceMailQuery: error = " + error); + } + } + + async function voiceMailQueryForDelete(map, tag) { + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_VOICEMAIL); + console.info(tag + ': voiceMailQueryForDelete start ! DAHelper = ' + DAHelper); + var resultColumns = common.getCallLogResultColumns(); + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("id", map.get("id")); + try { + var resultSet = await DAHelper.query(voicemailUri, resultColumns, condition); + expect(resultSet.goToFirstRow() == false).assertTrue(); + console.info(tag + " :logMessage voiceMailQueryForDelete: goToFirstRow " + resultSet.goToFirstRow()); + resultSet.close(); + } catch (error) { + console.info(tag + " :logMessage voiceMailQueryForDelete: error = " + error); + } + } + + async function voiceMailQueryError(map, tag) { + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_VOICEMAIL); + console.info(tag + ': voiceMailQueryError start ! DAHelper = ' + DAHelper); + var resultColumns = common.getCallLogResultColumns(); + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("phone_number", map.get("phone_number")); + try { + var resultSet = await DAHelper.query(voicemailUri, resultColumns, condition); + expect(resultSet.goToFirstRow() == false).assertTrue(); + console.info(tag + " :logMessage voiceMailQueryError: goToFirstRow " + resultSet.goToFirstRow()); + resultSet.close(); + } catch (error) { + console.info(tag + " :logMessage voiceMailQueryError: error = " + error); + } + } + + async function voiceMailQueryForBatchInsert(array, tag) { + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_VOICEMAIL); + console.info(tag + ': voiceMailQueryForBatchInsert start ! DAHelper = ' + DAHelper); + var resultColumns = common.getCallLogResultColumns(); + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("phone_number", array[0].get("phone_number")); + try { + var resultSet = await DAHelper.query(voicemailUri, resultColumns, condition); + var size = array.size(); + console.info(tag + ' : logMessage voiceMailQueryForBatchInsert: size' + size); + expect(resultSet.rowCount == size).assertEqual(true); + var i = 0; + if (resultSet.rowCount > 0 && resultSet.goToFirstRow()) { + do { + for (var [key, value] of array[i]) { + var dbresult = resultSet.getString(resultSet.getColumnIndex(key)); + console.info(tag + ' : logMessage voiceMailQueryForBatchInsert dbresult :' + dbresult + + ' value : ' + value); + console.info( + tag + ' : logMessage voiceMailQueryForBatchInsert value ' + (value == dbresult)); + expect(value == dbresult).assertTrue(); + } + i++; + } while (resultSet.goToNextRow()); + } + resultSet.close(); + } catch (error) { + console.info(tag + " :logMessage calllogQueryByInsert: error = " + error); + } + } + + async function voiceMailDelete(tag) { + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_VOICEMAIL); + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.greaterThan("id", "0"); + var deleteCode = await DAHelper.delete(voicemailUri, condition); + console.info(tag + ': voiceMailDelete deleteCode = ' + deleteCode); + expect(deleteCode == 0).assertTrue(); + } + + /** + * @tc.number voicemail_insert_test_100 + * @tc.name Insert voicemail data + * @tc.desc Function test + */ + it("voicemail_insert_test_100", 0, async function (done) { + console.info("---------logMessage voicemail_insert_test_100 is starting!---------") + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_VOICEMAIL); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + console.info('logMessage uri = ' + URI_VOICEMAIL) + try { + var voicemailId = await DAHelper.insert(voicemailUri, common.getVoiceMail()); + console.info("logMessage voicemail_insert_test_100: voicemailId = " + voicemailId); + expect(voicemailId > 0).assertTrue(); + var map = common.getVoiceMailMap(); + map.set("id", voicemailId.toString()); + await voiceMailQuery(map, "voicemail_insert_test_100"); + await voiceMailDelete("voicemail_insert_test_100"); + done(); + } catch (error) { + console.info("logMessage voicemail_insert_test_100: voicemail insert error = " + error); + done(); + } + }); + + /** + * @tc.number voicemail_insert_test_200 + * @tc.name Insert voicemail status + * @tc.desc Function test + */ + it("voicemail_insert_test_200", 0, async function (done) { + console.info("---------logMessage voicemail_insert_test_200 is starting!---------") + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_VOICEMAIL); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + console.info('logMessage uri = ' + URI_VOICEMAIL) + + var stringValue = { + "phone_number": "1557254", "voice_status": 1 + }; + try { + var voicemailId = await DAHelper.insert(voicemailUri, stringValue) + console.info("logMessage voicemail_insert_test_200: voicemailId = " + voicemailId); + expect(voicemailId > 0).assertTrue(); + var map = new Map(); + map.set("id", voicemailId.toString()); + map.set("phone_number", "1557254"); + map.set("voice_status", "1"); + await voiceMailQuery(map, "voicemail_insert_test_200"); + await voiceMailDelete("voicemail_insert_test_200"); + done(); + } catch (error) { + console.info("logMessage voicemail_insert_test_200: voicemail insert error = " + error); + done(); + } + }); + + /** + * @tc.number voicemail_insert_test_100000 + * @tc.name Insert voicemail status + * @tc.desc Function test + */ + it("voicemail_insert_test_100000", 0, async function (done) { + console.info("---------logMessage voicemail_insert_test_100000 is starting!---------") + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_VOICEMAIL); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + console.info('logMessage uri = ' + URI_VOICEMAIL) + + var stringValue = { + "phone_number": "1557254", "voice_status": 0 + }; + try { + var voicemailId = await DAHelper.insert(voicemailUri, stringValue) + console.info("logMessage voicemail_insert_test_100000: voicemailId = " + voicemailId); + expect(voicemailId > 0).assertTrue(); + var map = new Map(); + map.set("id", voicemailId.toString()); + map.set("phone_number", "1557254"); + map.set("voice_status", "0"); + await voiceMailQuery(map, "voicemail_insert_test_100000"); + await voiceMailDelete("voicemail_insert_test_100000"); + done(); + } catch (error) { + console.info("logMessage voicemail_insert_test_100000: voicemail insert error = " + error); + done(); + } + }); + + /** + * @tc.number voicemail_update_test_1000 + * @tc.name Update voicemail data + * @tc.desc Function test + */ + it("voicemail_update_test_1000", 0, async function (done) { + console.info("------------logMessage voicemail_update_test_1000 is starting!----------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_VOICEMAIL); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + try { + var voicemailId = await DAHelper.insert(voicemailUri, common.getVoiceMail()); + console.info("logMessage voicemail_update_test_1000: voicemailId = " + voicemailId); + expect(voicemailId > 0).assertTrue(); + await voicemailUpdate(); + await voiceMailDelete("voicemail_update_test_1000"); + done(); + } catch (error) { + console.info("logMessage voicemail_update_test_1000: voicemail insert error = " + error); + done(); + } + + async function voicemailUpdate() { + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("id", voicemailId.toString()); + try { + var updateCode = await DAHelper.update(voicemailUri, common.getVoiceMailUpdate(), condition); + console.info("logMessage voicemail_update_test_1000: updateCode = " + updateCode); + expect(updateCode == 0).assertTrue(); + var map = common.getVoiceMailUpdateMap(); + map.set("id", voicemailId.toString()); + await voiceMailQuery(map, "voicemail_update_test_1000"); + } catch (error) { + console.info("logMessage voicemail_update_test_1000: update error = " + error); + done(); + } + } + }); + + /** + * @tc.number voicemail_update_test_900 + * @tc.name Update voicemail status + * @tc.desc Function test + */ + it("voicemail_update_test_900", 0, async function (done) { + console.info("------------logMessage voicemail_update_test_900 is starting!----------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_VOICEMAIL); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + var insertValues = { + "phone_number": "18862013", "voice_status": 0 + }; + try { + var voicemailId = await DAHelper.insert(voicemailUri, insertValues); + console.info("logMessage voicemail_update_test_900: voicemailId = " + voicemailId); + expect(voicemailId > 0).assertTrue(); + await voicemailUpdate(); + await voiceMailDelete("voicemail_update_test_900"); + done(); + } catch (error) { + console.info("logMessage voicemail_update_test_900: voicemail insert error = " + error); + done(); + } + + async function voicemailUpdate() { + var updateValues = { + "voice_status": 1 + }; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("id", voicemailId.toString()); + try { + var updateCode = await DAHelper.update(voicemailUri, updateValues, condition); + console.info("logMessage voicemail_update_test_900: updateCode = " + updateCode); + expect(updateCode == 0).assertTrue(); + var map = new Map(); + map.set("id", voicemailId.toString()); + map.set("voice_status", "1"); + await voiceMailQuery(map, "voicemail_update_test_900"); + } catch (error) { + console.info("logMessage voicemail_update_test_900: update error = " + error); + done(); + } + } + }); + + /** + * @tc.number voicemail_delete_test_500 + * @tc.name Delete voicemail data + * @tc.desc Function test + */ + it("voicemail_delete_test_500", 0, async function (done) { + console.info("-------------logMessage voicemail_delete_test_500 is starting!-----------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_VOICEMAIL); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + var insertValues = { + "phone_number": "100578615", "display_name": "zhangming" + }; + try { + var voiceMailId = await DAHelper.insert(voicemailUri, insertValues); + console.info("logMessage voicemail_delete_test_500: voiceMailId = " + voiceMailId); + expect(voiceMailId > 0).assertTrue(); + await VoicemailDelete(); + await voiceMailDelete("voicemail_delete_test_500"); + done(); + } catch (error) { + console.info("logMessage voicemail_delete_test_500: voicemail insert error = " + error); + done(); + } + + async function VoicemailDelete() { + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("id", voicemailId.toString()); + try { + var deleteCode = await DAHelper.delete(voicemailUri, condition); + console.info('logMessage voicemail_delete_test_500: deleteCode = ' + deleteCode); + expect(deleteCode == 0).assertTrue(); + var map = new Map(); + map.set("id", voicemailId.toString()); + await voiceMailQueryForDelete(map, "voicemail_delete_test_500"); + } catch (error) { + console.info("logMessage voicemail_delete_test_500: delete error = " + error); + done(); + } + } + }); + + /** + * @tc.number voicemail_update_test_600 + * @tc.name Delete voicemail status + * @tc.desc Function test + */ + it("voicemail_update_test_600", 0, async function (done) { + console.info("-------------logMessage voicemail_update_test_600 is starting!-----------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_VOICEMAIL); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + var insertValues1 = { + "phone_number": "100578615", "voice_status": 1 + }; + try { + var voicemailId = await DAHelper.insert(voicemailUri, insertValues1); + console.info("logMessage voicemail_update_test_600: voicemailId = " + voicemailId); + expect(voicemailId > 0).assertTrue(); + await voicemailUpdate(); + await voiceMailDelete("voicemail_update_test_600"); + done(); + } catch (error) { + console.info("logMessage voicemail_update_test_600: voicemail insert error = " + error); + done(); + } + + async function voicemailUpdate() { + var updateValues = { + "voice_status": 0 + }; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("id", voicemailId.toString()); + try { + var updateCode = await DAHelper.update(voicemailUri, updateValues, condition); + console.info('logMessage voicemail_update_test_600: deleteCode = ' + updateCode); + expect(updateCode == 0).assertTrue(); + var map = new Map(); + map.set("id", voicemailId.toString()); + map.set("voice_status", "0"); + await voiceMailQuery(map, "voicemail_update_test_600"); + } catch (error) { + console.info("logMessage voicemail_update_test_600: update error = " + error); + done(); + } + } + }); + + /** + * @tc.number voicemail_batchInsert_test_1800 + * @tc.name Insert voicemail data in batches + * @tc.desc Function test + */ + it("voicemail_batchInsert_test_1800", 0, async function (done) { + console.info("-------------logMessage voicemail_batchInsert_test_1800 is starting!-----------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_VOICEMAIL); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + var insertValuesOne = { + "phone_number": "10086", "display_name": "xiaoming" + }; + var insertValuesTwo = { + "phone_number": "12580", "display_name": "xiaohei" + }; + var insertValuesThree = { + "phone_number": "123456", "display_name": "xiaohong" + }; + var insertValuesFour = { + "phone_number": "9996325", "display_name": "xiaohei" + }; + var insertValuesFive = { + "phone_number": "18862013", "display_name": "xiaofen" + }; + var listAddBluk = []; + listAddBluk[0] = insertValuesOne; + listAddBluk[1] = insertValuesTwo; + listAddBluk[2] = insertValuesThree; + listAddBluk[3] = insertValuesFour; + listAddBluk[4] = insertValuesFive; + try { + var batchInsertCode = await DAHelper.batchInsert(voicemailUri, listAddBluk); + console.info("logMessage voicemail_batchInsert_test_1800: batchInsertCode = " + batchInsertCode); + expect(batchInsertCode == 0).assertTrue(); + await voiceMailDelete("voicemail_batchInsert_test_1800"); + done(); + } catch (error) { + console.info("logMessage voicemail_batchInsert_test_1800: batchInsert error = " + error); + done(); + } + }); + + /** + * @tc.number voicemail_batchInsert_test_1700 + * @tc.name Insert voicemail status in batches + * @tc.desc Function test + */ + it("voicemail_batchInsert_test_1700", 0, async function (done) { + console.info("-------------logMessage voicemail_batchInsert_test_1700 is starting!-----------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_VOICEMAIL); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + var insertValuesOne = { + "phone_number": "1600", "display_name": "xiaoming", "voice_status": 0 + }; + var insertValuesTwo = { + "phone_number": "1600", "display_name": "xiaohei", "voice_status": 1 + }; + var insertValuesThree = { + "phone_number": "1600", "display_name": "xiaohong", "voice_status": 0 + }; + var insertValuesFour = { + "phone_number": "1600", "display_name": "xiaohei", "voice_status": 0 + }; + var insertValuesFive = { + "phone_number": "1600", "display_name": "xiaofen", "voice_status": 1 + }; + var listAddBluk = []; + listAddBluk[0] = insertValuesOne; + listAddBluk[1] = insertValuesTwo; + listAddBluk[2] = insertValuesThree; + listAddBluk[3] = insertValuesFour; + listAddBluk[4] = insertValuesFive; + try { + var batchInsertCode = await DAHelper.batchInsert(voicemailUri, listAddBluk); + console.info("logMessage voicemail_batchInsert_test_1700: batchInsertCode = " + batchInsertCode); + expect(batchInsertCode == 0).assertTrue(); + var array = common.getvoiceMailBatchInsert(); + await voiceMailQueryForBatchInsert(array, "voicemail_batchInsert_test_1700"); + await voiceMailDelete("voicemail_batchInsert_test_1700"); + done(); + } catch (error) { + console.info("logMessage voicemail_batchInsert_test_1700: batchInsert error = " + error); + done(); + } + }); + + /** + * @tc.number voicemail_query_test_1400 + * @tc.name Query voicemail data + * @tc.desc Function test + */ + it("voicemail_query_test_1400", 0, async function (done) { + console.info("------------voicemail_query_test_1400 is starting!-----------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_VOICEMAIL); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + var insertValues = { + "phone_number": "8855220011", "display_name": "daming" + }; + try { + var voiceMailId = await DAHelper.insert(voicemailUri, insertValues); + console.info("logMessage voicemail_query_test_1400: voiceMailId = " + voiceMailId); + expect(voiceMailId > 0).assertTrue(); + await voiceMailQuery(); + await voiceMailDelete("voicemail_query_test_1400"); + done(); + } catch (error) { + console.info("logMessage voicemail_query_test_1400: voicemial insert error = " + error); + done(); + } + async function voiceMailQuery() { + var resultColumns = ["id", "display_name", "phone_number"]; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("id", voicemailId.toString()); + try { + var resultSet = await DAHelper.query(voicemailUri, resultColumns, condition); + if (resultSet.goToFirstRow()) { + do { + console.info('voicemail_query_test_1400 id = ' + resultSet.getString(0)); + expect(resultSet.getString(0) == voicemailId.toString()).assertTrue(); + console.info('voicemail_query_test_1400 displayName = ' + resultSet.getString(1)); + expect(resultSet.getString(1) == "daming").assertTrue(); + console.info('voicemail_query_test_1400 phone_number = ' + resultSet.getString(2)); + expect(resultSet.getString(2) == "8855220011").assertTrue(); + } while (resultSet.goToNextRow()); + } + resultSet.close(); + } catch (error) { + console.info("voicemail_query_test_1400 query error = " + error); + done(); + } + } + }); + + /** + * @tc.number voicemail_query_test_1300 + * @tc.name Query voicemail's status + * @tc.desc Function test + */ + it("voicemail_query_test_1300", 0, async function (done) { + console.info("------------voicemail_query_test_1300 is starting!-----------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_VOICEMAIL); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + var insertValues = { + "phone_number": "1158220165", "display_name": "xiaoming", "voice_status": 1 + }; + try { + var voiceMailId = await DAHelper.insert(voicemailUri, insertValues); + console.info("logMessage voicemail_query_test_1300: voiceMailId = " + voiceMailId); + expect(voiceMailId > 0).assertTrue(); + await voiceMailQuery(); + await voiceMailDelete("voicemail_query_test_1300"); + done(); + } catch (error) { + console.info("logMessage voicemail_query_test_1300: voicemial insert error = " + error); + done(); + } + async function voiceMailQuery() { + var resultColumns = ["id", "display_name", "phone_number"]; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("voice_status", "1"); + condition.and(); + condition.equalTo("phone_number", "1158220165"); + try { + var resultSet = await DAHelper.query(voicemailUri, resultColumns, condition); + if (resultSet.goToFirstRow()) { + do { + console.info('voicemail_query_test_1300 id = ' + resultSet.getString(0)); + expect(resultSet.getString(0) == voicemailId.toString()).assertTrue(); + console.info('voicemail_query_test_1300 displayName = ' + resultSet.getString(1)); + expect(resultSet.getString(1) == "xiaoming").assertTrue(); + console.info('voicemail_query_test_1300 phone_number = ' + resultSet.getString(2)); + expect(resultSet.getString(2) == "1158220165").assertTrue(); + } while (resultSet.goToNextRow()); + } + resultSet.close(); + } catch (error) { + console.info("voicemail_query_test_1300 query error = " + error); + done(); + } + } + }); + + /** + * @tc.number abnormal_voicemail_insert_test_300 + * @tc.name Abnormal use case, an incorrect field is passed in when inserting data + * @tc.desc Function test + */ + it("abnormal_voicemail_insert_test_300", 0, async function (done) { + console.info("------------abnormal_voicemail_insert_test_300 is starting!-----------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_VOICEMAIL); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + var insertValues = { + "phone_numbers": "18942010321", "display_name": "xiaoming" + }; + try { + var voicemailId = await DAHelper.insert(voicemailUri, insertValues); + console.info("logMessage abnormal_voicemail_insert_test_300: voicemialId = " + voicemailId); + expect(voicemailId == -1).assertTrue(); + done(); + } catch (error) { + console.info("abnormal_voicemail_insert_test_300 insert error = " + error); + done(); + } + }); + + /** + * @tc.number abnormal_voicemail_insert_test_400 + * @tc.name Exception use case, an incorrect table name is passed in when inserting data + * @tc.desc Function test + */ + it("abnormal_voicemail_insert_test_400", 0, async function (done) { + console.info("------------abnormal_voicemail_insert_test_400 is starting!-----------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_VOICEMAIL); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + var errorUri = "dataability:///com.ohos.calllogability/calls/voicemails"; + + var insertValues = { + "phone_number": "18942010321", "display_name": "xiaoming" + }; + try { + var voicemialId = await DAHelper.insert(errorUri, insertValues) + console.info("logMessage abnormal_voicemail_insert_test_400: voicemialId = " + voicemialId); + expect(voicemialId == -1).assertTrue(); + var map = new Map(); + map.set("phone_number", "18942010321"); + await voiceMailQueryError(map, "abnormal_voicemail_insert_test_400"); + done(); + } catch (error) { + console.info("abnormal_voicemail_insert_test_400 insert error = " + error); + done(); + } + }); + + /** + * @tc.number abnormal_voicemail_update_test_1100 + * @tc.name Abnormal use case, passing in a wrong field when updating data + * @tc.desc Function test + */ + it("abnormal_voicemail_update_test_1100", 0, async function (done) { + console.info("------------abnormal_voicemail_update_test_1100 is starting!-----------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_VOICEMAIL); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + var insertValues = { + "phone_number": "18942010321" + }; + try { + var voicemailId = await DAHelper.insert(voicemailUri, insertValues); + console.info("logMessage abnormal_voicemail_update_test_1100: voicemailId = " + voicemailId); + expect(voicemailId > 0).assertTrue(); + await abnormalUpdate(); + await voiceMailDelete("abnormal_voicemail_update_test_1100"); + done(); + } catch (error) { + console.info("abnormal_voicemail_update_test_1100 insert error = " + error); + done(); + } + async function abnormalUpdate() { + var updateValues = { + "phone_numbers": "11111111111111111" + }; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("ids", voicemailId.toString()); + try { + var updataCode = await DAHelper.update(voicemailUri, updateValues, condition); + console.info("logMessage abnormal_voicemail_update_test_1100: updataCode = " + updataCode); + expect(updataCode == -1).assertTrue(); + var map = new Map(); + map.set("phone_number", "11111111111111111"); + await voiceMailQueryError(map, "abnormal_voicemail_insert_test_400"); + } catch (error) { + console.info("logMessage abnormal_voicemail_update_test_1100: update error = " + error); + done(); + } + } + }); + + /** + * @tc.number abnormal_voicemail_update_test_1200 + * @tc.name Abnormal use case, an incorrect table name is passed in when updating data + * @tc.desc Function test + */ + it("abnormal_voicemail_update_test_1200", 0, async function (done) { + console.info("------------abnormal_voicemail_update_test_1200 is starting!-----------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_VOICEMAIL); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + var errorUri = "dataability:///com.ohos.calllogability/calls/voicemails"; + + var insertValues = { + "phone_number": "9952364" + }; + try { + var voicemailId = await DAHelper.insert(voicemailUri, insertValues); + console.info("logMessage abnormal_voicemail_update_test_1200: voicemailId = " + voicemailId); + expect(voicemailId > 0).assertTrue(); + await abnormalUpdate(); + await voiceMailDelete("abnormal_voicemail_update_test_1200"); + done(); + } catch (error) { + console.info("logMessage abnormal_voicemail_update_test_1200: insert error = " + error); + done(); + } + + async function abnormalUpdate() { + var updateValues = { + "phone_number": "22001122" + }; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("id", voicemailId.toString()); + try { + var updataCode = await DAHelper.update(errorUri, updateValues, condition) + console.info("logMessage abnormal_voicemail_update_test_1200: updataCode = " + updataCode); + expect(updataCode == -1).assertTrue(); + var map = new Map(); + map.set("phone_number", "22001122"); + await voiceMailQueryError(map, "abnormal_voicemail_insert_test_400"); + } catch (error) { + console.info("logMessage abnormal_voicemail_update_test_1200: update error = " + error); + done(); + } + } + }); + + /** + * @tc.number abnormal_voicemail_delete_test_700 + * @tc.name Abnormal use case, passing in a wrong field when deleting data + * @tc.desc Function test + */ + it("abnormal_voicemail_delete_test_700", 0, async function (done) { + console.info("------------abnormal_voicemail_delete_test_700 is starting!-----------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_VOICEMAIL); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + var insertValues = { + "phone_number": "789130" + }; + try { + var voicemailId = await DAHelper.insert(voicemailUri, insertValues); + console.info("logMessage abnormal_voicemail_delete_test_700: voicemailId = " + voicemailId); + expect(voicemailId > 0).assertTrue(); + await abnormalDelete(); + await voiceMailDelete("abnormal_voicemail_delete_test_700"); + done(); + } catch (error) { + console.info("logMessage abnormal_voicemail_delete_test_700: insert error = " + error); + done(); + } + + async function abnormalDelete() { + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("ids", voicemailId.toString()); + try { + var deleteCode = await DAHelper.delete(voicemailUri, condition); + console.info("logMessage abnormal_voicemail_delete_test_700: deleteCode = " + deleteCode); + expect(deleteCode == -1).assertTrue(); + } catch (error) { + console.info("logMessage abnormal_voicemail_delete_test_700: delete error = " + error); + done(); + } + } + }); + + /** + * @tc.number abnormal_voicemail_delete_test_800 + * @tc.name Abnormal use case, passing in an incorrect table name when deleting data + * @tc.desc Function test + */ + it("abnormal_voicemail_delete_test_800", 0, async function (done) { + console.info("------------abnormal_voicemail_delete_test_800 is starting!-----------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_VOICEMAIL); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + var errorUri = "dataability:///com.ohos.calllogability/calls/voicemails"; + + var insertValues = { + "phone_number": "1564721" + }; + try { + var voicemailId = await DAHelper.insert(voicemailUri, insertValues); + console.info("logMessage abnormal_voicemail_delete_test_800: voicemailId = " + voicemailId); + expect(voicemailId > 0).assertTrue(); + await abnormalDelete(); + await voiceMailDelete("abnormal_voicemail_delete_test_800"); + done(); + } catch (error) { + console.info("logMessage abnormal_voicemail_delete_test_800: insert error = " + error); + done(); + } + + async function abnormalDelete() { + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("id", voicemailId.toString()); + try { + var deleteCode = await DAHelper.delete(errorUri, condition); + console.info("logMessage abnormal_voicemail_delete_test_800: deleteCode = " + deleteCode); + expect(deleteCode == -1).assertTrue(); + } catch (error) { + console.info("logMessage abnormal_voicemail_delete_test_800: delete error = " + error); + done(); + } + } + }); + + /** + * @tc.number abnormal_voicemail_query_test_1500 + * @tc.name Abnormal use case, an incorrect field is passed in when querying + * @tc.desc Function test + */ + it("abnormal_voicemail_query_test_1500", 0, async function (done) { + console.info("------------abnormal_voicemail_query_test_1500 is starting!-----------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_VOICEMAIL); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + var insertValues = { + "phone_number": "1564721" + }; + try { + var voicemailId = await DAHelper.insert(voicemailUri, insertValues); + console.info("logMessage abnormal_voicemail_query_test_1500: voicemailId = " + voicemailId); + expect(voicemailId > 0).assertTrue(); + await abnormalQuery(); + await voiceMailDelete("abnormal_voicemail_query_test_1500"); + done(); + } catch (error) { + console.info("logMessage abnormal_voicemail_query_test_1500: insert error = " + error); + done(); + } + + async function abnormalQuery() { + var resultColumns = ["id", "phone_number"]; + + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("ids", voicemailId.toString()); + try { + var resultSet = await DAHelper.query(voicemailUri, resultColumns, condition) + console.info('logMessage abnormal_voicemail_query_test_1500: goToFirstRow' + resultSet.goToFirstRow()); + expect(resultSet.goToFirstRow()).assertEqual(false); + resultSet.close(); + } catch (error) { + console.info('logMessage abnormal_voicemail_query_test_1500: query error = ' + error); + done(); + } + } + }); + + /** + * @tc.number abnormal_voicemail_batchinsert_test_1900 + * @tc.name Abnormal use cases, when inserting data in batches, some of them failed, check the processing logic + * @tc.desc Function test + */ + it("abnormal_voicemail_batchinsert_test_1900", 0, async function (done) { + console.info("--------logMessage abnormal_voicemail_batchinsert_test_1900 is starting!------------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_VOICEMAIL); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + var addBulkValue1 = { + "phone_number": "5555555555", "ring_duration": "500" + }; + var addBulkValue2 = { + "phone_number": "1511002", "ring_duration": "100" + }; + var addBulkValue3 = { + "phone_numbers": "1521003", "ring_duration": "100" + }; + var addBulkValue4 = { + "phone_number": "1521004", "ring_durations": "100" + }; + var addBulkValue5 = { + "phone_number": "1521005", "ring_duration": "100" + }; + var listAddBluk = []; + listAddBluk[0] = addBulkValue1; + listAddBluk[1] = addBulkValue2; + listAddBluk[2] = addBulkValue3; + listAddBluk[3] = addBulkValue4; + listAddBluk[4] = addBulkValue5; + try { + var batchInsertCode = await DAHelper.batchInsert(voicemailUri, listAddBluk) + console.info("logMessage abnormal_voicemail_batchinsert_test_1900: batchInsertCode = " + batchInsertCode); + expect(batchInsertCode == -1).assertTrue(); + done(); + } catch (error) { + console.info('logMessage abnormal_voicemail_batchinsert_test_1900: batchInsert error = ' + error); + done(); + } + }); + + /** + * @tc.number voiceMail_delete_test_2000 + * @tc.name batchDelete + * @tc.desc Function test + */ + it("voiceMail_delete_test_2000", 0, async function (done) { + console.info("--------logMessage voiceMail_delete_test_2000 is starting!------------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_VOICEMAIL); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + try { + var voiceMailId = await DAHelper.insert(voicemailUri, common.getVoiceMail()); + console.info("logMessage voiceMail_delete_test_2000: voiceMailId = " + voiceMailId); + expect(voiceMailId > 0).assertTrue(); + var map = common.getVoiceMailMap() + map.set("id", voiceMailId.toString()); + await voiceMailQuery(map, "voiceMail_delete_test_2000"); + await executeBatch(); + } catch (error) { + console.info("logMessage voiceMail_delete_test_2000: voiceMailId insert error = " + error); + done(); + } + async function executeBatch() { + console.info("logMessage voiceMail_delete_test_2000: executeBatch start "); + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("id", voiceMailId.toString()); + DAHelper.executeBatch(URI_VOICEMAIL, [{ + uri: voicemailUri, + type: featureAbility.DataAbilityOperationType.TYPE_DELETE, + predicates: condition, + expectedCount: 0, + PredicatesBackReferences: {}, + interrupted: true, + }], + (error, data) => { + console.info("logMessage voiceMail_delete_test_2000: executeBatch data = " + JSON.stringify(data)); + console.info("logMessage voiceMail_delete_test_2000: data_3 = " + data); + console.info("logMessage voiceMail_delete_test_2000: data_1= " + data[0].count); + expect(data[0].count == 0).assertTrue(); + done(); + }); + } + }); + + /** + * @tc.number voiceMail_update_test_2100 + * @tc.name batchUpdate + * @tc.desc Function test + */ + it("voiceMail_update_test_2100", 0, async function (done) { + console.info("--------logMessage voiceMail_update_test_2100 is starting!------------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_VOICEMAIL); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + try { + var voiceMailId = await DAHelper.insert(voicemailUri, common.getVoiceMail()); + console.info("logMessage voiceMail_update_test_2100: voiceMailId = " + voiceMailId); + expect(voiceMailId > 0).assertTrue(); + var map = common.getVoiceMailMap(); + map.set("id", voiceMailId.toString()); + await voiceMailQuery(map, "voiceMail_update_test_2100"); + await executeBatch(); + } catch (error) { + console.info("logMessage voiceMail_update_test_2100: calllog insert error = " + error); + done(); + } + async function executeBatch() { + var updateValues = { + "phone_number": "123456789" + }; + console.info("logMessage voiceMail_update_test_2100: executeBatch start "); + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("id", voiceMailId.toString()); + DAHelper.executeBatch(URI_VOICEMAIL, [{ + uri: voicemailUri, + type: featureAbility.DataAbilityOperationType.TYPE_UPDATE, + valuesBucket: updateValues, + predicates: condition, + expectedCount: 0, + PredicatesBackReferences: {}, + interrupted: true, + }], + (error, data) => { + console.info("logMessage voiceMail_update_test_2100: executeBatch data = " + JSON.stringify(data)); + console.info("logMessage voiceMail_update_test_2100: data_3 = " + data); + console.info("logMessage voiceMail_update_test_2100: data_1= " + data[0].count); + expect(data[0].count == 0).assertTrue(); + done(); + }); + } + }); + + /** + * @tc.number voicemail_insert_test_2200 + * @tc.name Insert voicemail status 0 + * @tc.desc Function test + */ + it("voicemail_insert_test_2200", 0, async function (done) { + console.info("---------logMessage voicemail_insert_test_2200 is starting!---------") + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_VOICEMAIL); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + console.info('logMessage uri = ' + URI_VOICEMAIL) + + var stringValue = { + "phone_number": "1557544452542200", "voice_status": 0 + }; + try { + var voicemailId = await DAHelper.insert(voicemailUri, stringValue) + console.info("logMessage voicemail_insert_test_2200: voicemailId = " + voicemailId); + expect(voicemailId > 0).assertTrue(); + var map = new Map(); + map.set("id", voicemailId.toString()); + map.set("phone_number", "1557544452542200"); + map.set("voice_status", "0"); + await voiceMailQuery(map, "voicemail_insert_test_2200"); + await voiceMailDelete("voicemail_insert_test_2200"); + done(); + } catch (error) { + console.info("logMessage voicemail_insert_test_2200: voicemail insert error = " + error); + done(); + } + }); + + /** + * @tc.number voicemail_insert_test_2300 + * @tc.name Insert 3 pieces of voice mail data first, then delete 2 pieces of data, + * and verify whether the deletion is successful + * @tc.desc Function test + */ + it("voicemail_insert_test_2300", 0, async function (done) { + console.info("---------logMessage voicemail_insert_test_2300 is starting!---------") + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_VOICEMAIL); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + console.info('logMessage uri = ' + URI_VOICEMAIL) + + var stringValue = { + "phone_number": "155754445254", "voice_status": 0 + }; + try { + var voicemailId = await DAHelper.insert(voicemailUri, stringValue) + var voicemailIdOne = await DAHelper.insert(voicemailUri, stringValue) + var voicemailIdTwo = await DAHelper.insert(voicemailUri, stringValue) + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("id", voicemailId.toString()); + condition.or(); + condition.equalTo("id", voicemailIdOne.toString()); + var deleteCode = await DAHelper.delete(voicemailUri, condition); + console.info("logMessage voicemail_insert_test_2300: deleteCode = " + deleteCode); + var resultColumns = []; + var resultSet = await DAHelper.query(voicemailUri, resultColumns, condition); + expect(resultSet.rowCount == 0).assertTrue(); + resultSet.close(); + await voiceMailDelete("voicemail_insert_test_2300"); + done(); + } catch (error) { + console.info("logMessage voicemail_insert_test_2300: voicemail insert error = " + error); + done(); + } + }); + + /** + * @tc.number voicemail_insert_test_2400 + * @tc.name Insert 3 pieces of voice mail data first, then update 2 pieces of data, + * and verify whether the deletion is successful + * @tc.desc Function test + */ + it("voicemail_insert_test_2400", 0, async function (done) { + console.info("---------logMessage voicemail_insert_test_2400 is starting!---------") + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_VOICEMAIL); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + console.info('logMessage uri = ' + URI_VOICEMAIL) + + var stringValue = { + "phone_number": "155754445254", "voice_status": 0 + }; + try { + var voicemailId = await DAHelper.insert(voicemailUri, stringValue) + var voicemailIdOne = await DAHelper.insert(voicemailUri, stringValue) + var voicemailIdTwo = await DAHelper.insert(voicemailUri, stringValue) + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("id", voicemailId.toString()); + condition.or(); + condition.equalTo("id", voicemailIdOne.toString()); + var updateValue = { + "phone_number": "14541555754445254", "voice_status": 1 + }; + var updateCode = await DAHelper.update(voicemailUri, updateValue, condition); + console.info("logMessage voicemail_insert_test_2400: deleteCode = " + updateCode); + + var map = new Map(); + map.set("id", voicemailId.toString()); + map.set("phone_number", "14541555754445254"); + map.set("voice_status", "1"); + await voiceMailQuery(map, "voicemail_insert_test_2400"); + + var mapOne = new Map(); + mapOne.set("id", voicemailIdOne.toString()); + mapOne.set("phone_number", "14541555754445254"); + mapOne.set("voice_status", "1"); + await voiceMailQuery(mapOne, "voicemail_insert_test_2400"); + await voiceMailDelete("voicemail_insert_test_2400"); + done(); + } catch (error) { + console.info("logMessage voicemail_insert_test_2400: voicemail insert error = " + error); + done(); + } + }); + + /** + * @tc.number voicemail_insert_test_2500 + * @tc.name Query the voice mailbox with status 0 or id and return the query result + * @tc.desc Function test + */ + it("voicemail_query_test_2500", 0, async function (done) { + console.info("---------logMessage voicemail_query_test_2500 is starting!---------") + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_VOICEMAIL); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + console.info('logMessage uri = ' + URI_VOICEMAIL) + var stringValue = { + "phone_number": "4454445254", "voice_status": 0 + }; + try { + var voicemailId = await DAHelper.insert(voicemailUri, stringValue) + var voicemailIdOne = await DAHelper.insert(voicemailUri, stringValue) + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.beginWrap(); + condition.equalTo("id", voicemailId.toString()); + condition.or(); + condition.equalTo("id", voicemailIdOne.toString()); + condition.endWrap(); + condition.and(); + condition.equalTo("voice_status", "0"); + var resultColumns = []; + var resultSet = await DAHelper.query(voicemailUri, resultColumns, condition); + expect(resultSet.rowCount == 2).assertTrue(); + resultSet.close(); + await voiceMailDelete("voicemail_query_test_2500"); + done(); + } catch (error) { + console.info("logMessage voicemail_query_test_2500: voicemail insert error = " + error); + done(); + } + }); + + /** + * @tc.number voicemail_query_test_2600 + * @tc.name Query the voice mailbox and return the query result + * @tc.desc Function test + */ + it("voicemail_query_test_2600", 0, async function (done) { + console.info("---------logMessage voicemail_query_test_2600 is starting!---------") + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_VOICEMAIL); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + console.info('logMessage uri = ' + URI_VOICEMAIL) + var stringValue = { + "phone_number": "445444445254", "voice_status": 0 + }; + try { + var voicemailId = await DAHelper.insert(voicemailUri, stringValue); + console.info('voicemail_query_test_2600 voicemailId = ' + voicemailId); + var voicemailIdOne = await DAHelper.insert(voicemailUri, stringValue); + console.info('voicemail_query_test_2600 voicemailIdOne = ' + voicemailIdOne); + var condition = new ohosDataAbility.DataAbilityPredicates(); + var resultColumns = []; + var resultSet = await DAHelper.query(voicemailUri, resultColumns, condition); + expect(resultSet.rowCount == 2).assertTrue(); + resultSet.close(); + await voiceMailDelete("voicemail_query_test_2600"); + done(); + } catch (error) { + console.info("logMessage voicemail_query_test_2600: voicemail insert error = " + error); + done(); + } + }); + + /** + * @tc.number abnormal_voicemail_insert_test_2700 + * @tc.name When the voicemail status is added, a non-existent field is passed in + * @tc.desc Function test + */ + it("abnormal_voicemail_insert_test_2700", 0, async function (done) { + console.info("---------logMessage abnormal_voicemail_insert_test_2700 is starting!---------") + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_VOICEMAIL); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + console.info('logMessage uri = ' + URI_VOICEMAIL) + try { + var insertValues = { + display_name: "2700name", voice_statuss: "1" + }; + var voicemailId = await DAHelper.insert(voicemailUri, insertValues); + expect(voicemailId == -1).assertTrue(); + var condition = new ohosDataAbility.DataAbilityPredicates(); + var resultColumns = []; + var resultSet = await DAHelper.query(voicemailUri, resultColumns, condition); + expect(resultSet.rowCount == 0).assertTrue(); + await voiceMailDelete("abnormal_voicemail_insert_test_2700"); + done(); + } catch (error) { + done(); + } + }); + + /** + * @tc.number abnormal_voicemail_delete_test_2800 + * @tc.name When deleting the voicemail status, pass in a non-existent field + * @tc.desc Function test + */ + it("abnormal_voicemail_delete_test_2800", 0, async function (done) { + console.info("---------logMessage abnormal_voicemail_delete_test_2800 is starting!---------") + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_VOICEMAIL); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + console.info('logMessage uri = ' + URI_VOICEMAIL) + try { + var insertValues = { + display_name: "2800name", voice_status: "1" + }; + var voicemailId = await DAHelper.insert(voicemailUri, insertValues); + expect(voicemailId > 0).assertTrue(); + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("id", voicemailId.toString()); + var updateValues = { + display_name: "2800name", voice_statuss: "0" + }; + var updateCode = await DAHelper.update(voicemailUri, updateValues, condition); + expect(updateCode == -1).assertTrue(); + var map = new Map(); + map.set("id", voicemailId.toString()); + map.set("display_name", "2800name"); + map.set("voice_status", "1"); + await voiceMailQuery(map, "abnormal_voicemail_delete_test_2800"); + await voiceMailDelete("abnormal_voicemail_delete_test_2800"); + done(); + } catch (error) { + done(); + } + }); + + /** + * @tc.number abnormal_voicemail_update_test_2900 + * @tc.name When update the voicemail status, pass in a non-existent field + * @tc.desc Function test + */ + it("abnormal_voicemail_update_test_2900", 0, async function (done) { + console.info("---------logMessage abnormal_voicemail_update_test_2900 is starting!---------") + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_VOICEMAIL); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + console.info('logMessage uri = ' + URI_VOICEMAIL) + try { + var insertValues = { + display_name: "2900name", voice_status: "1" + }; + var voicemailId = await DAHelper.insert(voicemailUri, insertValues); + expect(voicemailId > 0).assertTrue(); + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("id", voicemailId.toString()); + var updateValues = { + display_name: "2900name", voice_statuss: "0" + }; + var updateCode = await DAHelper.update(voicemailUri, updateValues, condition); + expect(updateCode == -1).assertTrue(); + var map = new Map(); + map.set("id", voicemailId.toString()); + map.set("display_name", "2900name"); + map.set("voice_status", "1"); + await voiceMailQuery(map, "abnormal_voicemail_update_test_2900"); + await voiceMailDelete("abnormal_voicemail_update_test_2900"); + done(); + } catch (error) { + done(); + } + }); + + /** + * @tc.number abnormal_voicemail_update_test_3000 + * @tc.name When update the voicemail status, pass in a non-existent field + * @tc.desc Function test + */ + it("abnormal_voicemail_update_test_3000", 0, async function (done) { + console.info("---------logMessage abnormal_voicemail_update_test_3000 is starting!---------") + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_VOICEMAIL); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + console.info('logMessage uri = ' + URI_VOICEMAIL) + try { + var insertValues = { + display_name: "2900name", voice_status: "1" + }; + var voicemailId = await DAHelper.insert(voicemailUri, insertValues); + expect(voicemailId > 0).assertTrue(); + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("ids", voicemailId.toString()); + var resultColumns = []; + var resultSet = await DAHelper.query(voicemailUri, resultColumns, condition); + expect(resultSet.rowCount == -1).assertTrue(); + resultSet.close(); + await voiceMailDelete("abnormal_voicemail_update_test_3000"); + done(); + } catch (error) { + done(); + } + }); + + /** + * @tc.number abnormal_voicemail_batchInsert_test_3100 + * @tc.name Insert voicemail data in batches , pass in a non-existent field + * @tc.desc Function test + */ + it("abnormal_voicemail_batchInsert_test_3100", 0, async function (done) { + console.info("-------------logMessage abnormal_voicemail_batchInsert_test_3100 is starting!-----------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_VOICEMAIL); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + var insertValuesOne = { + "voice_status": "0", "display_name": "xiaoming" + }; + var insertValuesTwo = { + "voice_status": "1", "display_name": "xiaohei" + }; + var insertValuesThree = { + "voice_statusss": "1", "display_name": "xiaohong" + }; + var insertValuesFour = { + "voice_status": "0", "display_name": "xiaohei" + }; + var insertValuesFive = { + "voice_status": "0", "display_name": "xiaofen" + }; + var listAddBluk = []; + listAddBluk[0] = insertValuesOne; + listAddBluk[1] = insertValuesTwo; + listAddBluk[2] = insertValuesThree; + listAddBluk[3] = insertValuesFour; + listAddBluk[4] = insertValuesFive; + try { + var batchInsertCode = await DAHelper.batchInsert(voicemailUri, listAddBluk); + console.info("logMessage abnormal_voicemail_batchInsert_test_3100: batchInsertCode = " + batchInsertCode); + expect(batchInsertCode == -1).assertTrue(); + var condition = new ohosDataAbility.DataAbilityPredicates(); + var resultColumns = []; + var resultSet = await DAHelper.query(voicemailUri, resultColumns, condition); + expect(resultSet.rowCount == 0).assertTrue(); + resultSet.close(); + done(); + } catch (error) { + console.info("logMessage abnormal_voicemail_batchInsert_test_3100: batchInsert error = " + error); + done(); + } + }); + + afterAll(async function () { + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_VOICEMAIL); + console.info('voicemai afterAll logMessage get DAHelper success! DAHelper = ' + DAHelper); + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.greaterThan("id", "0"); + var deleteCode = await DAHelper.delete(voicemailUri, condition); + console.info('voicemai afterAll logMessage deleteCode = ' + deleteCode); + }); + }) +} \ No newline at end of file diff --git a/telephony/telephonyjstest/contact_function/entry/src/main/ets/MainAbility/test/contact/common.js b/telephony/telephonyjstest/contact_function/entry/src/main/ets/MainAbility/test/contact/common.js new file mode 100644 index 000000000..5e82feeb8 --- /dev/null +++ b/telephony/telephonyjstest/contact_function/entry/src/main/ets/MainAbility/test/contact/common.js @@ -0,0 +1,726 @@ +/* + * 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 featureAbility from '@ohos.ability.featureAbility'; +import ohosDataAbility from '@ohos.data.dataability'; +import {afterAll, afterEach, beforeAll, beforeEach, describe, expect, it} from 'deccjsunit/index' + +const URI_CONTACTS = "dataability:///com.ohos.contactsdataability"; +const contactUri = "dataability:///com.ohos.contactsdataability/contacts/contact"; +const rawContactUri = "dataability:///com.ohos.contactsdataability/contacts/raw_contact"; +const contactDataUri = "dataability:///com.ohos.contactsdataability/contacts/contact_data"; +const groupUri = "dataability:///com.ohos.contactsdataability/contacts/groups"; +const contactBlocklistUri = "dataability:///com.ohos.contactsdataability/contacts/contact_blocklist"; +const deletedRawContactUri = "dataability:///com.ohos.contactsdataability/contacts/deleted_raw_contact"; +const profileRawContactUri = "dataability:///com.ohos.contactsdataability/profile/raw_contact"; +const profilecontactUri = "dataability:///com.ohos.contactsdataability/profile/contact"; +const profileContactDataUri = "dataability:///com.ohos.contactsdataability/profile/contact_data"; +const profileGroupUri = "dataability:///com.ohos.contactsdataability/profile/groups"; +const profileBlocklistUri = "dataability:///com.ohos.contactsdataability/profile/contact_blocklist"; +const profileDeletedContactsUri = "dataability:///com.ohos.contactsdataability/profile/deleted_raw_contact"; + +const URI_CALLLOG = "dataability:///com.ohos.calllogability"; +const calllogUri = "dataability:///com.ohos.calllogability/calls/calllog"; + +export default { + data: {}, + getCallLogInsertMap: + function () { + var calllogInsert100Map = new Map([ + ["phone_number", "123456789"], ["display_name", "xxw"], ["voicemail_uri", "uri"], + ["sim_type", "1"], ["is_hd", "2"], ["is_read", "1"], ["ring_duration", "900"], + ["talk_duration", "200"], ["format_number", "123 456 789"], ["quicksearch_key", "2"], + ["number_type", "2"], ["number_type_name", "tian"], ["begin_time", "200"], ["end_time", "300"], + ["answer_state", "1"], ["create_time", "400"], ["number_location", "dizhi"], ["photo_id", "1"], + ["photo_uri", "666"], ["country_iso_code", "2"], ["extra1", "test1"], ["extra2", "test2"], + ["extra3", "test3"], ["extra4", "test4"], ["extra5", "test5"], ["extra6", "test6"] + ]); + return calllogInsert100Map; + }, + getCallLogInsert: + function () { + var calllogInsert100 = { + "phone_number": "123456789", + "display_name": "xxw", + "voicemail_uri": "uri", + "sim_type": 1, + "is_hd": 2, + "is_read": 1, + "ring_duration": 900, + "talk_duration": 200, + "format_number": "123 456 789", + "quicksearch_key": "2", + "number_type": 2, + "number_type_name": "tian", + "begin_time": 200, + "end_time": 300, + "answer_state": 1, + "create_time": 400, + "number_location": "dizhi", + "photo_id": 1, + "photo_uri": "666", + "country_iso_code": 2, + "extra1": "test1", + "extra2": "test2", + "extra3": "test3", + "extra4": "test4", + "extra5": "test5", + "extra6": "test6", + }; + return calllogInsert100; + }, + getCallLogResultColumns: + function () { + var resultColumns = [ + "id", "phone_number", "display_name", "call_direction", "voicemail_uri", "sim_type", "is_hd", "is_read", + "ring_duration", "talk_duration", "format_number", "quicksearch_key", "number_type", "number_type_name", + "begin_time", "end_time", "answer_state", "create_time", "number_location", "photo_id", "photo_uri", + "country_iso_code", "extra1", "extra2", "extra3", "extra4", "extra5", "extra6" + ]; + return resultColumns; + }, + getCallLogUpdate: + function () { + var updateValues = { + "phone_number": "987654321", + "display_name": "6666", + "voicemail_uri": "7777", + "sim_type": 4, + "is_hd": 4, + "is_read": 4, + "ring_duration": 400, + "talk_duration": 400, + "format_number": "987 654 321", + "quicksearch_key": "4", + "number_type": 4, + "number_type_name": "4tian", + "begin_time": 400, + "end_time": 400, + "answer_state": 4, + "create_time": 40000, + "number_location": "4dizhi", + "photo_id": 4, + "photo_uri": "4444", + "country_iso_code": 4, + "extra1": "test7", + "extra2": "test7", + "extra3": "test7", + "extra4": "test7", + "extra5": "test7", + "extra6": "test7", + }; + return updateValues; + }, + getCallLogUpdateMap: + function () { + var calllogInsert100Map = new Map([ + ["phone_number", "987654321"], ["display_name", "6666"], ["voicemail_uri", "7777"], + ["sim_type", "4"], ["is_hd", "4"], ["is_read", "4"], ["ring_duration", "400"], + ["talk_duration", "400"], ["format_number", "987 654 321"], ["quicksearch_key", "4"], + ["number_type", "4"], ["number_type_name", "4tian"], ["begin_time", "400"], ["end_time", "400"], + ["answer_state", "4"], ["create_time", "40000"], ["number_location", "4dizhi"], + ["photo_id", "4"], ["photo_uri", "4444"], ["country_iso_code", "4"], ["extra1", "test7"], + ["extra2", "test7"], ["extra3", "test7"], ["extra4", "test7"], ["extra5", "test7"], + ["extra6", "test7"] + ]); + return calllogInsert100Map; + }, + getCallLogBatchInsert: + function () { + var map = new Map([["phone_number", "1600"], ["ring_duration", "333"]]); + var map2 = new Map([["phone_number", "1600"], ["ring_duration", "600"]]); + var map3 = new Map([["phone_number", "1600"], ["ring_duration", "600"]]); + var map4 = new Map([["phone_number", "1600"], ["ring_duration", "600"]]); + var map5 = new Map([["phone_number", "1600"], ["ring_duration", "600"]]); + var array = [map, map2, map3, map4, map5]; + return array; + }, + getProfileRawContact: + function () { + var rawContact = { + "photo_id": 2, + "photo_file_id": 3, + "is_transfer_voicemail": 1, + "personal_ringtone": "test", + "is_deleted": 0, + "personal_notification_ringtone": "666", + "photo_first_name": "7777", + "account_id": 1, + "version": 1, + "sort": "6666", + "contacted_count": 2, + "lastest_contacted_time": 2, + "favorite": 1, + "favorite_order": "test", + "phonetic_name": "testname", + "phonetic_name_type": 1, + "display_name": "licheng", + "company": "TTTTT", + "position": "Developer", + "read_only": 2, + "sort_first_letter": "testsort", + "sync_id": 8, + "syn_1": "syn_1", + "syn_2": "syn_2", + "syn_3": "syn_3", + }; + return rawContact; + }, + getProfileRawContactMap: + function () { + var rawContactMap = new Map([ + ["photo_id", "2"], ["photo_file_id", "3"], ["is_transfer_voicemail", "1"], + ["personal_ringtone", "test"], ["is_deleted", "0"], + [ + "personal_notification_ringtone", + "666", + ], + [ + "photo_first_name", + "7777", + ], + ["account_id", "1"], ["version", "1"], ["sort", "6666"], ["contacted_count", "2"], + ["lastest_contacted_time", "2"], ["favorite", "1"], ["favorite_order", "test"], + ["phonetic_name", "testname"], ["phonetic_name_type", "1"], ["display_name", "licheng"], + ["company", "TTTTT"], ["position", "Developer"], ["read_only", "2"], + ["sort_first_letter", "testsort"], ["merge_mode", "0"], ["is_need_merge", "1"], + ["merge_status", "1"], ["is_merge_target", "0"], ["vibration_setting", "0"], ["sync_id", "8"], + ["syn_1", "syn_1"], ["syn_2", "syn_2"], ["syn_3", "syn_3"] + ]); + return rawContactMap; + }, + getProfileRawContactUpdate: + function () { + var rawContact = { + "photo_id": 21, + "photo_file_id": 31, + "is_transfer_voicemail": 11, + "personal_ringtone": "test1", + "is_deleted": 0, + "personal_notification_ringtone": "6661", + "photo_first_name": "77771", + "account_id": 1, + "sort": "66661", + "contacted_count": 21, + "lastest_contacted_time": 21, + "favorite": 11, + "favorite_order": "test1", + "phonetic_name": "testname1", + "phonetic_name_type": 11, + "display_name": "licheng1", + "company": "TTTTT1", + "position": "Developer1", + "read_only": 21, + "sort_first_letter": "testsort1", + "sync_id": 81, + "syn_1": "syn_11", + "syn_2": "syn_21", + "syn_3": "syn_31", + }; + return rawContact; + }, + getProfileRawContactUpdateMap: + function () { + var rawContactMap = new Map([ + ["photo_id", "21"], ["photo_file_id", "31"], ["is_transfer_voicemail", "11"], + ["personal_ringtone", "test1"], ["is_deleted", "0"], + [ + "personal_notification_ringtone", + "6661", + ], + [ + "photo_first_name", + "77771", + ], + ["account_id", "1"], ["version", "1"], ["sort", "66661"], ["contacted_count", "21"], + ["lastest_contacted_time", "21"], ["favorite", "11"], ["favorite_order", "test1"], + ["phonetic_name", "testname1"], ["phonetic_name_type", "11"], ["display_name", "licheng1"], + ["company", "TTTTT1"], ["position", "Developer1"], ["read_only", "21"], + ["sort_first_letter", "testsort1"], ["merge_mode", "0"], ["is_need_merge", "1"], + ["merge_status", "1"], ["is_merge_target", "0"], ["vibration_setting", "0"], ["sync_id", "81"], + ["syn_1", "syn_11"], ["syn_2", "syn_21"], ["syn_3", "syn_31"] + ]); + return rawContactMap; + }, + getProfileContactData: + function () { + var contactData = { + "content_type": "name", + "detail_info": "xiaocai", + "family_name": "family_name", + "middle_name_phonetic": "middle_name_phonetic", + "given_name": "given_name", + "given_name_phonetic": "given_name_phonetic", + "alias_detail_info": "alias_detail_info", + "phonetic_name": "phonetic_name", + "position": "Developer", + "extend1": "extend1", + "extend2": "extend2", + "extend3": "extend3", + "extend4": "extend4", + "city": "city", + "country": "country", + "neighborhood": "neighborhood", + "pobox": "pobox", + "postcode": "postcode", + "region": "region", + "street": "street", + "alpha_name": "alpha_name", + "other_lan_last_name": "other_lan_last_name", + "other_lan_first_name": "other_lan_first_name", + "extend5": "extend5", + "lan_style": "lan_style", + "custom_data": "custom_data", + "extend6": "extend6", + "extend7": "extend7", + "blob_data": "blob_data", + "syn_1": "syn_1", + "syn_2": "syn_2", + "syn_3": "syn_3", + }; + return contactData; + }, + getProfileContactDataMap: + function () { + var ContactDataMap = new Map([ + ["detail_info", "xiaocai"], ["family_name", "family_name"], + ["middle_name_phonetic", "middle_name_phonetic"], ["given_name", "given_name"], + ["given_name_phonetic", "given_name_phonetic"], ["alias_detail_info", "alias_detail_info"], + ["phonetic_name", "phonetic_name"], ["position", "position"], ["extend1", "extend1"], + ["extend2", "extend2"], ["pobox", "pobox"], ["postcode", "postcode"], ["city", "city"], + ["country", "country"], ["neighborhood", "neighborhood"], + [ + "position", + "Developer", + ], + ["region", "region"], ["street", "street"], ["alpha_name", "alpha_name"], + ["other_lan_last_name", "other_lan_last_name"], ["other_lan_first_name", "other_lan_first_name"], + ["extend5", "extend5"], ["lan_style", "lan_style"], ["custom_data", "custom_data"], + ["extend6", "extend6"], ["extend7", "extend7"], ["blob_data", "blob_data"], ["syn_1", "syn_1"], + [ + "syn_2", + "syn_2", + ], + [ + "syn_3", + "syn_3", + ], + ["read_only", "0"], ["version", "0"], ["is_preferred_number", "0"] + ]); + return ContactDataMap; + }, + getProfileContactDataUpdate: + function () { + var contactData = { + "detail_info": "xiaocai1", + "family_name": "family_name1", + "middle_name_phonetic": "middle_name_phonetic1", + "given_name": "given_name1", + "given_name_phonetic": "given_name_phonetic1", + "alias_detail_info": "alias_detail_info1", + "phonetic_name": "phonetic_name1", + "position": "Developer1", + "extend1": "extend11", + "extend2": "extend21", + "extend3": "extend31", + "extend4": "extend41", + "city": "city1", + "country": "country1", + "neighborhood": "neighborhood1", + "pobox": "pobox1", + "postcode": "postcode1", + "region": "region1", + "street": "street1", + "alpha_name": "alpha_name1", + "other_lan_last_name": "other_lan_last_name1", + "other_lan_first_name": "other_lan_first_name1", + "extend5": "extend51", + "lan_style": "lan_style1", + "custom_data": "custom_data1", + "extend6": "extend61", + "extend7": "extend71", + "blob_data": "blob_data1", + "syn_1": "syn_11", + "syn_2": "syn_21", + "syn_3": "syn_31", + }; + return contactData; + }, + getProfileContactDataUpdateMap: + function () { + var ContactDataMap = new Map([ + ["detail_info", "xiaocai1"], ["family_name", "family_name1"], + ["middle_name_phonetic", "middle_name_phonetic1"], ["given_name", "given_name1"], + ["given_name_phonetic", "given_name_phonetic1"], ["alias_detail_info", "alias_detail_info1"], + ["phonetic_name", "phonetic_name1"], ["position", "position1"], ["extend1", "extend11"], + ["extend2", "extend21"], ["pobox", "pobox1"], ["postcode", "postcode1"], ["city", "city1"], + ["country", "country1"], ["neighborhood", "neighborhood1"], + [ + "position", + "Developer1", + ], + ["region", "region1"], ["street", "street1"], ["alpha_name", "alpha_name1"], + ["other_lan_last_name", "other_lan_last_name1"], ["other_lan_first_name", "other_lan_first_name1"], + ["extend5", "extend51"], ["lan_style", "lan_style1"], ["custom_data", "custom_data1"], + ["extend6", "extend61"], ["extend7", "extend71"], ["blob_data", "blob_data1"], + ["syn_1", "syn_11"], + [ + "syn_2", + "syn_21", + ], + [ + "syn_3", + "syn_31", + ], + ["read_only", "0"], ["version", "1"], ["is_preferred_number", "0"] + ]); + return ContactDataMap; + }, + getProfileGroup: + function () { + var group = { + "account_id": 1, + "group_name": "DeveloperFirsthGroup", + "group_notes": "note", + "group_ringtone": "test" + }; + return group; + }, + getProfileGroupMap: + function () { + var groupMap = new Map([ + ["account_id", "1"], ["group_name", "DeveloperFirsthGroup"], ["group_notes", "note"], + ["is_deleted", "0"], ["group_ringtone", "test"], ["ringtone_modify_time", "0"], + ["lastest_modify_time", "0"] + ]); + return groupMap; + }, + getProfileBlockList: + function () { + var blockList = { + "phone_number": "123456789", "content": "heimingdan" + }; + return blockList; + }, + getProfileBlockListMap: + function () { + var blockListMap = new Map([ + ["types", "0"], ["phone_number", "123456789"], ["content", "heimingdan"], ["time_stamp", "0"] + ]); + return blockListMap; + }, + getProfileUpdateRawContact: + function () { + var rawContact = { + "photo_id": 8, + "photo_file_id": 8, + "is_transfer_voicemail": 8, + "personal_ringtone": "test8", + "is_deleted": 1, + "personal_notification_ringtone": "888", + "photo_first_name": "9999", + "account_id": 8, + "version": 2, + "sort": "8888", + "contacted_count": 8, + "lastest_contacted_time": 8, + "favorite": 0, + "favorite_order": "test8", + "phonetic_name": "testname8", + "phonetic_name_type": 8, + "display_name": "licheng8", + "company": "TTTTT8", + "position": "Developer8", + "read_only": 8, + "sort_first_letter": "testsort8", + "sync_id": 888, + "syn_1": "syn_8", + "syn_2": "syn_8", + "syn_3": "syn_8", + }; + return rawContact; + }, + getProfileUpdateRawContactMap: + function () { + var rawContactMap = new Map([ + ["photo_id", "8"], ["photo_file_id", "8"], ["is_transfer_voicemail", "8"], + ["personal_ringtone", "test8"], ["is_deleted", "1"], + [ + "personal_notification_ringtone", + "888", + ], + [ + "photo_first_name", + "9999", + ], + ["account_id", "8"], ["version", "2"], ["sort", "8888"], ["contacted_count", "8"], + ["lastest_contacted_time", "8"], ["favorite", "0"], ["favorite_order", "test8"], + ["phonetic_name", "testname8"], ["phonetic_name_type", "8"], ["display_name", "licheng8"], + ["company", "TTTTT8"], ["position", "Developer8"], ["read_only", "8"], + ["sort_first_letter", "testsort8"], ["merge_mode", "0"], ["is_need_merge", "1"], + ["merge_status", "1"], ["is_merge_target", "0"], ["vibration_setting", "0"], ["sync_id", "888"], + ["syn_1", "syn_8"], ["syn_2", "syn_8"], ["syn_3", "syn_8"] + ]); + return rawContactMap; + }, + getProfileUpdateContactData: + function () { + var contactData = { + "detail_info": "BossCai", + "family_name": "family_name8", + "middle_name_phonetic": "middle_name_phonetic8", + "given_name": "given_name8", + "given_name_phonetic": "given_name_phonetic8", + "alias_detail_info": "alias_detail_info8", + "phonetic_name": "phonetic_name8", + "position": "position8", + "extend1": "extend8", + "extend2": "extend8", + "extend3": "extend8", + "extend4": "extend8", + "country": "country8", + "neighborhood": "neighborhood8", + "pobox": "pobox8", + "city": "city8", + "postcode": "postcode8", + "region": "region8", + "street": "street8", + "alpha_name": "alpha_name8", + "other_lan_last_name": "other_lan_last_name8", + "other_lan_first_name": "other_lan_first_name8", + "extend5": "extend8", + "lan_style": "lan_style8", + "custom_data": "custom_data8", + "extend6": "extend8", + "extend7": "extend8", + "blob_data": "blob_data8", + "syn_1": "syn_8", + "syn_2": "syn_8", + "syn_3": "syn_8" + }; + return contactData; + }, + getProfileUpdateContactDataMap: + function () { + var ContactDataMap = new Map([ + ["detail_info", "BossCai"], ["family_name", "family_name8"], + ["middle_name_phonetic", "middle_name_phonetic8"], ["given_name", "given_name8"], + ["given_name_phonetic", "given_name_phonetic8"], ["alias_detail_info", "alias_detail_info8"], + ["phonetic_name", "phonetic_name8"], ["position", "position8"], ["extend1", "extend8"], + ["extend2", "extend8"], ["pobox", "pobox8"], ["postcode", "postcode8"], ["city", "city8"], + ["country", "country8"], ["neighborhood", "neighborhood8"], + [ + "position", + "position8", + ], + ["region", "region8"], ["street", "street8"], ["alpha_name", "alpha_name8"], + ["other_lan_last_name", "other_lan_last_name8"], ["other_lan_first_name", "other_lan_first_name8"], + ["extend5", "extend8"], ["lan_style", "lan_style8"], ["custom_data", "custom_data8"], + ["extend6", "extend8"], ["extend7", "extend8"], ["blob_data", "blob_data8"], ["syn_1", "syn_8"], + [ + "syn_2", + "syn_8", + ], + [ + "syn_3", + "syn_8", + ], + ["read_only", "0"], ["version", "1"], ["is_preferred_number", "0"] + ]); + return ContactDataMap; + }, + getProfileUpdateGroup: + function () { + var group = { + "account_id": 8, + "group_name": "TestFifthGroup", + "group_notes": "note8", + "group_ringtone": "test8" + }; + return group; + }, + getProfileUpdateGroupMap: + function () { + var groupMap = new Map([ + ["account_id", "8"], ["group_name", "TestFifthGroup"], ["group_notes", "note8"], + ["is_deleted", "0"], ["group_ringtone", "test8"], ["ringtone_modify_time", "0"], + ["lastest_modify_time", "0"] + ]); + return groupMap; + }, + getProfileUpdateBlockList: + function () { + var blockList = { + "phone_number": "987654321", + "content": "danminghei", + }; + return blockList; + }, + getProfileUpdateBlockListMap: + function () { + var blockListMap = new Map([ + ["types", "0"], ["phone_number", "987654321"], ["content", "danminghei"], ["time_stamp", "0"] + ]); + return blockListMap; + }, + getVoiceMail: + function () { + var voicemail = { + "phone_number": "66666", + "quicksearch_key": "777", + "display_name": "xiaoli", + "voicemail_uri": "XXXX", + "origin_type": "xxxxx", + "create_time": 0 + }; + return voicemail; + }, + getVoiceMailMap: + function () { + var map = new Map([ + ["phone_number", "66666"], ["quicksearch_key", "777"], ["display_name", "xiaoli"], + ["voicemail_uri", "XXXX"], ["origin_type", "xxxxx"], ["create_time", "0"], + ["voicemail_type", "0"], ["voice_file_size", "0"], ["voice_duration", "0"], + ["voice_status", "0"] + ]); + return map; + }, + getVoiceMailUpdate: + function () { + var voicemail = { + "phone_number": "9999999", + "quicksearch_key": "999", + "display_name": "xiaocai", + "voicemail_uri": "uuuu", + "origin_type": "iiiii", + "create_time": "999" + }; + return voicemail; + }, + getVoiceMailUpdateMap: + function () { + var map = new Map([ + ["phone_number", "9999999"], ["quicksearch_key", "999"], ["display_name", "xiaocai"], + ["voicemail_uri", "uuuu"], ["origin_type", "iiiii"], ["create_time", "999"], + ["voicemail_type", "0"], ["voice_file_size", "0"], ["voice_duration", "0"], + ["voice_status", "0"] + ]); + return map; + }, + getvoiceMailBatchInsert: + function () { + var map = new Map([["phone_number", "1600"], ["display_name", "xiaoming"], ["voice_status", "0"]]); + var map2 = new Map([["phone_number", "1600"], ["display_name", "xiaohei"], ["voice_status", "1"]]); + var map3 = new Map([["phone_number", "1600"], ["display_name", "xiaohong"], ["voice_status", "0"]]); + var map4 = new Map([["phone_number", "1600"], ["display_name", "xiaohei"], ["voice_status", "0"]]); + var map5 = new Map([["phone_number", "1600"], ["display_name", "xiaofen"], ["voice_status", "0"]]); + var array = [map, map2, map3, map4, map5]; + return array; + }, + getContactBatchCompany: + function () { + var rawContactValuesOne = { + "display_name": "fengyuanyuan", "company": "TT4900", "position": "Testers" + }; + var rawContactValuesTwo = { + "display_name": "caiboss", "company": "TT4900", "position": "developer" + }; + var rawContactValuesThree = { + "display_name": "zhangsan", "company": "TT4900", "position": "developer" + }; + var rawContactValuesFour = { + "display_name": "lisi", "company": "TT4900", "position": "developer" + }; + var rawContactValuesFive = { + "display_name": "wangwu", "company": "TT4900", "position": "developer" + }; + var listAddBluk = []; + listAddBluk[0] = rawContactValuesOne; + listAddBluk[1] = rawContactValuesTwo; + listAddBluk[2] = rawContactValuesThree; + listAddBluk[3] = rawContactValuesFour; + listAddBluk[4] = rawContactValuesFive; + return listAddBluk; + }, + getContactBatchCompanyTwo: + function () { + var contactDataValuesOne = { + "raw_contact_id": rawContactId, + "content_type": "name", + "detail_info": "xiaozhi" + }; + var contactDataValuesTwo = { + "raw_contact_id": rawContactId, + "content_type": "organization", + "detail_info": "TT", + "position": "Testers" + }; + var contactDataValuesThree = { + "raw_contact_id": rawContactId, + "content_type": "email", + "detail_info": "15844@163.com" + }; + var contactDataValuesFour = { + "raw_contact_id": rawContactId, + "content_type": "nickname", + "detail_info": "xiaozhicheng" + }; + var contactDataValuesFive = { + "raw_contact_id": rawContactId, + "content_type": "phone", + "detail_info": "111885566" + }; + var listAddBluk = []; + listAddBluk[0] = contactDataValuesOne; + listAddBluk[1] = contactDataValuesTwo; + listAddBluk[2] = contactDataValuesThree; + listAddBluk[3] = contactDataValuesFour; + listAddBluk[4] = contactDataValuesFive; + return listAddBluk; + }, + getPhoneNumberBatch: + function () { + var contactBlacklistValuesOne = { + "phone_number": "85525040585400" + }; + var contactBlacklistValuesTwo = { + "phone_number": "85525040585400" + }; + var contactBlacklistValuesThree = { + "phone_number": "85525040585400" + }; + var contactBlacklistValuesFour = { + "phone_number": "85525040585400" + }; + var contactBlacklistValuesFive = { + "phone_number": "85525040585400" + }; + var listAddBluk = [] + listAddBluk[0] = contactBlacklistValuesOne; + listAddBluk[1] = contactBlacklistValuesTwo; + listAddBluk[2] = contactBlacklistValuesThree; + listAddBluk[3] = contactBlacklistValuesFour; + listAddBluk[4] = contactBlacklistValuesFive; + return listAddBluk; + }, + getSearchMap: + function () { + var map = new Map([ + ["account_id", "1"], ["search_name", "小黄||xiaohuang||xh"], ["display_name", "小黄"], + ["phonetic_name", ""], ["photo_id", ""], ["photo_file_id", ""] + ]); + return map; + } +} \ No newline at end of file diff --git a/telephony/telephonyjstest/contact_function/entry/src/main/ets/MainAbility/test/contact/recovery_test.js b/telephony/telephonyjstest/contact_function/entry/src/main/ets/MainAbility/test/contact/recovery_test.js new file mode 100644 index 000000000..d5f41ed7a --- /dev/null +++ b/telephony/telephonyjstest/contact_function/entry/src/main/ets/MainAbility/test/contact/recovery_test.js @@ -0,0 +1,156 @@ +/* + * 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 featureAbility from '@ohos.ability.featureAbility'; +import ohosDataAbility from '@ohos.data.dataability'; +import {afterAll, afterEach, beforeAll, beforeEach, describe, expect, it} from 'deccjsunit/index' +import common from './common.js'; + +const URI_CONTACTS = "dataability:///com.ohos.contactsdataability"; +const rawContactUri = "dataability:///com.ohos.contactsdataability/contacts/raw_contact"; +const backup = "dataability:///com.ohos.contactsdataability/contacts/backup"; +const recover = "dataability:///com.ohos.contactsdataability/contacts/recover"; +const deletedUri = "dataability:///com.ohos.contactsdataability/contacts/deleted_raw_contact"; + +export default function RecoveryTest() { + describe('RecoveryTest', function () { + function sleep(numberMillis) { + var now = new Date(); + var exitTime = now.getTime() + numberMillis; + while (true) { + now = new Date(); + if (now.getTime() > exitTime) + return; + } + } + + async function contactsQuery(tag, uri, size) { + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info(tag + ': contactsQuery start ! DAHelper = ' + DAHelper); + var resultColumns = []; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.greaterThan("id", "0"); + try { + var resultSet = await DAHelper.query(uri, resultColumns, condition); + console.info(tag + ' contactsQuery resultSet.rowCount is = ' + resultSet.rowCount); + console.info(tag + ' contactsQuery size is = ' + size); + expect(resultSet.rowCount == size).assertEqual(true); + if (resultSet.rowCount > 0) { + if (resultSet.goToFirstRow()) { + do { + var id = resultSet.getString(resultSet.getColumnIndex("id")); + console.info(tag + ':logMessage contactsQuery id = ' + id); + var name = resultSet.getString(resultSet.getColumnIndex("display_name")); + console.info(tag + ':logMessage contactsQuery name = ' + name); + } while (resultSet.goToNextRow()) + } + } + resultSet.close(); + } catch (error) { + console.info(tag + "logMessage contactsQuery: error = " + error); + } + } + + async function rawContactInsert(name) { + console.info("------logMessage rawContactInsert is starting!-----"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + var insertValue = { + "display_name": name, + } + try { + var rawContactId = await DAHelper.insert(rawContactUri, insertValue); + console.info('logMessage rawContactInsert: rawContactId = ' + rawContactId); + expect(rawContactId > 0).assertTrue(); + } catch (error) { + console.info('logMessage rawContactInsert: insert error = ' + error); + } + return rawContactId; + } + + async function deleteRawContact(tag) { + try { + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.greaterThan("id", "0"); + condition.and(); + condition.equalTo("is_deleted", "0"); + await DAHelper.delete(rawContactUri, condition); + sleep(5000); + var conditionAll = new ohosDataAbility.DataAbilityPredicates(); + conditionAll.greaterThan("id", "0"); + await DAHelper.delete(deletedUri, conditionAll); + } catch (error) { + console.info(tag + ': deleteRawContact error = ' + error); + } + } + + /** + * @tc.number recovery_test_100 + * @tc.name backup database + * @tc.desc Function test + */ + it("recovery_test_100", 0, async function (done) { + await deleteRawContact("recovery_test_100"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + var updateValues = {}; + var condition = new ohosDataAbility.DataAbilityPredicates(); + try { + var updateCode = await DAHelper.update(backup, updateValues, condition); + sleep(2000); + console.info('logMessage recovery_test_100: updateCode = ' + updateCode); + expect(updateCode == 0).assertTrue(); + sleep(2000); + await contactsQuery("recovery_test_100", rawContactUri, 0); + done(); + } catch (error) { + console.info('logMessage recovery_test_100: raw_contact update error = ' + error); + done(); + } + }); + + /** + * @tc.number recovery_test_200 + * @tc.n ame recovery database + * @tc.desc Function test + */ + it("recovery_test_200", 0, async function (done) { + await deleteRawContact("recovery_test_200"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + var updateValues = {}; + var condition = new ohosDataAbility.DataAbilityPredicates(); + rawContactInsert("liming"); + rawContactInsert("xiaolilili"); + sleep(2000); + var updateCode = await DAHelper.update(backup, updateValues, condition); + sleep(2000); + console.info(' recovery_test_200: backup = ' + updateCode); + expect(updateCode == 0).assertTrue(); + sleep(1000); + try { + var updateCode = await DAHelper.update(recover, updateValues, condition); + sleep(3000); + console.info('logMessage recovery_test_200: recover = ' + updateCode); + expect(updateCode == 0).assertTrue(); + await contactsQuery("recovery_test_200", rawContactUri, 2); + await deleteRawContact("recovery_test_200"); + done(); + } catch (error) { + console.info('logMessage recovery_test_200: raw_contact update error = ' + error); + done(); + } + }); + }); +} \ No newline at end of file diff --git a/telephony/telephonyjstest/contact_function/entry/src/main/ets/MainAbility/test/lib/Const.js b/telephony/telephonyjstest/contact_function/entry/src/main/ets/MainAbility/test/lib/Const.js new file mode 100644 index 000000000..f9263cd46 --- /dev/null +++ b/telephony/telephonyjstest/contact_function/entry/src/main/ets/MainAbility/test/lib/Const.js @@ -0,0 +1,36 @@ +/** + * 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. + */ + +// sim slot id +export const DEFAULT_SLOTID = 0; +export const SLOTID3 = 3; +export const SLOTID2 = 2; +export const SLOTID_MINUS1 = -1; + +// sim correct password +export const CORRECT_PIN = '1234'; +export const CORRECT_PIN2 = '18099014'; + +// sim incorrect password +export const INCORRECT_PIN = '134679'; +export const INCORRECT_PIN_LEN3 = '123'; +export const INCORRECT_PUK = '134679'; +export const INCORRECT_PIN2 = '134679'; +export const INCORRECT_PIN2_LEN3 = '123'; +export const INCORRECT_PIN2_LEN9 = '123456789'; +export const INCORRECT_PUK2 = '134679'; + +// lock status response +export const LOCK_RESULT = { SUCCESS: 0, FAILURE: -1, EXCEPTION: -2 }; \ No newline at end of file diff --git a/telephony/telephonyjstest/contact_function/entry/src/main/resources/base/element/string.json b/telephony/telephonyjstest/contact_function/entry/src/main/resources/base/element/string.json new file mode 100644 index 000000000..03b8532c5 --- /dev/null +++ b/telephony/telephonyjstest/contact_function/entry/src/main/resources/base/element/string.json @@ -0,0 +1,12 @@ +{ + "string": [ + { + "name": "entry_MainAbility", + "value": "entry_MainAbility" + }, + { + "name": "description_mainability", + "value": "ETS_Empty Ability" + } + ] +} \ No newline at end of file diff --git a/telephony/telephonyjstest/contact_function/entry/src/main/resources/base/media/icon.png b/telephony/telephonyjstest/contact_function/entry/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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cmV?d00001 diff --git a/telephony/telephonyjstest/contact_function/entry/src/main/resources/rawfile/star-1-2.png b/telephony/telephonyjstest/contact_function/entry/src/main/resources/rawfile/star-1-2.png new file mode 100644 index 0000000000000000000000000000000000000000..450c3dd3ca68bf601bd08e5f41797d376e20d00d GIT binary patch literal 8295 zcma)iby!qi)GiDI3@ITfJq#cs(xo6VIK9g0Is58cut9YYAhAky89NJ&c$4N6Nm zw8Wj?_uaqmbN@K!?C070th3LGz1Mo*9j&FIL_x|(iid|s0au1;Ejqu(x%6MX}UcP^pVq^MKx?9Z3<6HZSZ(YTWwl+ z4})r2h&L?_5Z3xL9JTpl$1We;HwOfV*U2Dd;4VathABE2mL~&90=s!A z17A=j029Bxgn&sP{lPFWGr*0ABr?l!nhT^H>H*JtEAfpTOhQ8`F<+vJ8@ZDt_v2l} zOF0@&=65xE>0mI)Bv(k<5_x1Wr}DE!>r#HG91U6(z}Lz^i4RY3X&Tfw3&nM%1C5a) z%(ySExg?jj0C8QEq$g*CpQ*Xk7yhNiNn@bzJnMOrz${d^ZW9+zK}FP6Wt)@*prd*F z(rz`Qjq{pA&L7Hx1K?P`{_=|>e3O_&^n>(;eRI>{gq^xXjKN& z@MCLic)gQH^`1Je&lNP6cFPmo@#}YJ&*-b0%L%rIiIEC%K9b2VMf24JMlrxCU;4bM9NM`z%7*&=MO^=(k?eYD|N0NSRUq1vD*l*s- z4;5;mae9K07G>0^3_eR`n2mvtsZw7^GmKor6U4O}T!EZW#(u#BA_V$L+A#=JNj^p8 zMo$u9AUc@@o>+Zc_I+>hn*oW`p*FU_>v9MlGJsQZG`UKU!kSII&(iR9spGPLK_?dv zH62cSuh@C=`WqBAh*E;+sLBQMSO4tFt#w3r4D|KjW&wIRodFgZ;AhwXl8fiVM#Mlq?)7vx`ZL}!b@}1f<))jG`dj8AWF8Jt&p)QZi4IvM<$fyTHy((7 z_OI$?I{kDulhThr+>EksY|4LaHNAz}+DgDCag*>B4ccc;ylt*QweQ$+ zaU1J{j4V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3!gYbo4Di{8qzV+(9 zdlmksohQmRTs@qB;(Wo?dER_ux6XQb@q$tQPW?CMu6GVQd;R=iR;-S{Kr%Zks7>b1 zNs{|-+jhObYE}NR&`TGGr^h^4bjh%c>R#@=8nM&Md>_a+zVulsl;){flFekV1t9ob z+SqfV_Pv3$2f)bQ8%Ul2>fdYR^1zs0BQF~olsOj5AodC&Q_7SMFzsz2 z9newxE&jodk~tNHwl%LBMMDbrk=(^b literal 0 HcmV?d00001 diff --git a/telephony/telephonyjstest/contact_function_merge/BUILD.gn b/telephony/telephonyjstest/contact_function_merge/BUILD.gn new file mode 100644 index 000000000..9203b26a2 --- /dev/null +++ b/telephony/telephonyjstest/contact_function_merge/BUILD.gn @@ -0,0 +1,32 @@ +# 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("ActsContactFunctionMergeEtsTest") { + hap_profile = "./entry/src/main/config.json" + deps = [ + ":ace_demo_ets_assets", + ":ace_demo_ets_resources", + ] + ets2abc = true + certificate_profile = "./signature/openharmony_sx.p7b" + hap_name = "ActsContactFunctionMergeEtsTest" +} +ohos_js_assets("ace_demo_ets_assets") { + source_dir = "./entry/src/main/ets/MainAbility" +} +ohos_resources("ace_demo_ets_resources") { + sources = [ "./entry/src/main/resources" ] + hap_profile = "./entry/src/main/config.json" +} diff --git a/telephony/telephonyjstest/contact_function_merge/Test.json b/telephony/telephonyjstest/contact_function_merge/Test.json new file mode 100644 index 000000000..a7eacfaa1 --- /dev/null +++ b/telephony/telephonyjstest/contact_function_merge/Test.json @@ -0,0 +1,18 @@ +{ + "description": "Configuration for hjunit demo Tests", + "driver": { + "type": "JSUnitTest", + "test-timeout": "1800000", + "package": "com.ohos.contactfunctionmerge", + "shell-timeout": "60000" + }, + "kits": [ + { + "test-file-name": [ + "ActsContactFunctionMergeEtsTest.hap" + ], + "type": "AppInstallKit", + "cleanup-apps": true + } + ] +} diff --git a/telephony/telephonyjstest/contact_function_merge/entry/src/main/config.json b/telephony/telephonyjstest/contact_function_merge/entry/src/main/config.json new file mode 100644 index 000000000..7491de1be --- /dev/null +++ b/telephony/telephonyjstest/contact_function_merge/entry/src/main/config.json @@ -0,0 +1,93 @@ +{ + "app": { + "bundleName": "com.ohos.contactfunctionmerge", + "vendor": "open", + "version": { + "code": 1000000, + "name": "1.0.0" + }, + "apiVersion": { + "compatible": 7, + "releaseType": "Release", + "target": 7 + } + }, + "deviceConfig": {}, + "module": { + "package": "com.ohos.contactfunctionmerge", + "name": ".MyApplication", + "mainAbility": ".MainAbility", + "srcPath": "MainAbility", + "deviceType": [ + "phone" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "entry", + "moduleType": "entry", + "installationFree": false + }, + "abilities": [ + { + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ], + "orientation": "unspecified", + "visible": true, + "srcPath": "MainAbility", + "name": ".MainAbility", + "srcLanguage": "ets", + "icon": "$media:icon", + "description": "$string:description_mainability", + "formsEnabled": false, + "label": "$string:entry_MainAbility", + "type": "page", + "launchType": "standard" + } + ], + "js": [ + { + "mode": { + "syntax": "ets", + "type": "pageAbility" + }, + "pages": [ + "pages/index", + "pages/Button", + "pages/Blank", + "pages/DataPanel", + "pages/Divider", + "pages/Text", + "pages/RowSplit", + "pages/Scroll", + "pages/Stack", + "pages/Image", + "pages/Progress", + "pages/Qrcode", + "pages/Rating", + "pages/Span", + "pages/Slider", + "pages/Badge", + "pages/Column", + "pages/ColumnSplit", + "pages/Counter", + "pages/Flex", + "pages/GridContainer" + + ], + "name": ".MainAbility", + "window": { + "designWidth": 720, + "autoDesignWidth": false + } + } + ] + } +} \ No newline at end of file diff --git a/telephony/telephonyjstest/contact_function_merge/entry/src/main/ets/MainAbility/app.ets b/telephony/telephonyjstest/contact_function_merge/entry/src/main/ets/MainAbility/app.ets new file mode 100644 index 000000000..261fadca2 --- /dev/null +++ b/telephony/telephonyjstest/contact_function_merge/entry/src/main/ets/MainAbility/app.ets @@ -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('Application onCreate') + }, + onDestroy() { + console.info('Application onDestroy') + }, +} \ No newline at end of file diff --git a/telephony/telephonyjstest/contact_function_merge/entry/src/main/ets/MainAbility/pages/Badge.ets b/telephony/telephonyjstest/contact_function_merge/entry/src/main/ets/MainAbility/pages/Badge.ets new file mode 100644 index 000000000..66de6f8e3 --- /dev/null +++ b/telephony/telephonyjstest/contact_function_merge/entry/src/main/ets/MainAbility/pages/Badge.ets @@ -0,0 +1,95 @@ +/* + * 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. + */ + +@Entry +@Component +struct badge { + @State counts: number = 33 + @State message: string = 'new' + @State active: boolean = false + private content: string = "badge Page"; + + onPageShow() { + console.info('badge page show called'); + } + + onBuildDone() { + console.info('badge page build done called'); + } + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Scroll() { + Column() { + Text(`${this.content}`) + .fontSize(50) + .fontWeight(FontWeight.Bold) + Badge({ + count: this.counts, + position: BadgePosition.Right, + maxCount: 99, + style: { color: 0xFFFFFF, fontSize: 16, badgeSize: 20, badgeColor: Color.Red } + }) { + Button('message') + .onClick(() => { + this.counts++ + }) + .width(100).height(50).backgroundColor(0x317aff) + } + .width(100) + .height(50) + .key('badge') + + Text("BadgePosition.RightTop").fontSize(16) + Badge({ + count: this.counts, + position: BadgePosition.RightTop, + maxCount: 99, + style: { color: 0xFFFFFF, fontSize: '16', badgeSize: '20', badgeColor: Color.Red } + }) { + Button('message') + .onClick(() => { + this.counts++ + }) + .width(100).height(50).backgroundColor(0x317aff) + } + .width(100) + .height(50) + .key('badge1') + + Text("BadgePosition.Left").fontSize(16) + Badge({ + count: this.counts, + position: BadgePosition.Left, + maxCount: 99, + style: { color: Color.Pink, fontSize: 16, badgeSize: 20, badgeColor: Color.Red } + }) { + Button('message') + .onClick(() => { + this.counts++ + }) + .width(100).height(50).backgroundColor(0x317aff) + } + .width(100) + .height(50) + .key('badge2') + } + } + } + .key('flex') + .width('100%') + .height('100%') + } +} diff --git a/telephony/telephonyjstest/contact_function_merge/entry/src/main/ets/MainAbility/pages/Blank.ets b/telephony/telephonyjstest/contact_function_merge/entry/src/main/ets/MainAbility/pages/Blank.ets new file mode 100644 index 000000000..a50fc719e --- /dev/null +++ b/telephony/telephonyjstest/contact_function_merge/entry/src/main/ets/MainAbility/pages/Blank.ets @@ -0,0 +1,47 @@ +/* + * 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. + */ + +@Entry +@Component +struct blank_testcase { + @State Color: Color = Color.Pink + @State active: boolean = false + private content: string = "Blank Page" + + onPageShow() { + console.info('Blank page show called'); + } + + onBuildDone() { + console.info('Blank page build done called'); + } + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Text(`${this.content}`) + .fontSize(50) + .fontWeight(FontWeight.Bold) + Blank(100) + .color(this.Color) + .key('blank') + Text('on/off').fontSize(18).height(60) + } + .key('flex') + .width('100%') + .height('100%') + + + } +} diff --git a/telephony/telephonyjstest/contact_function_merge/entry/src/main/ets/MainAbility/pages/Button.ets b/telephony/telephonyjstest/contact_function_merge/entry/src/main/ets/MainAbility/pages/Button.ets new file mode 100644 index 000000000..ac2271ea3 --- /dev/null +++ b/telephony/telephonyjstest/contact_function_merge/entry/src/main/ets/MainAbility/pages/Button.ets @@ -0,0 +1,70 @@ +/* + * 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 router from '@system.router' + +@Entry +@Component +struct button_testcase { + @State stateEffect: boolean = true + @State ButtonType: ButtonType = ButtonType.Circle + private content: string = "Button Page"; + + onPageShow() { + console.info('Button page show called'); + } + + onBuildDone() { + console.info('Button page build done called'); + } + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Text(`${this.content}`) + .fontSize(50) + .fontWeight(FontWeight.Bold) + Button('1.value', { type: ButtonType.Circle, stateEffect: this.stateEffect }) + .fontSize(12) + .fontWeight(FontWeight.Bold) + .fontColor(0xCCCCCC) + .height(40) + .width(40) + .key('button') + .backgroundColor('#0D9FFB') + .onClick(() => { + router.back() + }) + .padding(10) + Button() { + Text("2.Capsule") + } + .type(ButtonType.Capsule) + .stateEffect(false) + .backgroundColor('#0D9FFB') + .padding(10) + .key('button1') + + Button() { + Text("3.Normal") + }.type(ButtonType.Normal) + .backgroundColor('#0D9FFB') + .key('button2') + + }.key('flex') + .width('100%') + .height('100%') + } +} + diff --git a/telephony/telephonyjstest/contact_function_merge/entry/src/main/ets/MainAbility/pages/Column.ets b/telephony/telephonyjstest/contact_function_merge/entry/src/main/ets/MainAbility/pages/Column.ets new file mode 100644 index 000000000..b9e5c84e2 --- /dev/null +++ b/telephony/telephonyjstest/contact_function_merge/entry/src/main/ets/MainAbility/pages/Column.ets @@ -0,0 +1,51 @@ +/* + * 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. + */ + +@Entry +@Component +struct column { + @State active: boolean = false + private content: string = "Column Page" + + onPageShow() { + console.info('Column page show called'); + } + + onBuildDone() { + console.info('Column page build done called'); + } + + build() { + Column({ space: 5 }) { + Text('alignItems(Center)').fontSize(9).fontColor(0xCCCCCC).width('90%') + Column() { + Column().width('50%').height(50).backgroundColor(0xAFEEEE) + Column().width('50%').height(50).backgroundColor(0x00FFFF) + }.alignItems(HorizontalAlign.Center).width('90%').border({ width: 1 }).key('column') + + Text('alignItems(Start)').fontSize(9).fontColor(0xCCCCCC).width('90%') + Column({ space: '5' }) { + Column().width('50%').height(50).backgroundColor(0xAFEEEE) + Column().width('50%').height(50).backgroundColor(0x00FFFF) + }.alignItems(HorizontalAlign.Start).width('90%').border({ width: 1 }).key('column1') + + Text('alignItems(End)').fontSize(9).fontColor(0xCCCCCC).width('90%') + Column() { + Column().width('50%').height(50).backgroundColor(0xAFEEEE) + Column().width('50%').height(50).backgroundColor(0x00FFFF) + }.alignItems(HorizontalAlign.End).width('90%').border({ width: 1 }).key('column2') + }.width('100%').padding({ top: 5 }) + } +} diff --git a/telephony/telephonyjstest/contact_function_merge/entry/src/main/ets/MainAbility/pages/ColumnSplit.ets b/telephony/telephonyjstest/contact_function_merge/entry/src/main/ets/MainAbility/pages/ColumnSplit.ets new file mode 100644 index 000000000..cb0597310 --- /dev/null +++ b/telephony/telephonyjstest/contact_function_merge/entry/src/main/ets/MainAbility/pages/ColumnSplit.ets @@ -0,0 +1,70 @@ +/* + * 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. + */ + +@Entry +@Component +struct columnSplit { + private content: string = "ColumnSplit Page" + + onPageShow() { + console.info('ColumnSplit page show called'); + } + + onBuildDone() { + console.info('ColumnSplit page build done called'); + } + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Scroll() { + Column() { + Text(`${this.content}`) + .fontSize(50) + .fontWeight(FontWeight.Bold) + Column() { + Text('ColumnSplit').fontSize(9).fontColor(0xCCCCCC).width('90%') + ColumnSplit() { + Text('1').width('100%').height(50).backgroundColor(0xF5DEB3).textAlign(TextAlign.Center) + Text('2').width('100%').height(50).backgroundColor(0xD2B48C).textAlign(TextAlign.Center) + Text('3').width('100%').height(50).backgroundColor(0xF5DEB3).textAlign(TextAlign.Center) + Text('4').width('100%').height(50).backgroundColor(0xD2B48C).textAlign(TextAlign.Center) + Text('5').width('100%').height(50).backgroundColor(0xF5DEB3).textAlign(TextAlign.Center) + }.key('columnSplit') + .resizeable(true) + .width('90%').height('60%') + + }.width("100%") + + Column() { + Text('ColumnSplit1').fontSize(9).fontColor(0xCCCCCC).width('90%') + ColumnSplit() { + Text('1').width('100%').height(50).backgroundColor(0xF5DEB3).textAlign(TextAlign.Center) + Text('2').width('100%').height(50).backgroundColor(0xD2B48C).textAlign(TextAlign.Center) + Text('3').width('100%').height(50).backgroundColor(0xF5DEB3).textAlign(TextAlign.Center) + Text('4').width('100%').height(50).backgroundColor(0xD2B48C).textAlign(TextAlign.Center) + Text('5').width('100%').height(50).backgroundColor(0xF5DEB3).textAlign(TextAlign.Center) + }.key('columnSplit1') + .resizeable(false) + .width('90%').height('60%') + + }.width("100%") + } + } + } + .key('flex') + .width('100%') + .height('100%') + } +} diff --git a/telephony/telephonyjstest/contact_function_merge/entry/src/main/ets/MainAbility/pages/Counter.ets b/telephony/telephonyjstest/contact_function_merge/entry/src/main/ets/MainAbility/pages/Counter.ets new file mode 100644 index 000000000..ecdbfaf10 --- /dev/null +++ b/telephony/telephonyjstest/contact_function_merge/entry/src/main/ets/MainAbility/pages/Counter.ets @@ -0,0 +1,51 @@ +/* + * 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. + */ + +@Entry +@Component +struct counter { + @State value: number = 0 + @State active: boolean = false + private content: string = "Counter Page" + + onPageShow() { + console.info('Counter page show called'); + } + + onBuildDone() { + console.info('Counter page build done called'); + } + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Text(`${this.content}`) + .fontSize(50) + .fontWeight(FontWeight.Bold) + Counter() { + Text(this.value.toString()) + }.margin(100) + .key('counter') + .onInc(() => { + this.value++ + }) + .onDec(() => { + this.value-- + }) + }.width("100%") + .key('flex') + .width('100%') + .height('100%') + } +} diff --git a/telephony/telephonyjstest/contact_function_merge/entry/src/main/ets/MainAbility/pages/DataPanel.ets b/telephony/telephonyjstest/contact_function_merge/entry/src/main/ets/MainAbility/pages/DataPanel.ets new file mode 100644 index 000000000..3c6248484 --- /dev/null +++ b/telephony/telephonyjstest/contact_function_merge/entry/src/main/ets/MainAbility/pages/DataPanel.ets @@ -0,0 +1,69 @@ +/* + * 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 router from '@system.router' + +@Entry +@Component +struct dataPanel_testcase { + @State width: string= "200" + @State height: string= "100" + @State active: boolean = false + private content: string = "DataPanel Page" + + onPageShow() { + console.info('Blank page show called'); + } + + onBuildDone() { + console.info('Blank page build done called'); + } + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Text(`${this.content}`) + .fontSize(50) + DataPanel({ values: [20, 40, 20], max: 100, type: DataPanelType.Line }) + .width(this.width) + .height(this.height) + .key('DataPanel') + .onClick(() => { + router.back() + }) + .closeEffect(false) + + DataPanel({ values: [20, 40, 20], max: 100, type: DataPanelType.Circle}) + .width(this.width) + .height(this.height) + .key('DataPanel2') + .onClick(() => { + router.back() + }) + .closeEffect(true) + DataPanel({ values: [20, 40, 20], max: 100}) + .width(this.width) + .height(this.height) + .key('DataPanel3') + .onClick(() => { + router.back() + }) + .closeEffect(false) + } + .key('flex') + .width('100%') + .height('100%') + + } +} diff --git a/telephony/telephonyjstest/contact_function_merge/entry/src/main/ets/MainAbility/pages/Divider.ets b/telephony/telephonyjstest/contact_function_merge/entry/src/main/ets/MainAbility/pages/Divider.ets new file mode 100644 index 000000000..02bf60779 --- /dev/null +++ b/telephony/telephonyjstest/contact_function_merge/entry/src/main/ets/MainAbility/pages/Divider.ets @@ -0,0 +1,71 @@ +/* + * 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 router from '@system.router' + +@Entry +@Component +struct divider_textcase { + @State vertical: boolean = true + @State color: Color = Color.Red + @State strokeWidth: number = 7 + @State lineCap: LineCapStyle = LineCapStyle.Butt + @State active: boolean = false + private content: string = "Divider Page"; + + onPageShow() { + console.info('Button page show called'); + } + + onBuildDone() { + console.info('Button page build done called'); + } + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Text(`${this.content}`) + .fontSize(50) + Divider() + .lineCap(LineCapStyle.Butt) + .strokeWidth(this.strokeWidth) + .color(this.color) + .vertical(this.vertical) + .height(150) + .key('divider') + .onClick(() => { + router.back() + }) + Divider() + .lineCap(LineCapStyle.Round) + .vertical(false) + .color(Color.Green) + .strokeWidth(10) + .height(150) + .key('divider1') + Divider() + .lineCap(LineCapStyle.Square) + .color(Color.Green) + .vertical(true) + .strokeWidth(10) + .height(150) + .key('divider2') + } + .key('flex') + .width('100%') + .height('100%') + } +} + + diff --git a/telephony/telephonyjstest/contact_function_merge/entry/src/main/ets/MainAbility/pages/Flex.ets b/telephony/telephonyjstest/contact_function_merge/entry/src/main/ets/MainAbility/pages/Flex.ets new file mode 100644 index 000000000..a0e21251e --- /dev/null +++ b/telephony/telephonyjstest/contact_function_merge/entry/src/main/ets/MainAbility/pages/Flex.ets @@ -0,0 +1,135 @@ +/* + * 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. + */ + +@Entry +@Component +struct flex { + private content: string = "Flex Page" + + onPageShow() { + console.info('Flex page show called'); + } + + onBuildDone() { + console.info('Flex page build done called'); + } + + build() { + Column() { + Column({ space : 2 }) { + Text('direction:Column').fontSize(9).fontColor(0xCCCCCC).width('90%') + Flex({ + direction: FlexDirection.Column, + wrap: FlexWrap.NoWrap, + justifyContent: FlexAlign.Center, + alignItems:ItemAlign.Start, + alignContent: FlexAlign.Start, + }) { + Text('1').width('100%').height(20).backgroundColor(0xF5DEB3) + Text('2').width('100%').height(20).backgroundColor(0xD2B48C) + Text('3').width('100%').height(20).backgroundColor(0xF5DEB3) + } + .key('flex') + .height(70) + .width('90%') + .padding(10) + .backgroundColor(0xAFEEEE) + + Text('direction:Row').fontSize(9).fontColor(0xCCCCCC).width('90%') + Flex({ + direction: FlexDirection.Row, + wrap: FlexWrap.Wrap, + justifyContent: FlexAlign.Start, + alignItems:ItemAlign.Start, + alignContent: FlexAlign.Center, + }) { + Text('1').width('20%').height(20).backgroundColor(0xF5DEB3) + Text('2').width('20%').height(20).backgroundColor(0xD2B48C) + Text('3').width('20%').height(20).backgroundColor(0xF5DEB3) + } + .key('flex1') + .height(70) + .width('90%') + .padding(10) + .backgroundColor(0xAFEEEE) + + Text('direction:RowReverse').fontSize(9).fontColor(0xCCCCCC).width('90%') + Flex({ + direction: FlexDirection.RowReverse, + wrap: FlexWrap.Wrap, + justifyContent: FlexAlign.End, + alignItems:ItemAlign.End, + alignContent: FlexAlign.End, + }) { + Text('1').width('50%').height(20).backgroundColor(0xF5DEB3) + Text('2').width('50%').height(20).backgroundColor(0xD2B48C) + Text('3').width('50%').height(20).backgroundColor(0xF5DEB3) + } + .key('flex2') + .height(90) + .width('90%') + .padding(10) + .backgroundColor(0xAFEEEE) + + Text('justifyContent:SpaceBetween').fontSize(9).fontColor(0xCCCCCC).width('90%') + Flex({ + justifyContent: FlexAlign.SpaceBetween, + wrap: FlexWrap.Wrap, + }) { + Text('1').width('100%').height(20).backgroundColor(0xF5DEB3) + Text('2').width('100%').height(20).backgroundColor(0xD2B48C) + Text('3').width('100%').height(20).backgroundColor(0xF5DEB3) + } + .key('flex3') + .height(100) + .width('90%') + .padding(10) + .backgroundColor(0xAFEEEE) + + Text('justifyContent AND alignContent').fontSize(9).fontColor(0xCCCCCC).width('90%') + Flex({ + justifyContent: FlexAlign.SpaceEvenly, + alignContent: FlexAlign.SpaceEvenly, + wrap: FlexWrap.Wrap, + }) { + Text('1').width('50%').height(20).backgroundColor(0xF5DEB3) + Text('2').width('50%').height(20).backgroundColor(0xD2B48C) + Text('3').width('50%').height(20).backgroundColor(0xF5DEB3) + } + .key('flex4') + .height(90) + .width('90%') + .padding(10) + .backgroundColor(0xAFEEEE) + + Text('justifyContent AND alignContent').fontSize(9).fontColor(0xCCCCCC).width('90%') + Flex({ + justifyContent: FlexAlign.SpaceAround, + alignContent: FlexAlign.SpaceAround, + wrap: FlexWrap.Wrap, + }) { + Text('1').width('50%').height(20).backgroundColor(0xF5DEB3) + Text('2').width('50%').height(20).backgroundColor(0xD2B48C) + Text('3').width('50%').height(20).backgroundColor(0xF5DEB3) + } + .key('flex5') + .height(90) + .width('90%') + .padding(10) + .backgroundColor(0xAFEEEE) + }.width('100%').margin({ top: 5 }) + }.width('100%') + } +} diff --git a/telephony/telephonyjstest/contact_function_merge/entry/src/main/ets/MainAbility/pages/GridContainer.ets b/telephony/telephonyjstest/contact_function_merge/entry/src/main/ets/MainAbility/pages/GridContainer.ets new file mode 100644 index 000000000..573581104 --- /dev/null +++ b/telephony/telephonyjstest/contact_function_merge/entry/src/main/ets/MainAbility/pages/GridContainer.ets @@ -0,0 +1,170 @@ +/* + * 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. + */ + +@Entry +@Component +struct gridContainer { + @State sizeType: SizeType = SizeType.XS + @State active: boolean = false + private content: string = "GridContainer Page" + + onPageShow() { + console.info('GridContainer page show called'); + } + + onBuildDone() { + console.info('GridContainer page build done called'); + } + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Text(`${this.content}`) + .fontSize(50) + .fontWeight(FontWeight.Bold) + Scroll() { + Column({ space: 5 }) { + GridContainer({ columns: 12, sizeType: this.sizeType, gutter: 10, margin: 20 }) { + Row() { + Text('1') + .useSizeType({ + xs: { span: 6, offset: 0 }, + sm: { span: 2, offset: 0 }, + md: { span: 2, offset: 0 }, + lg: { span: 2, offset: 0 } + }) + .height(50).backgroundColor(0x4682B4).textAlign(TextAlign.Center) + Text('2').gridSpan(2) + + .height(50).backgroundColor(0x00BFFF).textAlign(TextAlign.Center) + Text('3').gridOffset(3) + + .height(50).backgroundColor(0x4682B4).textAlign(TextAlign.Center) + } + }.key('gridContainer') + .width('90%') + .alignItems(HorizontalAlign.Start) + + Text('Click Simulate to change the device width').fontSize(9).width('90%').fontColor(0xCCCCCC) + Row() { + Button('XS') + .onClick(() => { + this.sizeType = SizeType.XS + }).backgroundColor(0x317aff) + Button('SM') + .onClick(() => { + this.sizeType = SizeType.SM + }).backgroundColor(0x317aff) + Button('MD') + .onClick(() => { + this.sizeType = SizeType.MD + }).backgroundColor(0x317aff) + Button('LG') + .onClick(() => { + this.sizeType = SizeType.LG + }).backgroundColor(0x317aff) + } + + GridContainer({ columns: "auto", sizeType: SizeType.MD, gutter: '10', margin: '20' }) { + Row() { + Text('1') + .useSizeType({ + xs: { span: 6, offset: 0 }, + sm: { span: 2, offset: 0 }, + md: { span: 2, offset: 0 }, + lg: { span: 2, offset: 0 } + }) + .height(50).backgroundColor(0x4682B4).textAlign(TextAlign.Center) + Text('2').gridSpan(2) + + .height(50).backgroundColor(0x00BFFF).textAlign(TextAlign.Center) + Text('3').gridOffset(3) + + .height(50).backgroundColor(0x4682B4).textAlign(TextAlign.Center) + } + }.key('gridContainer1') + .width('90%') + .alignItems(HorizontalAlign.Center) + + GridContainer({ columns: 12, sizeType: SizeType.SM, gutter: 10, margin: 20 }) { + Row() { + Text('1') + .useSizeType({ + xs: { span: 6, offset: 0 }, + sm: { span: 2, offset: 0 }, + md: { span: 2, offset: 0 }, + lg: { span: 2, offset: 0 } + }) + .height(50).backgroundColor(0x4682B4).textAlign(TextAlign.Center) + Text('2').gridSpan(2) + + .height(50).backgroundColor(0x00BFFF).textAlign(TextAlign.Center) + Text('3').gridOffset(3) + + .height(50).backgroundColor(0x4682B4).textAlign(TextAlign.Center) + } + }.key('gridContainer2') + .width('90%') + .alignItems(HorizontalAlign.End) + + GridContainer({ columns: 12, sizeType: SizeType.LG, gutter: 10, margin: 20 }) { + Row() { + Text('1') + .useSizeType({ + xs: { span: 6, offset: 0 }, + sm: { span: 2, offset: 0 }, + md: { span: 2, offset: 0 }, + lg: { span: 2, offset: 0 } + }) + .height(50).backgroundColor(0x4682B4).textAlign(TextAlign.Center) + Text('2').gridSpan(2) + + .height(50).backgroundColor(0x00BFFF).textAlign(TextAlign.Center) + Text('3').gridOffset(3) + + .height(50).backgroundColor(0x4682B4).textAlign(TextAlign.Center) + } + }.key('gridContainer3') + .width('90%') + .alignItems(HorizontalAlign.End) + + GridContainer({ columns: 12, sizeType: SizeType.Auto, gutter: 10, margin: 20 }) { + Row() { + Text('1') + .useSizeType({ + xs: { span: 6, offset: 0 }, + sm: { span: 2, offset: 0 }, + md: { span: 2, offset: 0 }, + lg: { span: 2, offset: 0 } + }) + .height(50).backgroundColor(0x4682B4).textAlign(TextAlign.Center) + Text('2').gridSpan(2) + + .height(50).backgroundColor(0x00BFFF).textAlign(TextAlign.Center) + Text('3').gridOffset(3) + + .height(50).backgroundColor(0x4682B4).textAlign(TextAlign.Center) + } + }.key('gridContainer4') + .width('90%') + .alignItems(HorizontalAlign.End) + + }.width('100%').margin({ top: 5 }) + } + } + .key('flex') + .width('100%') + .height('100%') + } +} diff --git a/telephony/telephonyjstest/contact_function_merge/entry/src/main/ets/MainAbility/pages/Image.ets b/telephony/telephonyjstest/contact_function_merge/entry/src/main/ets/MainAbility/pages/Image.ets new file mode 100644 index 000000000..5cc583e93 --- /dev/null +++ b/telephony/telephonyjstest/contact_function_merge/entry/src/main/ets/MainAbility/pages/Image.ets @@ -0,0 +1,90 @@ +/* + * 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. + */ + +@Entry +@Component +struct image_textcase { + @State Width: number = 0 + @State height: number = 0 + + onPageShow() { + console.info('Image page show called'); + } + + onBuildDone() { + console.info('Image page build done called'); + } + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Column() { + Text(`Image page`) + .fontSize(50) + .fontWeight(FontWeight.Bold) + Image("/resources/rawfile/hand.png") + .matchTextDirection(false) + .fitOriginalSize(false) + .fillColor(0xCCCCCC) + .objectFit(ImageFit.Cover) + .objectRepeat(ImageRepeat.NoRepeat) + .interpolation(ImageInterpolation.None) + .renderMode(ImageRenderMode.Original) + .autoResize(false) + .syncLoad(false) + .sourceSize({ width: 200, height: 100 }) + .alt("/resources/rawfile/person.png") + .key('image1') + Image("/resources/rawfile/hand.png") + .objectFit(ImageFit.Contain) + .objectRepeat(ImageRepeat.X) + .interpolation(ImageInterpolation.High) + .renderMode(ImageRenderMode.Template) + .key('image2') + .height(180) + .width(180) + .onComplete((msg: { + width: number, + height: number + }) => { + this.Width = msg.width + this.height = msg.height + console.info('Width ----' + this.Width) + console.info('height ----' + this.height) + }) + .onError(() => { + console.info('load image fail') + }) + Image("/resources/rawfile/hand.png") + .objectFit(ImageFit.Fill) + .objectRepeat(ImageRepeat.Y) + .interpolation(ImageInterpolation.Low) + .key('image3') + Image("/resources/rawfile/hand.png") + .objectFit(ImageFit.None) + .objectRepeat(ImageRepeat.XY) + .interpolation(ImageInterpolation.Medium) + .key('image4') + Image("/resources/rawfile/hand.png") + .objectFit(ImageFit.ScaleDown) + .key('image5') + }.width(300) + .height(300) + .borderColor(Color.Pink) + .borderWidth(4) + } + } +} + + diff --git a/telephony/telephonyjstest/contact_function_merge/entry/src/main/ets/MainAbility/pages/Navigator.ets b/telephony/telephonyjstest/contact_function_merge/entry/src/main/ets/MainAbility/pages/Navigator.ets new file mode 100644 index 000000000..6c50769cf --- /dev/null +++ b/telephony/telephonyjstest/contact_function_merge/entry/src/main/ets/MainAbility/pages/Navigator.ets @@ -0,0 +1,60 @@ +/* + * 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. + */ + +@Entry +@Component +struct navigator_testcase { + @State active: boolean = false + @State params: Object = { text: 'news' } + + onPageShow() { + console.info('Navigator page show called'); + } + + onBuildDone() { + console.info('Navigator page build done called'); + } + + build() { + Column() { + Navigator({ target: "pages/index", type: NavigationType.Back }) { + Text('Navigator test in Navigator,back') + }.active(this.active) + .key('navigator') + .params({ + data: 24 + }) + + Navigator({ target: "pages/index", type: NavigationType.Push }) { + Text('Navigator test in Navigator,push') + }.active(this.active) + .key('navigator2') + .params({ + data: 24 + }) + + Navigator({ target: "pages/index", type: NavigationType.Replace }) { + Text('Navigator test in Navigator,replace') + }.active(this.active) + .key('navigator3') + .params({ + data: 24 + }) + }.width(300) + .height(300) + .borderColor(Color.Pink) + .borderWidth(2) + } +} diff --git a/telephony/telephonyjstest/contact_function_merge/entry/src/main/ets/MainAbility/pages/Panel.ets b/telephony/telephonyjstest/contact_function_merge/entry/src/main/ets/MainAbility/pages/Panel.ets new file mode 100644 index 000000000..32ddabbd1 --- /dev/null +++ b/telephony/telephonyjstest/contact_function_merge/entry/src/main/ets/MainAbility/pages/Panel.ets @@ -0,0 +1,96 @@ +/* + * 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. + */ + +@Entry +@Component +struct PanelExample { + @State show: boolean = true + + onPageShow() { + console.info('Panel page show called'); + } + + onBuildDone() { + console.info('Panel page build done called'); + } + + build() { + Column() { + Text('2021-09-30 Today Calendar: 1.afternoon......Click for details') + .width('90%') + .height(50) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + .padding({ left: 20 }) + .onClick(() => { + this.show = !this.show + }) + Panel(this.show) { + Column() { + Text('Today Calendar') + Divider() + Text('1. afternoon 4:00 The project meeting') + } + } + .key('panel') + .type(PanelType.Foldable) + .mode(PanelMode.Half) + .dragBar(true) + .fullHeight(500) + .halfHeight(250) + .miniHeight(100) + .onChange((value: any) => { + console.info(`width:${value.width},height:${value.height},mode:${value.mode}`) + }) + + Panel(this.show) { + Column() { + Text('Today Calendar') + Divider() + Text('1. afternoon 4:00 The project meeting') + } + } + .key('panel2') + .type(PanelType.Minibar) + .mode(PanelMode.Mini) + .dragBar(true) + .fullHeight(500) + .halfHeight(250) + .miniHeight(100) + .onChange((value: any) => { + console.info(`width:${value.width},height:${value.height},mode:${value.mode}`) + }) + + Panel(false) { + Column() { + Text('Today Calendar') + Divider() + Text('1. afternoon 4:00 The project meeting') + } + } + .key('panel3') + .type(PanelType.Temporary) + .mode(PanelMode.Full) + .dragBar(true) + .fullHeight(500) + .halfHeight(250) + .miniHeight(100) + .onChange((value: any) => { + console.info(`width:${value.width},height:${value.height},mode:${value.mode}`) + }) + + }.width('100%').height('50%').backgroundColor(0xDCDCDC).padding({ top: 5 }) + } +} \ No newline at end of file diff --git a/telephony/telephonyjstest/contact_function_merge/entry/src/main/ets/MainAbility/pages/Progress.ets b/telephony/telephonyjstest/contact_function_merge/entry/src/main/ets/MainAbility/pages/Progress.ets new file mode 100644 index 000000000..c8608089f --- /dev/null +++ b/telephony/telephonyjstest/contact_function_merge/entry/src/main/ets/MainAbility/pages/Progress.ets @@ -0,0 +1,76 @@ +/* + * 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. + */ + +@Entry +@Component +struct progress_testcase { + onPageShow() { + console.info('Progress page show called'); + } + + onBuildDone() { + console.info('Progress page build done called'); + } + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Column() { + Text(`Progress page`) + .fontSize(50) + .fontWeight(FontWeight.Bold) + Progress({ value: 20, total: 40, style: ProgressStyle.Linear }) + .value(3) + .color(Color.Blue) + .width(50) + .height(70) + .key('progress') + + Progress({ value: 20, total: 40, style: ProgressStyle.Eclipse }) + .value(3) + .color(Color.Blue) + .width(50) + .height(70) + .key('progress2') + + Progress({ value: 20, total: 40, style: ProgressStyle.Ring }) + .value(3) + .color(Color.Blue) + .width(50) + .height(70) + .key('progress3') + + Progress({ value: 20, total: 40, style: ProgressStyle.ScaleRing }) + .value(3) + .color(Color.Blue) + .width(50) + .height(70) + .key('progress4') + + Progress({ value: 20, total: 40, style: ProgressStyle.Capsule }) + .value(3) + .color(Color.Blue) + .width(50) + .height(70) + .key('progress5') + + } + .width(400) + .height(400) + .borderColor(Color.Pink) + .borderWidth(2) + } + } +} + diff --git a/telephony/telephonyjstest/contact_function_merge/entry/src/main/ets/MainAbility/pages/Qrcode.ets b/telephony/telephonyjstest/contact_function_merge/entry/src/main/ets/MainAbility/pages/Qrcode.ets new file mode 100644 index 000000000..5c0dd84ef --- /dev/null +++ b/telephony/telephonyjstest/contact_function_merge/entry/src/main/ets/MainAbility/pages/Qrcode.ets @@ -0,0 +1,44 @@ +/* + * 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. + */ + +@Entry +@Component +struct qrcode_textcase { + @State Color: Color = Color.Pink + + onPageShow() { + console.info('Qrcode page show called'); + } + + onBuildDone() { + console.info('Qrcode page build done called'); + } + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Text(`Qrcode page`) + .fontSize(50) + .fontWeight(FontWeight.Bold) + QRCode('hello world') + .color("#FFFFC0CB") + .backgroundColor(this.Color) + .width("200") + .height("100") + .key('qrcode') + } + } +} + + diff --git a/telephony/telephonyjstest/contact_function_merge/entry/src/main/ets/MainAbility/pages/Rating.ets b/telephony/telephonyjstest/contact_function_merge/entry/src/main/ets/MainAbility/pages/Rating.ets new file mode 100644 index 000000000..b29e26a39 --- /dev/null +++ b/telephony/telephonyjstest/contact_function_merge/entry/src/main/ets/MainAbility/pages/Rating.ets @@ -0,0 +1,63 @@ +/* + * 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. + */ + +@Entry +@Component +struct rating_testcase { + @State rating: number = 2 + + onPageShow() { + console.info('Rating page show called'); + } + + onBuildDone() { + console.info('Rating page build done called'); + } + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Column() { + Text(`Rating page`) + .fontSize(50) + .fontWeight(FontWeight.Bold) + Rating({ rating: 2, indicator: false }) + .stepSize(0.5) + .stars(5) + .starStyle({ + backgroundUri: '/resources/rawfile/star-1-1.png', + foregroundUri: '/resources/rawfile/star-1-3.png', + secondaryUri: '/resources/rawfile/star-1-2.png' + }) + .onChange((value: number) => { + this.rating = value + }) + .key('rating1') + Rating({ rating: 2, indicator: true }) + .stepSize(0.5) + .stars(5) + .starStyle({ + backgroundUri: '/resources/rawfile/star-1-1.png', + foregroundUri: '/resources/rawfile/star-1-3.png', + secondaryUri: '/resources/rawfile/star-1-2.png' + }) + .key('rating2') + }.width(300) + .height(300) + .borderColor(Color.Pink) + .borderWidth(2) + } + } +} + diff --git a/telephony/telephonyjstest/contact_function_merge/entry/src/main/ets/MainAbility/pages/RowSplit.ets b/telephony/telephonyjstest/contact_function_merge/entry/src/main/ets/MainAbility/pages/RowSplit.ets new file mode 100644 index 000000000..0f4f397b1 --- /dev/null +++ b/telephony/telephonyjstest/contact_function_merge/entry/src/main/ets/MainAbility/pages/RowSplit.ets @@ -0,0 +1,78 @@ +/* + * 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 router from '@system.router' + +@Entry +@Component +struct rowSplit_testcase { + @State resizeable: boolean = false + private content: string = "rowSplit Page"; + + onPageShow() { + console.info('RowSplit page show called'); + } + + onBuildDone() { + console.info('RowSplit page build done called'); + } + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Text(`${this.content}`) + .fontSize(50) + .fontWeight(FontWeight.Bold) + RowSplit() { + Column() { + Text('Demo1.RowSplit') + .fontSize(15) + .fontWeight(FontWeight.Bold) + } + + Column() { + Text('Demo2.RowSplit') + .fontSize(15) + .fontWeight(FontWeight.Bold) + } + } + .height(100) + .key('rowSplit') + .resizeable(this.resizeable) + .onClick(() => { + router.back() + }) + + RowSplit() { + Column() { + Text('Demo3.RowSplit') + .fontSize(15) + .fontWeight(FontWeight.Bold) + } + + Column() { + Text('Demo4.RowSplit') + .fontSize(15) + .fontWeight(FontWeight.Bold) + } + }.height(100) + .key('rowSplit1') + .resizeable(true) + } + .key('flex') + .width('100%') + .height('100%') + } +} + diff --git a/telephony/telephonyjstest/contact_function_merge/entry/src/main/ets/MainAbility/pages/Scroll.ets b/telephony/telephonyjstest/contact_function_merge/entry/src/main/ets/MainAbility/pages/Scroll.ets new file mode 100644 index 000000000..363089d22 --- /dev/null +++ b/telephony/telephonyjstest/contact_function_merge/entry/src/main/ets/MainAbility/pages/Scroll.ets @@ -0,0 +1,200 @@ +/* + * 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. + */ + +@Entry +@Component +struct scroll_testcase { + @State scrollBarWidth: number = 20 + @State scrollable: ScrollDirection = ScrollDirection.None + @State scrollBarColor: Color = Color.Pink + @State scrollBar: BarState= BarState.On + private value1: Array = [1, 2, 3, 4, 5, 6, 7, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30] + @State edge: Edge= Edge.Top + private content: string = "Scroll Page"; + scroller: Scroller = new Scroller(); + + onPageShow() { + console.info('Button page show called'); + } + + onBuildDone() { + console.info('Button page build done called'); + } + + build() { + + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Text(`${this.content}`) + .fontSize(50) + .fontWeight(FontWeight.Bold) + Scroll(this.scroller) { + Column() { + ForEach( + this.value1, + item => { + Text(`${item}`) + .fontSize(15) + .width(400) + .margin(10) + .height(70) + .backgroundColor(0xfff5deb3) + }, + item => item + ) + } + } + .scrollable(ScrollDirection.Vertical) + .scrollBar(this.scrollBar) + .scrollBarColor(this.scrollBarColor) + .scrollBarWidth(this.scrollBarWidth) + .key('scroll') + .width(400) + .height(200) + .onScroll((xOffset: number, yOffset: number) => { + console.info(` current offset is ${xOffset} ${yOffset}`) + }) + .onScrollEnd(() => { + console.info(` now on scroll end`) + }) + .onScrollEdge((side: Edge) => { + console.info(`To the edge`) + }) + Scroll() { + Row() { + Text('scroll uppppp') + .width(60) + .height(100) + .backgroundColor(Color.Yellow) + .margin({ + right: 5, + left: 5 + }) + .key('text') + + Text('scroll to') + .width(60) + .height(100) + .backgroundColor(Color.Green) + .margin({ + right: 5, + left: 5 + }) + .onClick(() => { + this.scroller.scrollTo({ + xOffset: 100, + yOffset: 100, + }) + }) + Text('scroll page') + .width(60) + .height(100) + .backgroundColor(Color.Blue) + .margin({ + right: 5, + left: 5 + }) + .onClick(() => { + this.scroller.scrollPage({ + next: true + }) + }) + Text('scroll Edge') + .width(60) + .height(100) + .backgroundColor(Color.Blue) + .margin({ + right: 5, + left: 5 + }) + .onClick(() => { + this.scroller.scrollEdge(Edge.Top) + }) + Text('scroll Edge') + .width(60) + .height(100) + .backgroundColor(Color.Blue) + .margin({ + right: 5, + left: 5 + }) + .onClick(() => { + this.scroller.currentOffset() + }) + Text('scroll to index') + .width(60) + .height(100) + .backgroundColor(Color.Blue) + .margin({ + right: 5, + left: 5 + }) + .onClick(() => { + this.scroller.scrollToIndex(0) + console.info(` now on scroll end`) + }) + } + } + .key('scroll1') + .height(100) + .scrollable(ScrollDirection.Horizontal) + + Scroll() { + Column() { + Text("start").fontSize(30) + Text("scrollable1") + Text("scrollable2") + Text("scrollable3") + Text("scrollable4") + Text("scrollable1") + Text("scrollable2") + Text("scrollable3") + Text("scrollable4") + } + } + .padding(10) + .scrollable(ScrollDirection.None) + .scrollBar(BarState.Off) + .scrollBarColor(Color.Red) + .scrollBarWidth(5) + .width(300) + .height(200) + .key('scroll2') + + Scroll() { + Column() { + Text("start").fontSize(30) + Text("scrollable1") + Text("scrollable2") + Text("scrollable3") + Text("scrollable4") + Text("scrollable1") + Text("scrollable2") + Text("scrollable3") + Text("scrollable4") + } + } + .padding(10) + .scrollable(ScrollDirection.Free) + .scrollBar(BarState.Off) + .scrollBarColor(Color.Red) + .scrollBarWidth(5) + .width(300) + .height(200) + .key('scroll3') + } + .key('flex') + + } +} diff --git a/telephony/telephonyjstest/contact_function_merge/entry/src/main/ets/MainAbility/pages/Slider.ets b/telephony/telephonyjstest/contact_function_merge/entry/src/main/ets/MainAbility/pages/Slider.ets new file mode 100644 index 000000000..625cd0287 --- /dev/null +++ b/telephony/telephonyjstest/contact_function_merge/entry/src/main/ets/MainAbility/pages/Slider.ets @@ -0,0 +1,82 @@ +/* + * 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. + */ + +@Entry +@Component +struct slider { + @State inSetValue: number= 40 + @State outSetValue: number= 40 + @State direction: Axis= Axis.Horizontal + @State Begin: number = SliderChangeMode.Begin + + onPageShow() { + console.info('Slider page show called'); + } + + onBuildDone() { + console.info('Slider page build done called'); + } + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Column() { + Text(`Slider page`) + .fontSize(50) + .fontWeight(FontWeight.Bold) + Slider({ + value: this.outSetValue, + min: 0, + max: 100, + step: 1, + direction: Axis.Horizontal, + reverse: false, + style: SliderStyle.OutSet + }) + .blockColor('#FFFF0000') + .selectedColor('#FF0000FF') + .trackColor('#FF808080') + .minLabel('10') + .maxLabel('10') + .showTips(false) + .showSteps(false) + .onChange((value: number, mode: SliderChangeMode) => { + this.outSetValue = value + this.Begin = mode + console.info('value: ' + value + '---mode: ' + mode) + }) + .width("100") + .height("100") + .key('slider1') + Slider({ + value: 40, + min: 0, + max: 100, + step: 1, + style: SliderStyle.InSet + }) + .blockColor(Color.Red) + .selectedColor(Color.Blue) + .trackColor(Color.Gray) + .showTips(true) + .showSteps(true) + .key('slider2') + }.width(300) + .height(300) + .borderColor(Color.Pink) + .borderWidth(2) + } + } +} + diff --git a/telephony/telephonyjstest/contact_function_merge/entry/src/main/ets/MainAbility/pages/Span.ets b/telephony/telephonyjstest/contact_function_merge/entry/src/main/ets/MainAbility/pages/Span.ets new file mode 100644 index 000000000..df5a71043 --- /dev/null +++ b/telephony/telephonyjstest/contact_function_merge/entry/src/main/ets/MainAbility/pages/Span.ets @@ -0,0 +1,64 @@ +/* + * 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. + */ + +@Entry +@Component +struct span_textcase { + + onPageShow() { + console.info('Span page show called'); + } + + onBuildDone() { + console.info('Span page build done called'); + } + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Column() { + Text() { + Span('Test Span demo') + .decoration({ type: TextDecorationType.LineThrough, "color": Color.Red }) + .textCase(TextCase.UpperCase) + .fontColor(Color.Blue) + .fontSize("20fp") + .letterSpacing(5) + .fontFamily("sans-serif") + .fontWeight(FontWeight.Bold) + .fontStyle(FontStyle.Italic) + .key('span1') + Span('The second test Span demo') + .textCase(TextCase.LowerCase) + .fontColor(Color.Black) + .letterSpacing('5') + .fontSize(30) + .key('span2') + Span('The third test Span demo') + .textCase(TextCase.Normal) + .fontColor(Color.Yellow) + .fontSize("30fp") + .key('span3') + } + } + .width(300) + .height(300) + .borderColor(Color.Pink) + .borderWidth(4) + } + } +} + + + diff --git a/telephony/telephonyjstest/contact_function_merge/entry/src/main/ets/MainAbility/pages/Stack.ets b/telephony/telephonyjstest/contact_function_merge/entry/src/main/ets/MainAbility/pages/Stack.ets new file mode 100644 index 000000000..2a694889f --- /dev/null +++ b/telephony/telephonyjstest/contact_function_merge/entry/src/main/ets/MainAbility/pages/Stack.ets @@ -0,0 +1,103 @@ +/* + * 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 router from '@system.router' + +@Entry +@Component +struct stack_testcase { + @State alignContent: Alignment = Alignment.Bottom + private content: string = "Stack Page"; + + onPageShow() { + console.info('Stack page show called'); + } + + onBuildDone() { + console.info('Stack page build done called'); + } + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Text(`${this.content}`) + .fontSize(50) + .fontWeight(FontWeight.Bold) + Stack({ alignContent: this.alignContent }) { + Text('First child, show in bottom').width('90%').height('100%').backgroundColor(0xd2cab3).align(Alignment.Top) + Text('Second child, show in top').width('70%').height('60%').backgroundColor(0xc1cbac).align(Alignment.Top) + } + .width('100%') + .height(80) + .margin({ top: 5 }) + .key('stack') + .onClick(() => { + router.back() + }) + + Stack({ alignContent: Alignment.BottomStart }) { + Text('First child, show in bottom').width('90%').height('100%').backgroundColor(0xd2cab3).align(Alignment.Top) + Text('Second child, show in top').width('70%').height('60%').backgroundColor(0xc1cbac).align(Alignment.Top) + }.width('100%').height(80).margin({ top: 5 }) + .key('stack1') + + Stack({ alignContent: Alignment.BottomEnd }) { + Text('First child, show in bottom').width('90%').height('100%').backgroundColor(0xd2cab3).align(Alignment.Top) + Text('Second child, show in top').width('70%').height('60%').backgroundColor(0xc1cbac).align(Alignment.Top) + }.width('100%').height(80).margin({ top: 5 }) + .key('stack2') + + Stack({ alignContent: Alignment.Start }) { + Text('First child, show in bottom').width('90%').height('100%').backgroundColor(0xd2cab3).align(Alignment.Top) + Text('Second child, show in top').width('70%').height('60%').backgroundColor(0xc1cbac).align(Alignment.Top) + }.width('100%').height(80).margin({ top: 5 }) + .key('stack3') + + Stack({ alignContent: Alignment.Center }) { + Text('First child, show in bottom').width('90%').height('100%').backgroundColor(0xd2cab3).align(Alignment.Top) + Text('Second child, show in top').width('70%').height('60%').backgroundColor(0xc1cbac).align(Alignment.Top) + }.width('100%').height(80).margin({ top: 5 }) + .key('stack4') + + Stack({ alignContent: Alignment.End }) { + Text('First child, show in bottom').width('90%').height('100%').backgroundColor(0xd2cab3).align(Alignment.Top) + Text('Second child, show in top').width('70%').height('60%').backgroundColor(0xc1cbac).align(Alignment.Top) + }.width('100%').height(80).margin({ top: 5 }) + .key('stack5') + + Stack({ alignContent: Alignment.Top }) { + Text('First child, show in bottom').width('90%').height('100%').backgroundColor(0xd2cab3).align(Alignment.Top) + Text('Second child, show in top').width('70%').height('60%').backgroundColor(0xc1cbac).align(Alignment.Top) + }.width('100%').height(60).margin({ top: 5 }) + .key('stack6') + + Stack({ alignContent: Alignment.TopStart }) { + Text('First child, show in bottom').width('90%').height('100%').backgroundColor(0xd2cab3).align(Alignment.Top) + Text('Second child, show in top').width('70%').height('60%').backgroundColor(0xc1cbac).align(Alignment.Top) + }.width('100%').height(60).margin({ top: 5 }) + .key('stack7') + + Stack({ alignContent: Alignment.TopEnd }) { + Text('First child, show in bottom').width('90%').height('100%').backgroundColor(0xd2cab3).align(Alignment.Top) + Text('Second child, show in top').width('70%').height('60%').backgroundColor(0xc1cbac).align(Alignment.Top) + }.width('100%').height(60).margin({ top: 5 }) + .key('stack8') + } + .key('flex') + .width('100%') + .height('100%') + + } +} + diff --git a/telephony/telephonyjstest/contact_function_merge/entry/src/main/ets/MainAbility/pages/Text.ets b/telephony/telephonyjstest/contact_function_merge/entry/src/main/ets/MainAbility/pages/Text.ets new file mode 100644 index 000000000..fbd1415dc --- /dev/null +++ b/telephony/telephonyjstest/contact_function_merge/entry/src/main/ets/MainAbility/pages/Text.ets @@ -0,0 +1,237 @@ +/* + * 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. + */ + +// @ts-nocheck +import router from '@system.router' + +var paramInfo = router.getParams() +console.info("cd paramInfo" + JSON.stringify(paramInfo)) + +@Entry +@Component +struct text_textcase { + @State textAlign: TextAlign= TextAlign.End + @State lineHeight: string= '15fp' + @State overflow: TextOverflow = TextOverflow.Ellipsis + @State textOverflow: textOverflow<{ "overflow": TextOverflow }> = { "overflow": this.overflow } + @State maxLines: number = 2 + @State baselineOffset: number = 0 + @State textCase: TextCase= TextCase.Normal + @State decoration: decoration<{ + type: TextDecorationType, + color: Color + }> = { type: TextDecorationType.Underline, color: Color.Red } + @State color: Color = Color.Red + @State width: string= "200" + @State height: string= "100" + @State size: size = { width: 200, height: 100 } + @State marginBottom: string = "10px" + @State marginTop: string = "10px" + @State marginLeft: string = "10px" + @State marginRingt: string= "10px" + @State paddingBottom: string= "5" + @State paddingTop: string= "5" + @State paddingLeft: string= "5" + @State paddingRingt: string= "5" + @State constraintSize: constraintSize = { minWidth: 20, maxWidth: 200, minHeight: 0, maxHeight: 50 } + @State layoutPriority: string= "9px" + @State layoutWeight: string = "10px" + @State align: Alignment = Alignment.Center + @State direction: Direction = Direction.Auto + @State position: position<{ + x: string, + y: string + }> = { x: "50", y: "50" } + @State markAnchor: markAnchor<{ + x: string, + y: string + }> = { x: "50", y: "50" } + @State offset: offset<{ + x: string, + y: string + }> = { x: "50", y: "50" } + @State flexGrow: number = 5 + @State flexShrink: number = 2 + @State flexBasis: number = 0 + @State alignSelf: ItemAlign = ItemAlign.Auto + @State borderStyle: BorderStyle = BorderStyle.Dashed + @State borderRadius: number = 10 + @State borderWidth: string= "4px" + @State borderColor: Color= Color.Blue + @State backgroundColor: Color = Color.Pink + @State backgroundImageSize: ImageSize = ImageSize.Cover + @State backgroundImagePosition: Alignment= Alignment.Center + @State opacity: number= 1 + @State visibility: Visibility= Visibility.Visible + @State enabled: boolean = false + @State zIndex: number = 1 + @State fontStyle: FontStyle = FontStyle.Italic + @State fontSize: number = 15 + @State minFontSize: number = 15 + @State maxFontSize: number = 15 + @State letterSpacing: number= 10 + @State fontWeight: FontWeight= FontWeight.Bold + @State fontColor: Color= Color.Black + @State active: boolean = false + private content: string = "Text Page"; + + onPageShow() { + console.info('Text page show called'); + } + + onBuildDone() { + console.info('Text page build done called'); + } + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Text(`${this.content}`) + .fontSize(50) + .fontWeight(FontWeight.Bold) + Text('Text Anto test,Text Anto test,Text Anto test,Text Anto test,test,Text Anto test,Text Anto test,Text Anto test,Text Anto test,Text Anto test,Text Anto test') + .width(this.width) + .height(this.height) + .padding({ bottom: this.paddingBottom, top: this.paddingTop, right: this.paddingRingt, left: this.paddingLeft }) + .margin({ bottom: this.marginBottom, top: this.marginTop, right: this.marginRingt, left: this.marginLeft }) + .constraintSize(this.constraintSize) + .layoutWeight(this.layoutWeight) + .align(this.align) + .direction(this.direction) + .position(this.position) + .markAnchor(this.markAnchor) + .offset(this.offset) + .flexBasis(this.flexBasis) + .flexGrow(this.flexGrow) + .flexShrink(this.flexShrink) + .alignSelf(this.alignSelf) + .borderStyle(this.borderStyle) + .borderRadius(this.borderRadius) + .borderWidth(this.borderWidth) + .borderColor(this.borderColor) + .backgroundColor(this.backgroundColor) + .opacity(this.opacity) + .visibility(this.visibility) + .enabled(this.enabled) + .zIndex(this.zIndex) + .fontColor(this.fontColor) + .fontSize(this.fontSize) + .minFontSize(this.minFontSize) + .letterSpacing(this.letterSpacing) + .maxFontSize(this.maxFontSize) + .fontWeight(this.fontWeight) + .fontStyle(this.fontStyle) + .fontFamily("sans-serif") + .textAlign(this.textAlign) + .textOverflow(this.textOverflow) + .lineHeight(this.lineHeight) + .baselineOffset(this.baselineOffset) + .maxLines(2) + .textCase(this.textCase) + .decoration(this.decoration) + .aspectRatio(1) + .fontColor(Color.Black) + .key('Text') + Text('Text Anto test,Text Anto test,Text Anto test,Text Anto test,Text Anto test,Text Anto test,Text Anto test,Text Anto test') + .size({ width: 100, height: 50 }) + .padding({ bottom: 5, top: 5, right: 5, left: 10 }) + .margin({ bottom: 15, top: 10, right: 10, left: 10 }) + .fontSize('13') + .textAlign(TextAlign.Start) + .align(Alignment.Start) + .direction(Direction.Ltr) + .alignSelf(ItemAlign.Start) + .borderStyle(BorderStyle.Dotted) + .borderWidth(2) + .visibility(Visibility.Hidden) + .enabled(true) + .fontWeight(FontWeight.Normal) + .textAlign(TextAlign.Start) + .textOverflow(TextOverflow.Clip) + .maxLines(2) + .textCase(TextCase.LowerCase) + .decoration({ "type": TextDecorationType.LineThrough, "color": Color.Red }) + .fontColor(Color.White) + .key('Text1') + Text('Text Anto test,Text Anto test,Text Anto test,Text Anto test,Text Anto test,Text Anto test,Text Anto test,Text Anto test,Text Anto test') + .fontSize(13) + .width('100%') + .textAlign(TextAlign.Center) + .align(Alignment.TopEnd) + .direction(Direction.Rtl) + .alignSelf(ItemAlign.Center) + .borderStyle(BorderStyle.Solid) + .borderWidth(2) + .visibility(Visibility.None) + .fontWeight(FontWeight.Bolder) + .textAlign(TextAlign.Center) + .textOverflow(TextOverflow.None) + .textCase(TextCase.UpperCase) + .decoration({ "type": TextDecorationType.None, "color": Color.Red }) + .fontColor(Color.Blue) + .key('Text2') + Text('Text Anto test,Text Anto test,Text Anto test,Text Anto test') + .fontSize(13) + .align(Alignment.Top) + .alignSelf(ItemAlign.End) + .borderWidth(2) + .width('100%') + .fontWeight(FontWeight.Lighter) + .decoration({ type: TextDecorationType.Overline, color: Color.Red }) + .fontColor(Color.Gray) + .key('Text3') + Text('Text Anto test,Text Anto test') + .fontSize(13) + .align(Alignment.TopStart) + .alignSelf(ItemAlign.Baseline) + .borderWidth(2) + .width('100%') + .fontWeight(FontWeight.Medium) + .fontColor(Color.Brown) + .key('Text4') + Text('Text Anto test,Text Anto test,Text Anto test') + .fontSize(13) + .align(Alignment.End) + .alignSelf(ItemAlign.Stretch) + .borderWidth(2) + .width('100%') + .fontWeight(FontWeight.Regular) + .fontColor(Color.Grey) + .key('Text5') + Text('Text Anto test,Text Anto test,Text Anto test') + .fontSize(13) + .align(Alignment.BottomEnd) + .width('100%') + .fontColor(Color.Orange) + .key('Text6') + Text('Text Anto test,Text Anto test,Text Anto test') + .fontSize(13) + .align(Alignment.Bottom) + .width('100%') + .fontColor(Color.Yellow) + .key('Text7') + Text('Text Anto test,Text Anto test,Text Anto test') + .fontSize(13) + .align(Alignment.BottomStart) + .width('100%') + .key('Text8') + + } + .key('flex') + .width('100%') + .height('100%') + } +} + + diff --git a/telephony/telephonyjstest/contact_function_merge/entry/src/main/ets/MainAbility/pages/index.ets b/telephony/telephonyjstest/contact_function_merge/entry/src/main/ets/MainAbility/pages/index.ets new file mode 100644 index 000000000..10359134d --- /dev/null +++ b/telephony/telephonyjstest/contact_function_merge/entry/src/main/ets/MainAbility/pages/index.ets @@ -0,0 +1,65 @@ +// @ts-nocheck +/** + * 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 file from '@system.file'; + +import {Core, ExpectExtend, InstrumentLog, ReportExtend} from "deccjsunit/index.ets"; +import testsuite from "../test/List.test.ets"; +import featureAbility from "@ohos.ability.featureAbility"; + +@Entry +@Component +struct MyComponent { + aboutToAppear() { + console.info("start run testcase!!!!") + featureAbility.getWant() + .then((Want) => { + const core = Core.getInstance(); + const expectExtend = new ExpectExtend({ + 'id': 'extend' + }); + core.addService('expect', expectExtend); + const reportExtend = new ReportExtend(file); + core.addService('report', reportExtend); + core.init(); + core.subscribeEvent('task', reportExtend); + const configService = core.getDefaultService('config'); + Want.parameters['timeout'] = 100000 + console.info('parameters---->' + JSON.stringify(Want.parameters)); + configService.setConfig(Want.parameters); + testsuite(); + core.execute(); + console.info('Operation successful. Data: ' + JSON.stringify(Want)); + }) + .catch((error) => { + console.error('Operation failed. Cause: ' + JSON.stringify(error)); + }) + } + + build() { + Flex({ + direction: FlexDirection.Column, + alignItems: ItemAlign.Center, + justifyContent: FlexAlign.Center + }) { + Text('ACE ETS TEST') + .fontSize(50) + .fontWeight(FontWeight.Bold) + } + .width('100%') + .height('100%') + } +} + diff --git a/telephony/telephonyjstest/contact_function_merge/entry/src/main/ets/MainAbility/test/List.test.ets b/telephony/telephonyjstest/contact_function_merge/entry/src/main/ets/MainAbility/test/List.test.ets new file mode 100644 index 000000000..33a58e6a8 --- /dev/null +++ b/telephony/telephonyjstest/contact_function_merge/entry/src/main/ets/MainAbility/test/List.test.ets @@ -0,0 +1,22 @@ +/** + * 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. + */ + +//contact import +import ContactMergeTest from './contact/ContactMerge_test.js' + +export default function testsuite() { + //contact + ContactMergeTest(); +} \ No newline at end of file diff --git a/telephony/telephonyjstest/contact_function_merge/entry/src/main/ets/MainAbility/test/Utils.ets b/telephony/telephonyjstest/contact_function_merge/entry/src/main/ets/MainAbility/test/Utils.ets new file mode 100644 index 000000000..65f70088d --- /dev/null +++ b/telephony/telephonyjstest/contact_function_merge/entry/src/main/ets/MainAbility/test/Utils.ets @@ -0,0 +1,119 @@ +// @ts-nocheck +/** + * 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 class Utils { + static rect_left; + static rect_top; + static rect_right; + static rect_bottom; + static rect_value; + static notCheck = true; + + static sleep(time) { + return new Promise((resolve, reject) => { + setTimeout(() => { + resolve() + }, time) + }).then(() => { + console.info(`sleep ${time} over...`) + }) + } + + static getComponentRect(key) { + let strJson = getInspectorByKey(key); + let obj = JSON.parse(strJson); + console.info("[getInspectorByKey] current component obj is: " + JSON.stringify(obj)); + let rectInfo = JSON.parse('[' + obj.$rect + ']') + console.info("[getInspectorByKey] rectInfo is: " + rectInfo); + this.rect_left = JSON.parse('[' + rectInfo[0] + ']')[0] + this.rect_top = JSON.parse('[' + rectInfo[0] + ']')[1] + this.rect_right = JSON.parse('[' + rectInfo[1] + ']')[0] + this.rect_bottom = JSON.parse('[' + rectInfo[1] + ']')[1] + return this.rect_value = { + "left": this.rect_left, "top": this.rect_top, "right": this.rect_right, "bottom": this.rect_bottom + } + } + + static async swipe(downX, downY, upX, upY, steps) { + console.info('start to swipe') + this.drags(downX, downY, upX, upY, steps, false) + } + + static async drag(downX, downY, upX, upY, steps) { + console.info('start to drag') + this.drags(downX, downY, upX, upY, steps, true) + } + + static async drags(downX, downY, upX, upY, steps, drag) { + var xStep; + var yStep; + var swipeSteps; + var ret; + xStep = 0; + yStep = 0; + ret = false; + swipeSteps = steps; + if (swipeSteps == 0) { + swipeSteps = 1; + } + xStep = (upX - downX) / swipeSteps; + yStep = (upY - downY) / swipeSteps; + console.info('move step is: ' + 'xStep: ' + xStep + ' yStep: ' + yStep) + var downPonit: TouchObject = { + id: 1, + x: downX, + y: downY, + type: TouchType.Down, + } + console.info('down touch started: ' + JSON.stringify(downPonit)) + sendTouchEvent(downPonit); + console.info('start to move') + if (drag) { + await this.sleep(500) + } + for (var i = 1;i <= swipeSteps; i++) { + var movePoint: TouchObject = { + id: 1, + x: downX + (xStep * i), + y: downY + (yStep * i), + type: TouchType.Move + } + console.info('move touch started: ' + JSON.stringify(movePoint)) + ret = sendTouchEvent(movePoint) + if (ret == false) { + break; + } + await this.sleep(5) + } + console.info('start to up') + if (drag) { + await this.sleep(100) + } + var upPoint: TouchObject = { + id: 1, + x: upX, + y: upY, + type: TouchType.Up, + } + console.info('up touch started: ' + JSON.stringify(upPoint)) + sendTouchEvent(upPoint) + await this.sleep(500) + } +} + + + + diff --git a/telephony/telephonyjstest/contact_function_merge/entry/src/main/ets/MainAbility/test/contact/ContactMerge_test.js b/telephony/telephonyjstest/contact_function_merge/entry/src/main/ets/MainAbility/test/contact/ContactMerge_test.js new file mode 100644 index 000000000..76dcd4cc0 --- /dev/null +++ b/telephony/telephonyjstest/contact_function_merge/entry/src/main/ets/MainAbility/test/contact/ContactMerge_test.js @@ -0,0 +1,1873 @@ +/* + * 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 featureAbility from '@ohos.ability.featureAbility'; +import ohosDataAbility from '@ohos.data.dataability'; +import {afterAll, afterEach, beforeAll, beforeEach, describe, expect, it} from 'deccjsunit/index' + +const URI_CONTACTS = "dataability:///com.ohos.contactsdataability"; +const rawContactUri = "dataability:///com.ohos.contactsdataability/contacts/raw_contact"; +const contactDataUri = "dataability:///com.ohos.contactsdataability/contacts/contact_data"; + +const autoMergeUri = "dataability:///com.ohos.contactsdataability/contacts/raw_contact/auto_merge"; +const splitUri = "dataability:///com.ohos.contactsdataability/contacts/raw_contact/split_contact"; +const manualMergeUri = "dataability:///com.ohos.contactsdataability/contacts/raw_contact/manual_merge"; +const uriQueryMergeList = "dataability:///com.ohos.contactsdataability/contacts/raw_contact/query_merge_list"; +const deletedUri = "dataability:///com.ohos.contactsdataability/contacts/deleted_raw_contact"; + +export default function ContactMergeTest() { + describe('ContactMergeTest', function () { + console.info("ContactMergeTest start!"); + + function sleep(numberMillis) { + var now = new Date(); + var exitTime = now.getTime() + numberMillis; + while (true) { + now = new Date(); + if (now.getTime() > exitTime) + return; + } + } + + async function contactDataInsert1(DAHelper, rawContactIdFirst) { + var contactDataValues = { + "raw_contact_id": rawContactIdFirst, "content_type": "name", "detail_info": "xiaoli" + }; + try { + var contactDataId1 = await DAHelper.insert(contactDataUri, contactDataValues); + sleep(1000); + console.info("logMessage contact_auto_merge_and_spilt_test_100: contactDataId1 = " + contactDataId1); + expect(contactDataId1 > 0).assertTrue(); + } catch (error) { + console.info('logMessage contact_auto_merge_and_spilt_test_100: contact_data_1 insert error = ' + error); + } + } + + async function contactDataInsert2(DAHelper, rawContactIdSecond) { + var contactDataValues = { + "raw_contact_id": rawContactIdSecond, "content_type": "name", "detail_info": "xiaoli" + }; + try { + var contactDataId2 = await DAHelper.insert(contactDataUri, contactDataValues); + sleep(1000); + console.info("logMessage contact_auto_merge_and_spilt_test_100: contactDataId2 = " + contactDataId2); + expect(contactDataId2 > 0).assertTrue(); + } catch (error) { + console.info('logMessage contact_auto_merge_and_spilt_test_100: contact_data_2 insert error = ' + error); + } + } + + async function autoMerge(DAHelper, rawContactIdFirst) { + var condition = new ohosDataAbility.DataAbilityPredicates(); + var updateValues = {}; + try { + sleep(4000); + var autoMergeCode = await DAHelper.update(autoMergeUri, updateValues, condition); + console.info("logMessage contact_auto_merge_and_spilt_test_100: autoMergeCode = " + autoMergeCode); + expect(autoMergeCode == 0).assertTrue(); + var map = new Map(); + map.set("id", rawContactIdFirst.toString()); + await contactMergeQuery(map, "contact_auto_merge_and_spilt_test_100", 2); + sleep(2000); + await contactSplit(DAHelper, rawContactIdFirst); + await deleteAll(rawContactUri, "contact_auto_merge_and_spilt_test_100"); + await deleteAll(contactDataUri, "contact_auto_merge_and_spilt_test_100"); + } catch (error) { + console.info("logMessage contact_auto_merge_and_spilt_test_100: auto_merge error = " + error); + } + } + + async function contactSplit(DAHelper, rawContactIdFirst) { + var condition2 = new ohosDataAbility.DataAbilityPredicates(); + var array = [rawContactIdFirst.toString()]; + condition2.in("raw_contact_id", array); + var updateValues2 = {}; + try { + var splitCode = await DAHelper.update(splitUri, updateValues2, condition2); + sleep(4000); + console.info('logMessage contact_auto_merge_and_spilt_test_100 splitCode = ' + splitCode); + expect(splitCode == 0).assertTrue(); + var map = new Map(); + map.set("id", rawContactIdFirst.toString()); + await contactMergeQuery(map, "contact_auto_merge_and_spilt_test_100", 1); + } catch (error) { + console.info('logMessage contact_auto_merge_and_spilt_test_100 split error = ' + error); + } + } + + async function deleteAll(uri, tag) { + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.greaterThan("id", "0"); + var deleteCode = await DAHelper.delete(uri, condition); + console.info(tag + ': deleteAll deleteCode = ' + deleteCode); + expect(deleteCode == 0).assertTrue(); + } + + async function contactMergeQuery(map, tag, size) { + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info(tag + ' : contactMergeQuery start ! DAHelper = ' + DAHelper); + var resultColumns = ["contact_id"]; + var condition = new ohosDataAbility.DataAbilityPredicates(); + console.info(tag + ' : map_id = ' + map.get("id")); + condition.equalTo("id", map.get("id")); + try { + var resultSetID = await DAHelper.query(rawContactUri, resultColumns, condition); + sleep(1000); + var conatctID; + if (resultSetID.goToFirstRow()) { + do { + conatctID = resultSetID.getString(resultSetID.getColumnIndex("contact_id")); + console.info(tag + ' : contact_id = ' + conatctID); + } while (resultSetID.goToNextRow()); + } + resultSetID.close(); + var pre = new ohosDataAbility.DataAbilityPredicates(); + pre.equalTo("contact_id", conatctID); + var newResultColumns = []; + var resultSet = await DAHelper.query(rawContactUri, newResultColumns, pre); + sleep(1000); + console.info(tag + ' : contactMergeQuery start ! rowCount = ' + resultSet.rowCount); + expect(resultSet.rowCount == size).assertEqual(true); + resultSet.close(); + } catch (error) { + console.info(tag + " : logMessage contactMergeQuery: error = " + error); + } + } + + async function updateContactData(updateDataValue, contactDataId, testName) { + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + var updateValues = { + "detail_info": updateDataValue + }; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("id", contactDataId.toString()); + var code = await DAHelper.update(contactDataUri, updateValues, condition); + console.info(testName + " updateContactData: code = " + code); + sleep(3000); + } + + async function insertContactData(DAHelper, rawContactId, detailInfo, types, tag) { + var size = detailInfo.length; + for (var i = 0; i < size; i++) { + var contactDataValues = { + "raw_contact_id": rawContactId.toString(), + "content_type": types[i], + "detail_info": detailInfo[i] + }; + try { + var contactDataId = await DAHelper.insert(contactDataUri, contactDataValues); + sleep(2000); + expect(contactDataId > 0).assertTrue(); + console.info(tag + ' logMessage : insert contactDataId = ' + contactDataId); + } catch (error) { + console.info('logMessage : contact_data_1 insert error = ' + error); + } + } + } + + async function insertContactDataSingle(DAHelper, rawContactId, detailInfo, type) { + var size = detailInfo.length; + var contactDataValues = { + "raw_contact_id": rawContactId, "content_type": type, "detail_info": detailInfo + }; + try { + var contactDataId1 = await DAHelper.insert(contactDataUri, contactDataValues); + sleep(1000); + expect(contactDataId1 > 0).assertTrue(); + } catch (error) { + console.info('logMessage : contact_data_1 insert error = ' + error); + } + return contactDataId1; + } + + async function manualMergeList(DAHelper, rawContactList, testName) { + var condition2 = new ohosDataAbility.DataAbilityPredicates(); + condition2.in("raw_contact_id", rawContactList); + var updateValues2 = {}; + try { + var ManualMergeCode = await DAHelper.update(manualMergeUri, updateValues2, condition2); + sleep(1000); + console.info("logMessage " + testName + " ManualMergeCode = " + ManualMergeCode); + expect(ManualMergeCode == 0).assertTrue(); + var map = new Map(); + map.set("id", rawContactList[0].toString()); + await contactMergeQuery(map, testName, rawContactList.length); + await deleteAll(rawContactUri, testName); + await deleteAll(contactDataUri, testName); + } catch (error) { + console.info("logMessage " + testName + " manual_merge error = " + error); + } + } + + /** + * @tc.number contact_autoMerge_and_spilt_test_100 + * @tc.name Two contacts without mobile phone number with the same name are automatically merged and split + * @tc.desc Function test + */ + it("contact_autoMerge_and_spilt_test_100", 0, async function (done) { + console.info("------logMessage contact_auto_merge_and_spilt_test_100 is starting!-----"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + var insertRawContactValues1 = { + "display_name": "xiaoli" + }; + try { + var rawContactIdFirst = await DAHelper.insert(rawContactUri, insertRawContactValues1); + sleep(1000); + console.info("logMessage contact_auto_merge_and_spilt_test_100: rawContactIdFirst = " + rawContactIdFirst); + expect(rawContactIdFirst > 0).assertTrue(); + await contactDataInsert1(DAHelper, rawContactIdFirst); + } catch (error) { + console.info('logMessage contact_auto_merge_and_spilt_test_100: raw_contact_1 insert error = ' + error); + done(); + } + + var insertRawContactValues2 = { + "display_name": "xiaoli" + }; + try { + var rawContactIdSecond = await DAHelper.insert(rawContactUri, insertRawContactValues2); + sleep(1000); + console.info("logMessage contact_auto_merge_and_spilt_test_100: rawContactIdSecond = " + rawContactIdSecond); + expect(rawContactIdSecond > 0).assertTrue(); + await contactDataInsert2(DAHelper, rawContactIdSecond); + } catch (error) { + console.info('logMessage contact_auto_merge_and_spilt_test_100: raw_contact_2 insert error = ' + error); + done(); + } + + await autoMerge(DAHelper, rawContactIdFirst); + done(); + }); + + /** + * @tc.number contact_manualMerge_test_200 + * @tc.name Two contacts with the same name, one with a mobile phone number and the other without a mobile phone + * number, call the manual merge interface + * @tc.desc Function test + */ + it("contact_manualMerge_test_200", 0, async function (done) { + console.info("------logMessage contact_manualMerge_test_200 is starting!-----"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + var insertRawContactValues1 = { + "display_name": "xiaoming" + }; + try { + var rawContactIdFirst = await DAHelper.insert(rawContactUri, insertRawContactValues1); + sleep(1000); + console.info("logMessage contact_manualMerge_test_200: rawContactIdFirst = " + rawContactIdFirst); + expect(rawContactIdFirst > 0).assertTrue(); + await manualMergeDataInsert(DAHelper, rawContactIdFirst); + } catch (error) { + console.info('logMessage contact_manualMerge_test_200: raw_contact_1 insert error = ' + error); + done(); + } + + var insertRawContactValues2 = { + "display_name": "xiaoming" + }; + try { + var rawContactIdSecond = await DAHelper.insert(rawContactUri, insertRawContactValues2); + sleep(1000); + console.info("logMessage contact_manualMerge_test_200: rawContactIdSecond = " + rawContactIdSecond); + expect(rawContactIdSecond > 0).assertTrue(); + await manualMergeDataInsertTwo(DAHelper, rawContactIdSecond); + } catch (error) { + console.info('logMessage contact_manualMerge_test_200: raw_contact_2 insert error = ' + error); + done(); + } + var rawContactIds = [rawContactIdFirst + "", rawContactIdSecond + ""]; + await manualMergeList(DAHelper, rawContactIds, "contact_query_merge_list_test_2000"); + done(); + }); + + async function manualMergeDataInsert(DAHelper, rawContactIdFirst) { + var contactDataValuesOne = { + "raw_contact_id": rawContactIdFirst, + "content_type": "name", + "detail_info": "xiaoming" + }; + var contactDataValuesTwo = { + "raw_contact_id": rawContactIdFirst, + "content_type": "phone", + "detail_info": "123456789", + }; + var listAddBluk = []; + listAddBluk[0] = contactDataValuesOne; + listAddBluk[1] = contactDataValuesTwo; + try { + var batchInsertCode = await DAHelper.batchInsert(contactDataUri, listAddBluk); + sleep(1000); + console.info("logMessage contact_manualMerge_test_200: batchInsertCode = " + batchInsertCode); + expect(batchInsertCode == 0).assertTrue(); + } catch (error) { + console.info("logMessage contact_manualMerge_test_200: batch insert error = " + error) + } + } + + async function manualMergeDataInsertTwo(DAHelper, rawContactIdSecond) { + var contactDataValues = { + "raw_contact_id": rawContactIdSecond, "content_type": "name", "detail_info": "xiaoming" + }; + try { + var contactDataId = await DAHelper.insert(contactDataUri, contactDataValues); + sleep(1000); + console.info("logMessage contact_manualMerge_test_200: contactDataId = " + contactDataId); + expect(contactDataId > 0).assertTrue(); + } catch (error) { + console.info("logMessage contact_manualMerge_test_200: contact_data_2 insert error = " + error) + } + } + + /** + * @tc.number contact_autoMerge_test_300 + * @tc.name Two contacts with the same name have a mobile phone number, and the mobile phone numbers are the + * same. Call the automatic merge interface + * @tc.desc Function test + */ + it("contact_autoMerge_test_300", 0, async function (done) { + console.info("------logMessage contact_autoMerge_test_300 is starting!-----"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + var insertRawContactValues1 = { + "display_name": "xiaohong" + }; + try { + var rawContactIdFirst = await DAHelper.insert(rawContactUri, insertRawContactValues1); + sleep(1000); + console.info("logMessage contact_autoMerge_test_300: rawContactIdFirst = " + rawContactIdFirst); + expect(rawContactIdFirst > 0).assertTrue(); + await autoMergeDataInsert(DAHelper, rawContactIdFirst); + } catch (error) { + console.info('logMessage contact_autoMerge_test_300: raw_contact_1 insert error = ' + error); + done(); + } + + var insertRawContactValues2 = { + "display_name": "xiaohong" + }; + try { + var rawContactIdSecond = await DAHelper.insert(rawContactUri, insertRawContactValues2); + sleep(1000); + console.info("logMessage contact_autoMerge_test_300: rawContactIdSecond = " + rawContactIdSecond); + expect(rawContactIdSecond > 0).assertTrue(); + await autoMergeDataInsertTwo(DAHelper, rawContactIdSecond); + } catch (error) { + console.info('logMessage contact_autoMerge_test_300: raw_contact_2 insert error = ' + error); + done(); + } + + await autoMerger(DAHelper, rawContactIdFirst, "contact_autoMerge_test_300"); + done(); + }); + + async function autoMergeDataInsert(DAHelper, rawContactIdFirst) { + var contactDataValuesOne = { + "raw_contact_id": rawContactIdFirst, + "content_type": "name", + "detail_info": "xiaohong" + }; + var contactDataValuesTwo = { + "raw_contact_id": rawContactIdFirst, + "content_type": "phone", + "detail_info": "123465", + }; + var listAddBluk = []; + listAddBluk[0] = contactDataValuesOne; + listAddBluk[1] = contactDataValuesTwo; + try { + var batchInsertCode = await DAHelper.batchInsert(contactDataUri, listAddBluk); + sleep(1000); + console.info("logMessage contact_autoMerge_test_300: batchInsertCode = " + batchInsertCode); + expect(batchInsertCode == 0).assertTrue(); + } catch (error) { + console.info("logMessage contact_autoMerge_test_300: batch insert1 error = " + error) + } + } + + async function autoMergeDataInsertTwo(DAHelper, rawContactIdSecond) { + var contactDataValuesThree = { + "raw_contact_id": rawContactIdSecond, + "content_type": "name", + "detail_info": "xiaohong" + }; + var contactDataValuesFour = { + "raw_contact_id": rawContactIdSecond, + "content_type": "phone", + "detail_info": "123465", + }; + var listAddBluk2 = []; + listAddBluk2[0] = contactDataValuesThree; + listAddBluk2[1] = contactDataValuesFour; + try { + var batchInsertCode = await DAHelper.batchInsert(contactDataUri, listAddBluk2); + sleep(1000); + console.info("logMessage contact_autoMerge_test_300: batchInsertCode = " + batchInsertCode); + expect(batchInsertCode == 0).assertTrue(); + } catch (error) { + console.info("logMessage contact_autoMerge_test_300: batch insert2 error = " + error) + } + } + + async function autoMerger(DAHelper, rawContactIdFirst, testName) { + var condition = new ohosDataAbility.DataAbilityPredicates(); + var updateValues = {}; + try { + var autoMergeCode = await DAHelper.update(autoMergeUri, updateValues, condition); + sleep(1000); + console.info("logMessage " + testName + "autoMergeCode = " + autoMergeCode); + expect(autoMergeCode == 0).assertTrue(); + var map = new Map(); + map.set("id", rawContactIdFirst.toString()); + await contactMergeQuery(map, testName, 2); + await deleteAll(rawContactUri, testName); + await deleteAll(contactDataUri, testName); + } catch (error) { + console.info("logMessage " + testName + "auto_merge error =" + error); + } + } + + async function autoNotMerger(DAHelper, rawContactIdFirst, testName) { + var condition = new ohosDataAbility.DataAbilityPredicates(); + var updateValues = {}; + try { + sleep(2000); + var autoMergeCode = await DAHelper.update(autoMergeUri, updateValues, condition); + console.info("logMessage " + testName + "autoMergeCode = " + autoMergeCode); + expect(autoMergeCode == -1).assertTrue(); + var map = new Map(); + map.set("id", rawContactIdFirst.toString()); + await contactMergeQuery(map, testName, 1); + await deleteAll(rawContactUri, testName); + await deleteAll(contactDataUri, testName); + } catch (error) { + console.info("logMessage " + testName + "auto_merge error =" + error); + } + } + + /** + * @tc.number contact_manualMerge_test_400 + * @tc.name Two contacts with the same name have a mobile phone number, and the mobile phone numbers are + * different. Call the manual merge interface + * @tc.desc Function test + */ + it("contact_manualMerge_test_400", 0, async function (done) { + console.info("------logMessage contact_manualMerge_test_400 is starting!-----"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + var insertRawContactValues1 = { + "display_name": "xiaozhang" + }; + try { + var rawContactIdFirst = await DAHelper.insert(rawContactUri, insertRawContactValues1); + sleep(1000); + console.info("logMessage contact_manualMerge_test_400: rawContactIdFirst = " + rawContactIdFirst); + expect(rawContactIdFirst > 0).assertTrue(); + await noequalPhoneDataInsert(DAHelper, rawContactIdFirst) + } catch (error) { + console.info('logMessage contact_manualMerge_test_400: raw_contact_1 insert error = ' + error); + done(); + } + + var insertRawContactValues2 = { + "display_name": "xiaozhang" + }; + try { + var rawContactIdSecond = await DAHelper.insert(rawContactUri, insertRawContactValues2); + sleep(1000); + console.info("logMessage contact_manualMerge_test_400: rawContactIdSecond = " + rawContactIdSecond); + expect(rawContactIdSecond > 0).assertTrue(); + await noequalPhoneDataInsertTwo(DAHelper, rawContactIdSecond) + } catch (error) { + console.info('logMessage contact_manualMerge_test_400: raw_contact_2 insert error = ' + error); + done(); + } + + await noequalManualMerge(DAHelper, rawContactIdFirst, rawContactIdSecond); + done(); + }); + + async function noequalPhoneDataInsert(DAHelper, rawContactIdFirst) { + var contactDataValuesOne = { + "raw_contact_id": rawContactIdFirst, + "content_type": "name", + "detail_info": "xiaozhang" + }; + var contactDataValuesTwo = { + "raw_contact_id": rawContactIdFirst, + "content_type": "phone", + "detail_info": "147852", + }; + var listAddBluk = []; + listAddBluk[0] = contactDataValuesOne; + listAddBluk[1] = contactDataValuesTwo; + try { + var batchInsertCode = await DAHelper.batchInsert(contactDataUri, listAddBluk); + sleep(1000); + console.info("logMessage contact_manualMerge_test_400: batchInsertCode = " + batchInsertCode); + expect(batchInsertCode == 0).assertTrue(); + } catch (error) { + console.info("logMessage contact_manualMerge_test_400: batch insert1 error = " + error) + } + } + + async function noequalPhoneDataInsertTwo(DAHelper, rawContactIdSecond) { + var contactDataValuesThree = { + "raw_contact_id": rawContactIdSecond, + "content_type": "name", + "detail_info": "xiaozhang" + }; + var contactDataValuesFour = { + "raw_contact_id": rawContactIdSecond, + "content_type": "phone", + "detail_info": "996369", + }; + var listAddBluk2 = []; + listAddBluk2[0] = contactDataValuesThree; + listAddBluk2[1] = contactDataValuesFour; + try { + var batchInsertCode = await DAHelper.batchInsert(contactDataUri, listAddBluk2); + sleep(1000); + console.info("logMessage contact_manualMerge_test_400: batchInsertCode = " + batchInsertCode); + expect(batchInsertCode == 0).assertTrue(); + } catch (error) { + console.info("logMessage contact_manualMerge_test_400: batch insert2 error = " + error) + } + } + + async function noequalManualMerge(DAHelper, rawContactIdFirst, rawContactIdSecond) { + var condition2 = new ohosDataAbility.DataAbilityPredicates(); + var id = [rawContactIdFirst.toString(), rawContactIdSecond.toString()]; + condition2.in("raw_contact_id", id); + var updateValues2 = {}; + try { + var ManualMergeCode = await DAHelper.update(manualMergeUri, updateValues2, condition2); + sleep(1000); + console.info("logMessage contact_manualMerge_test_400 ManualMergeCode = " + ManualMergeCode); + expect(ManualMergeCode == 0).assertTrue(); + var map = new Map(); + map.set("id", rawContactIdFirst.toString()); + await contactMergeQuery(map, "contact_manualMerge_test_400", 2); + await deleteAll(rawContactUri, "contact_manualMerge_test_400"); + await deleteAll(contactDataUri, "contact_manualMerge_test_400"); + } catch (error) { + console.info("logMessage contact_manualMerge_test_400 manual_merge error = " + error); + } + } + + /** + * @tc.number contact_manualMerge_test_500 + * @tc.name Two contacts with the same name, one with two mobile phone numbers and the other without mobile phone + * numbers, call the manual merge interface + * @tc.desc Function test + */ + it("contact_manualMerge_test_500", 0, async function (done) { + console.info("------logMessage contact_manualMerge_test_500 is starting!-----"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + var insertRawContactValues1 = { + "display_name": "xiaozhou" + }; + try { + var rawContactIdFirst = await DAHelper.insert(rawContactUri, insertRawContactValues1); + sleep(1000); + console.info("logMessage contact_manualMerge_test_500: rawContactIdFirst = " + rawContactIdFirst); + expect(rawContactIdFirst > 0).assertTrue(); + await manualDataInsert(DAHelper, rawContactIdFirst) + } catch (error) { + console.info('logMessage contact_manualMerge_test_500: raw_contact_1 insert error = ' + error); + done(); + } + + var insertRawContactValues2 = { + "display_name": "xiaozhou" + }; + try { + var rawContactIdSecond = await DAHelper.insert(rawContactUri, insertRawContactValues2); + sleep(1000); + console.info("logMessage contact_manualMerge_test_500: rawContactIdSecond = " + rawContactIdSecond); + expect(rawContactIdSecond > 0).assertTrue(); + await manualDataInsertTwo(DAHelper, rawContactIdSecond) + } catch (error) { + console.info('logMessage contact_manualMerge_test_500: raw_contact_2 insert error = ' + error); + done(); + } + await hasOneNoPhoneManualMerge(DAHelper, rawContactIdFirst, rawContactIdSecond); + done(); + }); + + async function manualDataInsert(DAHelper, rawContactIdFirst) { + var contactDataValuesOne = { + "raw_contact_id": rawContactIdFirst, + "content_type": "name", + "detail_info": "xiaozhou" + }; + var contactDataValuesTwo = { + "raw_contact_id": rawContactIdFirst, + "content_type": "phone", + "detail_info": "123456789", + }; + var contactDataValuesThree = { + "raw_contact_id": rawContactIdFirst, + "content_type": "phone", + "detail_info": "996632", + }; + var listAddBluk = []; + listAddBluk[0] = contactDataValuesOne; + listAddBluk[1] = contactDataValuesTwo; + listAddBluk[2] = contactDataValuesThree; + try { + var batchInsertCode = await DAHelper.batchInsert(contactDataUri, listAddBluk); + sleep(1000); + console.info("logMessage contact_manualMerge_test_500: batchInsertCode = " + batchInsertCode); + expect(batchInsertCode == 0).assertTrue(); + } catch (error) { + console.info("logMessage contact_manualMerge_test_500: batch insert1 error = " + error) + } + } + + async function manualDataInsertTwo(DAHelper, rawContactIdSecond) { + var contactDataValuesFour = { + "raw_contact_id": rawContactIdSecond, + "content_type": "name", + "detail_info": "xiaozhou" + }; + try { + var contactDataId = await DAHelper.insert(contactDataUri, contactDataValuesFour); + sleep(1000); + console.info("logMessage contact_manualMerge_test_500: contactDataId = " + contactDataId); + expect(contactDataId > 0).assertTrue(); + } catch (error) { + console.info("logMessage contact_manualMerge_test_500: contact_data insert error = " + error) + } + } + + async function hasOneNoPhoneManualMerge(DAHelper, rawContactIdFirst, rawContactIdSecond) { + var condition2 = new ohosDataAbility.DataAbilityPredicates(); + var id = [rawContactIdFirst.toString(), rawContactIdSecond.toString()]; + condition2.in("raw_contact_id", id); + var updateValues2 = {}; + try { + var ManualMergeCode = await DAHelper.update(manualMergeUri, updateValues2, condition2); + sleep(1000); + console.info("logMessage contact_manualMerge_test_500 ManualMergeCode = " + ManualMergeCode); + expect(ManualMergeCode == 0).assertTrue(); + var map = new Map(); + map.set("id", rawContactIdFirst.toString()); + await contactMergeQuery(map, "contact_manualMerge_test_500", 2); + await deleteAll(rawContactUri, "contact_manualMerge_test_500"); + await deleteAll(contactDataUri, "contact_manualMerge_test_500"); + } catch (error) { + console.info("logMessage contact_manualMerge_test_500 manual_merge error = " + error); + } + } + + /** + * @tc.number contact_autoMerge_test_600 + * @tc.name Batch add contacts, then call auto merge interface. + * @tc.desc Function test + */ + it("contact_autoMerge_test_600", 0, async function (done) { + console.info("------logMessage contact_autoMerge_test_600 is starting!-----"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + try { + var insertRawContactValues1 = { + "display_name": "xiaoliu" + }; + var rawContactIdFirst = await DAHelper.insert(rawContactUri, insertRawContactValues1); + sleep(1000); + console.info("logMessage contact_autoMerge_test_600: rawContactIdFirst = " + rawContactIdFirst); + expect(rawContactIdFirst > 0).assertTrue(); + } catch (error) { + console.info('logMessage contact_autoMerge_test_600: raw_contact_1 insert error = ' + error); + done(); + } + + try { + var insertRawContactValues2 = { + "display_name": "xiaoliu" + }; + var rawContactIdSecond = await DAHelper.insert(rawContactUri, insertRawContactValues2); + sleep(1000); + console.info("logMessage contact_autoMerge_test_600: rawContactIdSecond = " + rawContactIdSecond); + expect(rawContactIdSecond > 0).assertTrue(); + } catch (error) { + console.info('logMessage contact_autoMerge_test_600: raw_contact_2 insert error = ' + error); + done(); + } + + try { + var insertRawContactValues3 = { + "display_name": "xiaoliu" + }; + var rawContactIdThird = await DAHelper.insert(rawContactUri, insertRawContactValues3); + sleep(1000); + console.info("logMessage contact_autoMerge_test_600: rawContactIdThird = " + rawContactIdThird); + expect(rawContactIdThird > 0).assertTrue(); + } catch (error) { + console.info('logMessage contact_autoMerge_test_600: raw_contact_3 insert error = ' + error); + done(); + } + + await contactDataBatchInsert(); + done(); + }); + + async function contactDataBatchInsert(DAHelper, rawContactIdFirst, rawContactIdSecond, rawContactIdThird) { + var contactDataValues1 = { + "raw_contact_id": rawContactIdFirst, "content_type": "name", "detail_info": "xiaoliu" + }; + var contactDataValues2 = { + "raw_contact_id": rawContactIdSecond, "content_type": "name", "detail_info": "xiaoliu" + }; + var contactDataValues3 = { + "raw_contact_id": rawContactIdThird, "content_type": "name", "detail_info": "xiaoliu" + }; + var listAddBluk = []; + listAddBluk[0] = contactDataValues1; + listAddBluk[1] = contactDataValues2; + listAddBluk[2] = contactDataValues3; + try { + var batchInsertCode = await DAHelper.batchInsert(contactDataUri, listAddBluk); + sleep(2000); + console.info("logMessage contact_autoMerge_test_600: batchInsertCode = " + batchInsertCode); + expect(batchInsertCode == 0).assertTrue(); + await threeAutoMerger(); + await deleteAll(rawContactUri, "contact_autoMerge_test_600"); + await deleteAll(contactDataUri, "contact_autoMerge_test_600"); + } catch (error) { + console.info('logMessage contact_autoMerge_test_600: raw_contact insert error = ' + error); + } + } + + async function threeAutoMerger(DAHelper, rawContactIdFirst) { + var condition = new ohosDataAbility.DataAbilityPredicates(); + var updateValues = {}; + try { + var autoMergeCode = await DAHelper.update(autoMergeUri, updateValues, condition); + sleep(1000); + console.info("logMessage contact_autoMerge_test_600 autoMergeCode = " + autoMergeCode); + expect(autoMergeCode == 0).assertTrue(); + var map = new Map(); + map.set("id", rawContactIdFirst.toString()); + await contactMergeQuery(map, "contact_autoMerge_test_600", 3); + } catch (error) { + console.info("logMessage contact_autoMerge_test_600 auto_merge error = " + error); + } + } + + /** + * @tc.number contact_query_merge_list_test_700 + * @tc.name Query contacts to be merged + * @tc.desc Function test + */ + it("contact_query_merge_list_test_700", 0, async function (done) { + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('before delete_all: start ! DAHelper = ' + DAHelper); + console.info("------logMessage contact_query_merge_list_test_700 is starting!-----"); + var insertRawContactValues1 = { + "display_name": "xiaowu" + }; + try { + var rawContactIdFirst = await DAHelper.insert(rawContactUri, insertRawContactValues1); + sleep(1000); + console.info("logMessage contact_query_merge_list_test_700: rawContactIdFirst = " + rawContactIdFirst); + expect(rawContactIdFirst > 0).assertTrue(); + await queryContactDataInsert(DAHelper, rawContactIdFirst); + } catch (error) { + console.info('logMessage contact_query_merge_list_test_700: raw_contact_1 insert error = ' + error); + done(); + } + + var insertRawContactValues2 = { + "display_name": "xiaowu" + }; + try { + var rawContactIdSecond = await DAHelper.insert(rawContactUri, insertRawContactValues2); + sleep(1000); + console.info("logMessage contact_query_merge_list_test_700: rawContactIdSecond = " + rawContactIdSecond); + expect(rawContactIdSecond > 0).assertTrue(); + await queryContactDataInsertTwo(DAHelper, rawContactIdSecond); + } catch (error) { + console.info('logMessage contact_query_merge_list_test_700: raw_contact_2 insert error = ' + error); + done(); + } + await queryMergeList(DAHelper, rawContactIdFirst, rawContactIdSecond, "contact_query_merge_list_test_700"); + done(); + }); + + async function queryContactDataInsert(DAHelper, rawContactIdFirst) { + var contactDataValues = { + "raw_contact_id": rawContactIdFirst, "content_type": "name", "detail_info": "xiaowu" + }; + try { + var contactDataId1 = await DAHelper.insert(contactDataUri, contactDataValues); + sleep(1000); + console.info("logMessage contact_query_merge_list_test_700: contactDataId1 = " + contactDataId1); + expect(contactDataId1 > 0).assertTrue(); + } catch (error) { + console.info('logMessage contact_query_merge_list_test_700: contact_data_1 insert error = ' + error); + } + } + + async function queryContactDataInsertTwo(DAHelper, rawContactIdSecond) { + var contactDataValuesOne = { + "raw_contact_id": rawContactIdSecond, + "content_type": "name", + "detail_info": "xiaowu" + }; + var contactDataValuesTwo = { + "raw_contact_id": rawContactIdSecond, + "content_type": "phone", + "detail_info": "002563" + }; + var listAddBluk = []; + listAddBluk[0] = contactDataValuesOne; + listAddBluk[1] = contactDataValuesTwo; + try { + var batchInsertCode = await DAHelper.batchInsert(contactDataUri, listAddBluk); + sleep(1000); + console.info("logMessage contact_query_merge_list_test_700: batchInsertCode = " + batchInsertCode); + expect(batchInsertCode == 0).assertTrue(); + } catch (error) { + console.info('logMessage contact_query_merge_list_test_700: contact_data_2 insert error = ' + error); + } + } + + async function queryMergeList(DAHelper, rawContactIdFirst, rawContactIdSecond, testName) { + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + var columns = []; + var predicates = new ohosDataAbility.DataAbilityPredicates(); + try { + sleep(3000); + var resultSet = await DAHelper.query(uriQueryMergeList, columns, predicates); + var array = [rawContactIdFirst, rawContactIdSecond]; + var i = 0; + if (resultSet.rowCount > 0) { + if (resultSet.goToFirstRow()) { + do { + var rawContactId = resultSet.getInt(resultSet.getColumnIndex("raw_contact_id")); + console.info(testName + (array[i] == rawContactId)); + expect(array[i] == rawContactId).assertTrue(); + console.info(testName + rawContactId); + i++; + } while (resultSet.goToNextRow()) + } + } + resultSet.close(); + await deleteAll(rawContactUri, testName); + await deleteAll(contactDataUri, testName); + } catch (error) { + console.info(testName + ": query error = " + error); + } + } + + /** + * @tc.number contact_query_merge_list_test_800 + * @tc.name Insert contacts with the same name and different mobile phone numbers, + * and check whether the database can query contacts that can be merged + * @tc.desc Function test + */ + it("contact_query_merge_list_test_800", 0, async function (done) { + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('before delete_all: start ! DAHelper = ' + DAHelper); + console.info("------logMessage contact_query_merge_list_test_800 is starting!-----"); + var insertRawContactValues1 = { + "display_name": "xiaowuu" + }; + try { + var rawContactIdFirst = await DAHelper.insert(rawContactUri, insertRawContactValues1); + sleep(1000); + console.info("logMessage contact_query_merge_list_test_800: rawContactIdFirst = " + rawContactIdFirst); + expect(rawContactIdFirst > 0).assertTrue(); + var detailInfo = ["xiaowuu", "1854154"]; + var types = ["name", "phone"]; + await insertContactData(DAHelper, rawContactIdFirst, detailInfo, types, "contact_query_merge_list_test_800"); + } catch (error) { + console.info('logMessage contact_query_merge_list_test_800: raw_contact_1 insert error = ' + error); + done(); + } + var insertRawContactValues2 = { + "display_name": "xiaowuu" + }; + try { + var rawContactIdSecond = await DAHelper.insert(rawContactUri, insertRawContactValues2); + sleep(1000); + console.info("logMessage contact_query_merge_list_test_800: rawContactIdSecond = " + rawContactIdSecond); + expect(rawContactIdSecond > 0).assertTrue(); + var detailInfo1 = ["xiaowuu", "1854154414242"]; + var types1 = ["name", "phone"]; + await insertContactData(DAHelper, rawContactIdSecond, detailInfo1, types1, "contact_query_merge_list_test_800"); + } catch (error) { + console.info('logMessage contact_query_merge_list_test_800: raw_contact_2 insert error = ' + error); + done(); + } + var rawContactIds = [rawContactIdFirst + "", rawContactIdSecond + ""]; + await manualMergeList(DAHelper, rawContactIds, "contact_query_merge_list_test_800"); + done(); + }); + + /** + * @tc.number contact_query_merge_list_test_900 + * @tc.name Insert two contacts with different names to see if the database can + * query contacts that can be merged + * @tc.desc Function test + */ + it("contact_query_merge_list_test_900", 0, async function (done) { + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('before delete_all: start ! DAHelper = ' + DAHelper); + console.info("------logMessage contact_query_merge_list_test_900 is starting!-----"); + var insertRawContactValues1 = { + "display_name": "xiaowusu" + }; + try { + var rawContactIdFirst = await DAHelper.insert(rawContactUri, insertRawContactValues1); + sleep(1000); + console.info("logMessage contact_query_merge_list_test_900: rawContactIdFirst = " + rawContactIdFirst); + expect(rawContactIdFirst > 0).assertTrue(); + var detailInfo = ["xiaowusu"]; + var types = ["name"]; + await insertContactData(DAHelper, rawContactIdFirst, detailInfo, types, "contact_query_merge_list_test_900"); + } catch (error) { + console.info('logMessage contact_query_merge_list_test_900: raw_contact_1 insert error = ' + error); + done(); + } + var insertRawContactValues2 = { + "display_name": "kxiaowusu" + }; + try { + var rawContactIdSecond = await DAHelper.insert(rawContactUri, insertRawContactValues2); + sleep(1000); + console.info("logMessage contact_query_merge_list_test_900: rawContactIdSecond = " + rawContactIdSecond); + expect(rawContactIdSecond > 0).assertTrue(); + var detailInfo1 = ["kxiaowusu"]; + var types1 = ["name"]; + await insertContactData(DAHelper, rawContactIdSecond, detailInfo1, types1, "contact_query_merge_list_test_900"); + } catch (error) { + console.info('logMessage contact_query_merge_list_test_900: raw_contact_2 insert error = ' + error); + done(); + } + await manualNotMerge(DAHelper, rawContactIdFirst, rawContactIdSecond, "contact_query_merge_list_test_900"); + done(); + }); + + async function manualNotMerge(DAHelper, rawContactIdFirst, rawContactIdSecond, tag) { + var condition2 = new ohosDataAbility.DataAbilityPredicates(); + var id = [rawContactIdFirst.toString(), rawContactIdSecond.toString()]; + condition2.in("raw_contact_id", id); + var updateValues2 = {}; + try { + var ManualMergeCode = await DAHelper.update(manualMergeUri, updateValues2, condition2); + sleep(1000); + console.info(tag + "logMessage ManualMergeCode = " + ManualMergeCode); + expect(ManualMergeCode == -1).assertTrue(); + var map = new Map(); + map.set("id", rawContactIdFirst.toString()); + await contactMergeQuery(map, tag, 1); + await deleteAll(rawContactUri, tag); + await deleteAll(contactDataUri, tag); + } catch (error) { + console.info(tag + "logMessage manual_merge error = " + error); + } + } + + /** + * @tc.number contact_query_merge_list_test_1000 + * @tc.name Insert contacts with the same name and phone number, and check whether + * the database can query contacts that can be merged + * @tc.desc Function test + */ + it("contact_query_merge_list_test_1000", 0, async function (done) { + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('before delete_all: start ! DAHelper = ' + DAHelper); + console.info("------logMessage contact_query_merge_list_test_1000 is starting!-----"); + var insertRawContactValues1 = { + "display_name": "xiaotiantian" + }; + try { + var rawContactIdFirst = await DAHelper.insert(rawContactUri, insertRawContactValues1); + sleep(1000); + console.info("logMessage contact_query_merge_list_test_1000: rawContactIdFirst = " + rawContactIdFirst); + expect(rawContactIdFirst > 0).assertTrue(); + var detailInfo = ["xiaotiantian", "1854154414242441"]; + var types = ["name", "phone"]; + await insertContactData(DAHelper, rawContactIdFirst, detailInfo, types, "contact_query_merge_list_test_1000"); + } catch (error) { + console.info('logMessage contact_query_merge_list_test_1000: raw_contact_1 insert error = ' + error); + done(); + } + var insertRawContactValues2 = { + "display_name": "xiaotiantian" + }; + try { + var rawContactIdSecond = await DAHelper.insert(rawContactUri, insertRawContactValues2); + sleep(1000); + console.info("logMessage contact_query_merge_list_test_1000: rawContactIdSecond = " + rawContactIdSecond); + expect(rawContactIdSecond > 0).assertTrue(); + var detailInfo1 = ["xiaotiantian", "1854154414242441"]; + var types1 = ["name", "phone"]; + await insertContactData(DAHelper, rawContactIdSecond, detailInfo1, types1, "contact_query_merge_list_test_1000"); + sleep(2000); + } catch (error) { + console.info('logMessage contact_query_merge_list_test_1000: raw_contact_2 insert error = ' + error); + done(); + } + var condition = new ohosDataAbility.DataAbilityPredicates(); + var updateValues = {}; + try { + sleep(4000); + var autoMergeCode = await DAHelper.update(autoMergeUri, updateValues, condition); + console.info("logMessage contact_query_merge_list_test_1000: autoMergeCode = " + autoMergeCode); + expect(autoMergeCode == 0).assertTrue(); + var map = new Map(); + map.set("id", rawContactIdFirst.toString()); + await contactMergeQuery(map, "contact_query_merge_list_test_1000", 2); + await deleteAll(rawContactUri, "contact_query_merge_list_test_1000"); + await deleteAll(contactDataUri, "contact_query_merge_list_test_1000"); + done(); + } catch (error) { + console.info("logMessage contact_auto_merge_and_spilt_test_100: auto_merge error = " + error); + } + }); + + /** + * @tc.number contact_query_merge_list_test_1100 + * @tc.name Insert contacts with different names and different mobile phone numbers, + and check whether the database can query contacts that can be merged + * @tc.desc Function test + */ + it("contact_query_merge_list_test_1100", 0, async function (done) { + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('before delete_all: start ! DAHelper = ' + DAHelper); + console.info("------logMessage contact_query_merge_list_test_1100 is starting!-----"); + var insertRawContactValues1 = { + "display_name": "wsxiuklkk" + }; + try { + var rawContactIdFirst = await DAHelper.insert(rawContactUri, insertRawContactValues1); + sleep(1000); + console.info("logMessage contact_query_merge_list_test_1100: rawContactIdFirst = " + rawContactIdFirst); + expect(rawContactIdFirst > 0).assertTrue(); + var detailInfo = ["wsxiuklkk", "56465465"]; + var types = ["name", "phone"]; + await insertContactData(DAHelper, rawContactIdFirst, detailInfo, types, "contact_query_merge_list_test_1100"); + } catch (error) { + console.info('logMessage contact_query_merge_list_test_1100: raw_contact_1 insert error = ' + error); + done(); + } + var insertRawContactValues2 = { + "display_name": "xiaolilili" + }; + try { + var rawContactIdSecond = await DAHelper.insert(rawContactUri, insertRawContactValues2); + sleep(1000); + console.info("logMessage contact_query_merge_list_test_1100: rawContactIdSecond = " + rawContactIdSecond); + expect(rawContactIdSecond > 0).assertTrue(); + var detailInfo1 = ["xiaolilili", "8954598595"]; + var types1 = ["name", "phone"]; + await insertContactData(DAHelper, rawContactIdSecond, detailInfo1, types1, "contact_query_merge_list_test_1100"); + } catch (error) { + console.info('logMessage contact_query_merge_list_test_1100: raw_contact_2 insert error = ' + error); + done(); + } + await manualNotMerge(DAHelper, rawContactIdFirst, rawContactIdSecond, "contact_query_merge_list_test_1100"); + done(); + }); + + /** + * @tc.number contact_query_merge_list_test_1200 + * @tc.name Insert two contacts with the same name. Contacts A and B have two + same mobile phone numbers, and check whether the database can be merged + * @tc.desc Function test + */ + it("contact_query_merge_list_test_1200", 0, async function (done) { + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('before delete_all: start ! DAHelper = ' + DAHelper); + console.info("------logMessage contact_query_merge_list_test_1200 is starting!-----"); + var insertRawContactValues1 = { + "display_name": "lwsxiuklkk" + }; + try { + var rawContactIdFirst = await DAHelper.insert(rawContactUri, insertRawContactValues1); + sleep(1000); + console.info("logMessage contact_query_merge_list_test_1200: rawContactIdFirst = " + rawContactIdFirst); + expect(rawContactIdFirst > 0).assertTrue(); + var detailInfo = ["lwsxiuklkk", "122504", "122505"]; + var types = ["name", "phone", "phone"]; + await insertContactData(DAHelper, rawContactIdFirst, detailInfo, types, "contact_query_merge_list_test_1200"); + } catch (error) { + console.info('logMessage contact_query_merge_list_test_1200: raw_contact_1 insert error = ' + error); + done(); + } + var insertRawContactValues2 = { + "display_name": "lwsxiuklkk" + }; + try { + var rawContactIdSecond = await DAHelper.insert(rawContactUri, insertRawContactValues2); + sleep(1000); + console.info("logMessage contact_query_merge_list_test_1200: rawContactIdSecond = " + rawContactIdSecond); + expect(rawContactIdSecond > 0).assertTrue(); + var detailInfo1 = ["lwsxiuklkk", "122504", "122505"]; + var types1 = ["name", "phone", "phone"]; + await insertContactData(DAHelper, rawContactIdSecond, detailInfo1, types1, "contact_query_merge_list_test_1200"); + } catch (error) { + console.info('logMessage contact_query_merge_list_test_1200: raw_contact_2 insert error = ' + error); + done(); + } + await autoMerger(DAHelper, rawContactIdFirst, "contact_query_merge_list_test_1200"); + done(); + }); + + /** + * @tc.number contact_query_merge_list_test_1300 + * @tc.name Insert two contacts with the same name. Contacts A and B have two + * identical mobile phone numbers. Check whether the database can be merged + * @tc.desc Function test + */ + it("contact_query_merge_list_test_1300", 0, async function (done) { + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('before delete_all: start ! DAHelper = ' + DAHelper); + console.info("------logMessage contact_query_merge_list_test_1300 is starting!-----"); + var insertRawContactValues1 = { + "display_name": "xiaowuuklkk" + }; + try { + var rawContactIdFirst = await DAHelper.insert(rawContactUri, insertRawContactValues1); + sleep(1000); + console.info("logMessage contact_query_merge_list_test_1300: rawContactIdFirst = " + rawContactIdFirst); + expect(rawContactIdFirst > 0).assertTrue(); + var detailInfo = ["xiaowuuklkk", "56465465", "122504"]; + var types = ["name", "phone", "phone"]; + await insertContactData(DAHelper, rawContactIdFirst, detailInfo, types, "contact_query_merge_list_test_1300"); + } catch (error) { + console.info('logMessage contact_query_merge_list_test_1300: raw_contact_1 insert error = ' + error); + done(); + } + var insertRawContactValues2 = { + "display_name": "xiaowuuklkk" + }; + try { + var rawContactIdSecond = await DAHelper.insert(rawContactUri, insertRawContactValues2); + sleep(1000); + console.info("logMessage contact_query_merge_list_test_1300: rawContactIdSecond = " + rawContactIdSecond); + expect(rawContactIdSecond > 0).assertTrue(); + var detailInfo1 = ["xiaowuuklkk", "8954598595", "1225054"]; + var types1 = ["name", "phone", "phone"]; + await insertContactData(DAHelper, rawContactIdSecond, detailInfo1, types1, "contact_query_merge_list_test_1300"); + } catch (error) { + console.info('logMessage contact_query_merge_list_test_1300: raw_contact_2 insert error = ' + error); + done(); + } + var rawContactIds = [rawContactIdFirst + "", rawContactIdSecond + ""]; + await manualMergeList(DAHelper, rawContactIds, "contact_query_merge_list_test_1300"); + done(); + }); + + /** + * @tc.number contact_query_merge_list_test_1400 + * @tc.name Insert two contacts with the same name. Contacts A and B have two mobile phone + * numbers, one of which is the same. Check whether the database can be merged + * @tc.desc Function test + */ + it("contact_query_merge_list_test_1400", 0, async function (done) { + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('before delete_all: start ! DAHelper = ' + DAHelper); + console.info("------logMessage contact_query_merge_list_test_1400 is starting!-----"); + var insertRawContactValues1 = { + "display_name": "limingm" + }; + try { + var rawContactIdFirst = await DAHelper.insert(rawContactUri, insertRawContactValues1); + sleep(1000); + console.info("logMessage contact_query_merge_list_test_1400: rawContactIdFirst = " + rawContactIdFirst); + expect(rawContactIdFirst > 0).assertTrue(); + var detailInfo = ["limingm", "122504555", "1122505"]; + var types = ["name", "phone", "phone"]; + await insertContactData(DAHelper, rawContactIdFirst, detailInfo, types, "contact_query_merge_list_test_1400"); + } catch (error) { + console.info('logMessage contact_query_merge_list_test_1400: raw_contact_1 insert error = ' + error); + done(); + } + var insertRawContactValues2 = { + "display_name": "limingm" + }; + try { + var rawContactIdSecond = await DAHelper.insert(rawContactUri, insertRawContactValues2); + sleep(1000); + console.info("logMessage contact_query_merge_list_test_1400: rawContactIdSecond = " + rawContactIdSecond); + expect(rawContactIdSecond > 0).assertTrue(); + var detailInfo1 = ["limingm", "122504555", "1225056"]; + var types1 = ["name", "phone", "phone"]; + await insertContactData(DAHelper, rawContactIdSecond, detailInfo1, types1, "contact_query_merge_list_test_1400"); + } catch (error) { + console.info('logMessage contact_query_merge_list_test_1400: raw_contact_2 insert error = ' + error); + done(); + } + var rawContactIds = [rawContactIdFirst + "", rawContactIdSecond + ""]; + await manualMergeList(DAHelper, rawContactIds, "contact_query_merge_list_test_1400"); + done(); + }); + + /** + * @tc.number contact_query_merge_list_test_1500 + * @tc.name Insert two contacts with the same name, contact A has two mobile phone numbers, + * and contact B has one mobile phone number which is the same as one of the mobile phone + * numbers of A, and check whether the database can be merged + * @tc.desc Function test + */ + it("contact_query_merge_list_test_1500", 0, async function (done) { + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('before delete_all: start ! DAHelper = ' + DAHelper); + console.info("------logMessage contact_query_merge_list_test_1500 is starting!-----"); + var insertRawContactValues1 = { + "display_name": "kplimingm" + }; + try { + var rawContactIdFirst = await DAHelper.insert(rawContactUri, insertRawContactValues1); + sleep(1000); + console.info("logMessage contact_query_merge_list_test_1500: rawContactIdFirst = " + rawContactIdFirst); + expect(rawContactIdFirst > 0).assertTrue(); + var detailInfo = ["kplimingm", "7122504555", "1122505"]; + var types = ["name", "phone", "phone"]; + await insertContactData(DAHelper, rawContactIdFirst, detailInfo, types, "contact_query_merge_list_test_1500"); + } catch (error) { + console.info('logMessage contact_query_merge_list_test_1500: raw_contact_1 insert error = ' + error); + done(); + } + var insertRawContactValues2 = { + "display_name": "kplimingm" + }; + try { + var rawContactIdSecond = await DAHelper.insert(rawContactUri, insertRawContactValues2); + sleep(1000); + console.info("logMessage contact_query_merge_list_test_1500: rawContactIdSecond = " + rawContactIdSecond); + expect(rawContactIdSecond > 0).assertTrue(); + var detailInfo1 = ["kplimingm", "7122504555"]; + var types1 = ["name", "phone"]; + await insertContactData(DAHelper, rawContactIdSecond, detailInfo1, types1, "contact_query_merge_list_test_1500"); + } catch (error) { + console.info('logMessage contact_query_merge_list_test_1500: raw_contact_2 insert error = ' + error); + done(); + } + var rawContactIds = [rawContactIdFirst + "", rawContactIdSecond + ""]; + await manualMergeList(DAHelper, rawContactIds, "contact_query_merge_list_test_1500"); + done(); + }); + + /** + * @tc.number contact_query_merge_list_test_1600 + * @tc.name Insert two contacts with the same name, contact A has two mobile phone numbers, + * and contact B has a mobile phone number different from that of A, check whether + * the database can be merged + * @tc.desc Function test + */ + it("contact_query_merge_list_test_1600", 0, async function (done) { + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('before delete_all: start ! DAHelper = ' + DAHelper); + console.info("------logMessage contact_query_merge_list_test_1600 is starting!-----"); + var insertRawContactValues1 = { + "display_name": "pkplimingm" + }; + try { + var rawContactIdFirst = await DAHelper.insert(rawContactUri, insertRawContactValues1); + sleep(1000); + console.info("logMessage contact_query_merge_list_test_1600: rawContactIdFirst = " + rawContactIdFirst); + expect(rawContactIdFirst > 0).assertTrue(); + var detailInfo = ["pkplimingm", "87122504555", "11122505"]; + var types = ["name", "phone", "phone"]; + await insertContactData(DAHelper, rawContactIdFirst, detailInfo, types, "contact_query_merge_list_test_1600"); + } catch (error) { + console.info('logMessage contact_query_merge_list_test_1600: raw_contact_1 insert error = ' + error); + done(); + } + var insertRawContactValues2 = { + "display_name": "pkplimingm" + }; + try { + var rawContactIdSecond = await DAHelper.insert(rawContactUri, insertRawContactValues2); + sleep(1000); + console.info("logMessage contact_query_merge_list_test_1600: rawContactIdSecond = " + rawContactIdSecond); + expect(rawContactIdSecond > 0).assertTrue(); + var detailInfo1 = ["pkplimingm", "7122554504555", "11122505"]; + var types1 = ["name", "phone", "phone"]; + await insertContactData(DAHelper, rawContactIdSecond, detailInfo1, types1, "contact_query_merge_list_test_1600"); + } catch (error) { + console.info('logMessage contact_query_merge_list_test_1600: raw_contact_2 insert error = ' + error); + done(); + } + var rawContactIds = [rawContactIdFirst + "", rawContactIdSecond + ""]; + await manualMergeList(DAHelper, rawContactIds, "contact_query_merge_list_test_1600"); + done(); + }); + + /** + * @tc.number contact_query_merge_list_test_1700 + * @tc.name Insert multiple manually merged contacts to check whether the database can be merged + * @tc.desc Function test + */ + it("contact_query_merge_list_test_1700", 0, async function (done) { + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('before delete_all: start ! DAHelper = ' + DAHelper); + console.info("------logMessage contact_query_merge_list_test_1700 is starting!-----"); + var insertRawContactValues1 = { + "display_name": "llllllk" + }; + try { + var rawContactIdFirst = await DAHelper.insert(rawContactUri, insertRawContactValues1); + sleep(1000); + console.info("logMessage contact_query_merge_list_test_1700: rawContactIdFirst = " + rawContactIdFirst); + expect(rawContactIdFirst > 0).assertTrue(); + var detailInfo = ["llllllk", "87122504555", "11122505"]; + var types = ["name", "phone", "phone"]; + await insertContactData(DAHelper, rawContactIdFirst, detailInfo, types, "contact_query_merge_list_test_1700"); + } catch (error) { + console.info('logMessage contact_query_merge_list_test_1700: raw_contact_1 insert error = ' + error); + done(); + } + var insertRawContactValues2 = { + "display_name": "llllllk" + }; + try { + var rawContactIdSecond = await DAHelper.insert(rawContactUri, insertRawContactValues2); + sleep(1000); + console.info("logMessage contact_query_merge_list_test_1700: rawContactIdSecond = " + rawContactIdSecond); + expect(rawContactIdSecond > 0).assertTrue(); + var detailInfo1 = ["llllllk", "7555", "02505"]; + var types1 = ["name", "phone", "phone"]; + await insertContactData(DAHelper, rawContactIdSecond, detailInfo1, types1, "contact_query_merge_list_test_1700"); + } catch (error) { + console.info('logMessage contact_query_merge_list_test_1700: raw_contact_2 insert error = ' + error); + done(); + } + var insertRawContactValues3 = { + "display_name": "llllllk" + }; + try { + var rawContactIdThird = await DAHelper.insert(rawContactUri, insertRawContactValues3); + sleep(1000); + console.info("logMessage contact_query_merge_list_test_1700: rawContactIdSecond = " + rawContactIdThird); + expect(rawContactIdThird > 0).assertTrue(); + var detailInfo1 = ["llllllk", "87555", "002505"]; + var types1 = ["name", "phone", "phone"]; + await insertContactData(DAHelper, rawContactIdThird, detailInfo1, types1, "contact_query_merge_list_test_1700"); + } catch (error) { + console.info('logMessage contact_query_merge_list_test_1700: raw_contact_2 insert error = ' + error); + done(); + } + var rawContactIds = [rawContactIdFirst + "", rawContactIdSecond + "", rawContactIdThird + ""]; + await manualMergeList(DAHelper, rawContactIds, "contact_query_merge_list_test_1700"); + done(); + }); + + /** + * @tc.number contact_query_merge_list_test_1800 + * @tc.name Import multiple automatically merged contacts to check whether the database can be merged + * @tc.desc Function test + */ + it("contact_query_merge_list_test_1800", 0, async function (done) { + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('before delete_all: start ! DAHelper = ' + DAHelper); + console.info("------logMessage contact_query_merge_list_test_1800 is starting!-----"); + var insertRawContactValues1 = { + "display_name": "jggbgbk" + }; + try { + var rawContactIdFirst = await DAHelper.insert(rawContactUri, insertRawContactValues1); + sleep(1000); + console.info("logMessage contact_query_merge_list_test_1800: rawContactIdFirst = " + rawContactIdFirst); + expect(rawContactIdFirst > 0).assertTrue(); + var detailInfo = ["jggbgbk", "85555", "996174"]; + var types = ["name", "phone", "phone"]; + await insertContactData(DAHelper, rawContactIdFirst, detailInfo, types, "contact_query_merge_list_test_1800"); + } catch (error) { + console.info('logMessage contact_query_merge_list_test_1800: raw_contact_1 insert error = ' + error); + done(); + } + var insertRawContactValues2 = { + "display_name": "jggbgbk" + }; + try { + var rawContactIdSecond = await DAHelper.insert(rawContactUri, insertRawContactValues2); + sleep(1000); + console.info("logMessage contact_query_merge_list_test_1800: rawContactIdSecond = " + rawContactIdSecond); + expect(rawContactIdSecond > 0).assertTrue(); + var detailInfo1 = ["jggbgbk", "85555", "996174"]; + var types1 = ["name", "phone", "phone"]; + await insertContactData(DAHelper, rawContactIdSecond, detailInfo1, types1, "contact_query_merge_list_test_1800"); + } catch (error) { + console.info('logMessage contact_query_merge_list_test_1800: raw_contact_2 insert error = ' + error); + done(); + } + var insertRawContactValues3 = { + "display_name": "jggbgbk" + }; + try { + var rawContactIdThird = await DAHelper.insert(rawContactUri, insertRawContactValues3); + sleep(1000); + console.info("logMessage contact_query_merge_list_test_1800: rawContactIdSecond = " + rawContactIdThird); + expect(rawContactIdThird > 0).assertTrue(); + var detailInfo1 = ["jggbgbk", "85555", "996174"]; + var types1 = ["name", "phone", "phone"]; + await insertContactData(DAHelper, rawContactIdThird, detailInfo1, types1, "contact_query_merge_list_test_1800"); + } catch (error) { + console.info('logMessage contact_query_merge_list_test_1800: raw_contact_2 insert error = ' + error); + done(); + } + var condition = new ohosDataAbility.DataAbilityPredicates(); + var updateValues = {}; + try { + var autoMergeCode = await DAHelper.update(autoMergeUri, updateValues, condition); + sleep(1000); + console.info("logMessage contact_query_merge_list_test_1800 autoMergeCode = " + autoMergeCode); + expect(autoMergeCode == 0).assertTrue(); + var map = new Map(); + map.set("id", rawContactIdFirst.toString()); + await contactMergeQuery(map, "contact_query_merge_list_test_1800", 3); + await deleteAll(rawContactUri, "contact_query_merge_list_test_1800"); + await deleteAll(contactDataUri, "contact_query_merge_list_test_1800"); + } catch (error) { + console.info("contact_query_merge_list_test_1800 auto_merge error =" + error); + } + done(); + }); + + /** + * @tc.number contact_query_merge_list_test_1900 + * @tc.name Insert two contacts with the same name, contact A has two mobile phone numbers, + * and contact B has a mobile phone number different from that of A, check whether + * the database can be merged + * @tc.desc Function test + */ + it("contact_query_merge_list_test_1900", 0, async function (done) { + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('before delete_all: start ! DAHelper = ' + DAHelper); + console.info("------logMessage contact_query_merge_list_test_1900 is starting!-----"); + var insertRawContactValues1 = { + "display_name": "owjiuh" + }; + try { + var rawContactIdFirst = await DAHelper.insert(rawContactUri, insertRawContactValues1); + sleep(1000); + console.info("logMessage contact_query_merge_list_test_1900: rawContactIdFirst = " + rawContactIdFirst); + expect(rawContactIdFirst > 0).assertTrue(); + var dataId = insertContactDataSingle(DAHelper, rawContactIdFirst, "owjiuh", "name"); + } catch (error) { + console.info('logMessage contact_query_merge_list_test_1900: raw_contact_1 insert error = ' + error); + done(); + } + var insertRawContactValues2 = { + "display_name": "owjiuh" + }; + try { + var rawContactIdSecond = await DAHelper.insert(rawContactUri, insertRawContactValues2); + sleep(1000); + console.info("logMessage contact_query_merge_list_test_1900: rawContactIdSecond = " + rawContactIdSecond); + expect(rawContactIdSecond > 0).assertTrue(); + var dataId = insertContactDataSingle(DAHelper, rawContactIdFirst, "owjiuh", "name"); + } catch (error) { + console.info('logMessage contact_query_merge_list_test_1900: raw_contact_2 insert error = ' + error); + done(); + } + await updateContactData("owjiuh111", dataId, "contact_query_merge_list_test_1900"); + await autoNotMerger(DAHelper, rawContactIdFirst, "contact_query_merge_list_test_1900"); + done(); + }); + + /** + * @tc.number contact_query_merge_list_test_2000 + * @tc.name Insert two automatically merged contacts, modify the phone number of A, and then + * merge the contacts manually to check whether the database can be merged + * the database can be merged + * @tc.desc Function test + */ + it("contact_query_merge_list_test_2000", 0, async function (done) { + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('before delete_all: start ! DAHelper = ' + DAHelper); + console.info("------logMessage contact_query_merge_list_test_2000 is starting!-----"); + var insertRawContactValues1 = { + "display_name": "ollwjiuh" + }; + try { + var rawContactIdFirst = await DAHelper.insert(rawContactUri, insertRawContactValues1); + sleep(1000); + console.info("logMessage contact_query_merge_list_test_2000: rawContactIdFirst = " + rawContactIdFirst); + expect(rawContactIdFirst > 0).assertTrue(); + await insertContactDataSingle(DAHelper, rawContactIdFirst, "ollwjiuh", "name"); + var dataIdTwo = await insertContactDataSingle(DAHelper, rawContactIdFirst, "8554544", "phone"); + } catch (error) { + console.info('logMessage contact_query_merge_list_test_2000: raw_contact_1 insert error = ' + error); + done(); + } + var insertRawContactValues2 = { + "display_name": "ollwjiuh" + }; + try { + var rawContactIdSecond = await DAHelper.insert(rawContactUri, insertRawContactValues2); + sleep(1000); + console.info("logMessage contact_query_merge_list_test_2000: rawContactIdSecond = " + rawContactIdSecond); + expect(rawContactIdSecond > 0).assertTrue(); + await insertContactDataSingle(DAHelper, rawContactIdSecond, "ollwjiuh", "name"); + await insertContactDataSingle(DAHelper, rawContactIdSecond, "8554544", "phone"); + sleep(2000); + } catch (error) { + console.info('logMessage contact_query_merge_list_test_2000: raw_contact_2 insert error = ' + error); + done(); + } + await updateContactData("8554544444", dataIdTwo, "contact_query_merge_list_test_2000"); + sleep(3000); + var rawContactIds = [rawContactIdFirst + "", rawContactIdSecond + ""]; + await manualMergeList(DAHelper, rawContactIds, "contact_query_merge_list_test_2000"); + done(); + }); + + /** + * @tc.number abnormal_merge_Update_test_2100 + * @tc.name Insert two contacts with different names for automatic and manual merging operations + * @tc.desc Function test + */ + it("abnormal_merge_Update_test_2100", 0, async function (done) { + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('before delete_all: start ! DAHelper = ' + DAHelper); + console.info("------logMessage abnormal_merge_Update_test_2100 is starting!-----"); + var insertRawContactValues1 = { + "display_name": "2100mergeTest" + }; + try { + var rawContactIdFirst = await DAHelper.insert(rawContactUri, insertRawContactValues1); + sleep(1000); + console.info("logMessage abnormal_merge_Update_test_2100: rawContactIdFirst = " + rawContactIdFirst); + expect(rawContactIdFirst > 0).assertTrue(); + var detailInfo = ["2100mergeTest"]; + var types = ["name"]; + await insertContactData(DAHelper, rawContactIdFirst, detailInfo, types, "abnormal_merge_Update_test_2100"); + } catch (error) { + console.info('logMessage abnormal_merge_Update_test_2100: raw_contact_1 insert error = ' + error); + done(); + } + var insertRawContactValues2 = { + "display_name": "2100mergeTestTwo" + }; + try { + var rawContactIdSecond = await DAHelper.insert(rawContactUri, insertRawContactValues2); + sleep(1000); + console.info("logMessage abnormal_merge_Update_test_2100: rawContactIdSecond = " + rawContactIdSecond); + expect(rawContactIdSecond > 0).assertTrue(); + var detailInfo1 = ["2100mergeTestTwo"]; + var types1 = ["name"]; + await insertContactData(DAHelper, rawContactIdSecond, detailInfo1, types1, "abnormal_merge_Update_test_2100"); + } catch (error) { + console.info('logMessage abnormal_merge_Update_test_2100: raw_contact_2 insert error = ' + error); + done(); + } + var condition = new ohosDataAbility.DataAbilityPredicates(); + var updateValues = {}; + var autoMergeCode = await DAHelper.update(autoMergeUri, updateValues, condition); + console.info("logMessage abnormal_merge_Update_test_2100 autoMergeCode = " + autoMergeCode); + expect(autoMergeCode == -1).assertTrue(); + await manualNotMerge(DAHelper, rawContactIdFirst, rawContactIdSecond, "abnormal_merge_Update_test_2100"); + done(); + }); + + /** + * @tc.number abnormal_merge_Update_test_2200 + * @tc.name Insert two contacts with same names for automatic and manual merging operations + * @tc.desc Function test + */ + it("abnormal_merge_Update_test_2200", 0, async function (done) { + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('before delete_all: start ! DAHelper = ' + DAHelper); + console.info("------logMessage abnormal_merge_Update_test_2200 is starting!-----"); + var insertRawContactValues1 = { + "display_name": "2200mergeTest" + }; + try { + var rawContactIdFirst = await DAHelper.insert(rawContactUri, insertRawContactValues1); + sleep(1000); + console.info("logMessage abnormal_merge_Update_test_2200: rawContactIdFirst = " + rawContactIdFirst); + expect(rawContactIdFirst > 0).assertTrue(); + var detailInfo = ["2200mergeTest", "45544"]; + var types = ["name", "phone"]; + await insertContactData(DAHelper, rawContactIdFirst, detailInfo, types, "abnormal_merge_Update_test_2200"); + } catch (error) { + console.info('logMessage abnormal_merge_Update_test_2200: raw_contact_1 insert error = ' + error); + done(); + } + var insertRawContactValues2 = { + "display_name": "2200mergeTestTwo" + }; + try { + var rawContactIdSecond = await DAHelper.insert(rawContactUri, insertRawContactValues2); + sleep(1000); + console.info("logMessage abnormal_merge_Update_test_2200: rawContactIdSecond = " + rawContactIdSecond); + expect(rawContactIdSecond > 0).assertTrue(); + var detailInfo1 = ["2200mergeTestTwo", "55134865"]; + var types1 = ["name", "phone"]; + await insertContactData(DAHelper, rawContactIdSecond, detailInfo1, types1, "abnormal_merge_Update_test_2200"); + } catch (error) { + console.info('logMessage abnormal_merge_Update_test_2200: raw_contact_2 insert error = ' + error); + done(); + } + await queryMergeListError(DAHelper, rawContactIdFirst, rawContactIdSecond, "abnormal_merge_Update_test_2200"); + done(); + }); + + async function queryMergeListError(DAHelper, rawContactIdFirst, rawContactIdSecond, testName) { + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + var columns = ["display_names"]; + var predicates = new ohosDataAbility.DataAbilityPredicates(); + try { + sleep(3000); + var resultSet = await DAHelper.query(uriQueryMergeList, columns, predicates); + console.info(testName + 'resultSet.rowCount = ' + resultSet.rowCount); + expect(resultSet.rowCount == 0).assertTrue(); + resultSet.close(); + await deleteAll(rawContactUri, testName); + await deleteAll(contactDataUri, testName); + } catch (error) { + console.info(testName + ": query error = " + error); + } + } + + /** + * @tc.number abnormal_merge_Update_test_2300 + * @tc.name Insert two contacts with different names, and then automatically merge them to + * see if the database can be merged + * @tc.desc Function test + */ + it("abnormal_merge_Update_test_2300", 0, async function (done) { + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('before delete_all: start ! DAHelper = ' + DAHelper); + console.info("------logMessage abnormal_merge_Update_test_2300 is starting!-----"); + var insertRawContactValues1 = { + "display_name": "2300mergeTest" + }; + try { + var rawContactIdFirst = await DAHelper.insert(rawContactUri, insertRawContactValues1); + sleep(1000); + console.info("logMessage abnormal_merge_Update_test_2300: rawContactIdFirst = " + rawContactIdFirst); + expect(rawContactIdFirst > 0).assertTrue(); + var detailInfo = ["2300mergeTest"]; + var types = ["name"]; + await insertContactData(DAHelper, rawContactIdFirst, detailInfo, types, "abnormal_merge_Update_test_2300"); + } catch (error) { + console.info('logMessage abnormal_merge_Update_test_2300: raw_contact_1 insert error = ' + error); + done(); + } + var insertRawContactValues2 = { + "display_name": "2300mergeTestName" + }; + try { + var rawContactIdSecond = await DAHelper.insert(rawContactUri, insertRawContactValues2); + sleep(1000); + console.info("logMessage abnormal_merge_Update_test_2300: rawContactIdSecond = " + rawContactIdSecond); + expect(rawContactIdSecond > 0).assertTrue(); + var detailInfo1 = ["2300mergeTestName"]; + var types1 = ["name"]; + await insertContactData(DAHelper, rawContactIdSecond, detailInfo1, types1, "abnormal_merge_Update_test_2300"); + } catch (error) { + console.info('logMessage abnormal_merge_Update_test_2300: raw_contact_2 insert error = ' + error); + done(); + } + await autoNotMerger(DAHelper, rawContactIdFirst, "abnormal_merge_Update_test_2300"); + done(); + }); + + /** + * @tc.number abnormal_merge_Update_test_2400 + * @tc.name Insert two contacts with different names, and then automatically merge them to + * see if the database can be merged + * @tc.desc Function test + */ + it("abnormal_merge_Update_test_2400", 0, async function (done) { + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('before delete_all: start ! DAHelper = ' + DAHelper); + console.info("------logMessage abnormal_merge_Update_test_2400 is starting!-----"); + var insertRawContactValues1 = { + "display_name": "2400mergeTest" + }; + try { + var rawContactIdFirst = await DAHelper.insert(rawContactUri, insertRawContactValues1); + sleep(1000); + console.info("logMessage abnormal_merge_Update_test_2400: rawContactIdFirst = " + rawContactIdFirst); + expect(rawContactIdFirst > 0).assertTrue(); + var detailInfo = ["2400mergeTest"]; + var types = ["namee"]; + await insertContactData(DAHelper, rawContactIdFirst, detailInfo, types, "abnormal_merge_Update_test_2400"); + } catch (error) { + console.info('logMessage abnormal_merge_Update_test_2400: raw_contact_1 insert error = ' + error); + done(); + } + var insertRawContactValues2 = { + "display_name": "2400mergeTest" + }; + try { + var rawContactIdSecond = await DAHelper.insert(rawContactUri, insertRawContactValues2); + sleep(1000); + console.info("logMessage abnormal_merge_Update_test_2400: rawContactIdSecond = " + rawContactIdSecond); + expect(rawContactIdSecond > 0).assertTrue(); + var detailInfo1 = ["2400mergeTest"]; + var types1 = ["name"]; + await insertContactData(DAHelper, rawContactIdSecond, detailInfo1, types1, "abnormal_merge_Update_test_2400"); + } catch (error) { + console.info('logMessage abnormal_merge_Update_test_2400: raw_contact_2 insert error = ' + error); + done(); + } + await autoNotMerger(DAHelper, rawContactIdFirst, "abnormal_merge_Update_test_2400"); + done(); + }); + + /** + * @tc.number abnormal_merge_Update_test_2500 + * @tc.name Pass 0 after merging to split + * @tc.desc Function test + */ + it("abnormal_merge_Update_test_2500", 0, async function (done) { + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('before delete_all: start ! DAHelper = ' + DAHelper); + console.info("------logMessage abnormal_merge_Update_test_2500 is starting!-----"); + var insertRawContactValues1 = { + "display_name": "2500mergeTest" + }; + try { + var rawContactIdFirst = await DAHelper.insert(rawContactUri, insertRawContactValues1); + sleep(1000); + console.info("logMessage abnormal_merge_Update_test_2500: rawContactIdFirst = " + rawContactIdFirst); + expect(rawContactIdFirst > 0).assertTrue(); + var detailInfo = ["2500mergeTest"]; + var types = ["name"]; + await insertContactData(DAHelper, rawContactIdFirst, detailInfo, types, "abnormal_merge_Update_test_2500"); + } catch (error) { + console.info('logMessage abnormal_merge_Update_test_2500: raw_contact_1 insert error = ' + error); + done(); + } + var insertRawContactValues2 = { + "display_name": "2500mergeTest" + }; + try { + var rawContactIdSecond = await DAHelper.insert(rawContactUri, insertRawContactValues2); + sleep(1000); + console.info("logMessage abnormal_merge_Update_test_2500: rawContactIdSecond = " + rawContactIdSecond); + expect(rawContactIdSecond > 0).assertTrue(); + var detailInfo1 = ["2500mergeTest"]; + var types1 = ["name"]; + await insertContactData(DAHelper, rawContactIdSecond, detailInfo1, types1, "abnormal_merge_Update_test_2500"); + } catch (error) { + console.info('logMessage abnormal_merge_Update_test_2500: raw_contact_2 insert error = ' + error); + done(); + } + var condition = new ohosDataAbility.DataAbilityPredicates(); + var updateValues = {}; + var autoMergeCode = await DAHelper.update(autoMergeUri, updateValues, condition); + sleep(1000); + console.info("logMessage abnormal_merge_Update_test_2500 autoMergeCode = " + autoMergeCode); + expect(autoMergeCode == 0).assertTrue(); + var map = new Map(); + map.set("id", rawContactIdFirst.toString()); + await contactNotSplit(DAHelper, 0, "abnormal_merge_Update_test_2500"); + await contactMergeQuery(map, "abnormal_merge_Update_test_2500", 2); + await deleteAll(rawContactUri, "abnormal_merge_Update_test_2500"); + await deleteAll(contactDataUri, "abnormal_merge_Update_test_2500"); + done(); + }); + + /** + * @tc.number abnormal_merge_Update_test_2600 + * @tc.name Pass -1 after merging to split + * @tc.desc Function test + */ + it("abnormal_merge_Update_test_2600", 0, async function (done) { + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('before delete_all: start ! DAHelper = ' + DAHelper); + console.info("------logMessage abnormal_merge_Update_test_2600 is starting!-----"); + var insertRawContactValues1 = { + "display_name": "2600mergeTest" + }; + try { + var rawContactIdFirst = await DAHelper.insert(rawContactUri, insertRawContactValues1); + sleep(1000); + console.info("logMessage abnormal_merge_Update_test_2600: rawContactIdFirst = " + rawContactIdFirst); + expect(rawContactIdFirst > 0).assertTrue(); + var detailInfo = ["2600mergeTest"]; + var types = ["name"]; + await insertContactData(DAHelper, rawContactIdFirst, detailInfo, types, "abnormal_merge_Update_test_2600"); + } catch (error) { + console.info('logMessage abnormal_merge_Update_test_2600: raw_contact_1 insert error = ' + error); + done(); + } + var insertRawContactValues2 = { + "display_name": "2600mergeTest" + }; + try { + var rawContactIdSecond = await DAHelper.insert(rawContactUri, insertRawContactValues2); + sleep(1000); + console.info("logMessage abnormal_merge_Update_test_2600: rawContactIdSecond = " + rawContactIdSecond); + expect(rawContactIdSecond > 0).assertTrue(); + var detailInfo1 = ["2600mergeTest"]; + var types1 = ["name"]; + await insertContactData(DAHelper, rawContactIdSecond, detailInfo1, types1, "abnormal_merge_Update_test_2600"); + } catch (error) { + console.info('logMessage abnormal_merge_Update_test_2600: raw_contact_2 insert error = ' + error); + done(); + } + var condition = new ohosDataAbility.DataAbilityPredicates(); + var updateValues = {}; + var autoMergeCode = await DAHelper.update(autoMergeUri, updateValues, condition); + sleep(1000); + console.info("logMessage abnormal_merge_Update_test_2600 autoMergeCode = " + autoMergeCode); + expect(autoMergeCode == 0).assertTrue(); + var map = new Map(); + map.set("id", rawContactIdFirst.toString()); + await contactNotSplit(DAHelper, -1, "abnormal_merge_Update_test_2600"); + await contactMergeQuery(map, "abnormal_merge_Update_test_2600", 2); + await deleteAll(rawContactUri, "abnormal_merge_Update_test_2600"); + await deleteAll(contactDataUri, "abnormal_merge_Update_test_2600"); + done(); + }); + + async function contactNotSplit(DAHelper, rawContactIdFirst, testName) { + var condition2 = new ohosDataAbility.DataAbilityPredicates(); + var array = [rawContactIdFirst.toString()]; + condition2.in("raw_contact_id", array); + var updateValues2 = {}; + try { + var splitCode = await DAHelper.update(splitUri, updateValues2, condition2); + sleep(4000); + console.info(testName + 'logMessage splitCode = ' + splitCode); + expect(splitCode == -1).assertTrue(); + } catch (error) { + console.info(testName + 'logMessage split error = ' + error); + } + } + + afterAll(async function () { + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('merge afterAll delete_All: start ! DAHelper = ' + DAHelper); + var condition = new ohosDataAbility.DataAbilityPredicates(); + var deletedAll = await DAHelper.delete(deletedUri, condition); + sleep(4000); + console.info('merge afterAll delete_All : deletedAll ! DAHelper = ' + deletedAll); + }); + }); +} \ No newline at end of file diff --git a/telephony/telephonyjstest/contact_function_merge/entry/src/main/ets/MainAbility/test/lib/Const.js b/telephony/telephonyjstest/contact_function_merge/entry/src/main/ets/MainAbility/test/lib/Const.js new file mode 100644 index 000000000..f9263cd46 --- /dev/null +++ b/telephony/telephonyjstest/contact_function_merge/entry/src/main/ets/MainAbility/test/lib/Const.js @@ -0,0 +1,36 @@ +/** + * 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. + */ + +// sim slot id +export const DEFAULT_SLOTID = 0; +export const SLOTID3 = 3; +export const SLOTID2 = 2; +export const SLOTID_MINUS1 = -1; + +// sim correct password +export const CORRECT_PIN = '1234'; +export const CORRECT_PIN2 = '18099014'; + +// sim incorrect password +export const INCORRECT_PIN = '134679'; +export const INCORRECT_PIN_LEN3 = '123'; +export const INCORRECT_PUK = '134679'; +export const INCORRECT_PIN2 = '134679'; +export const INCORRECT_PIN2_LEN3 = '123'; +export const INCORRECT_PIN2_LEN9 = '123456789'; +export const INCORRECT_PUK2 = '134679'; + +// lock status response +export const LOCK_RESULT = { SUCCESS: 0, FAILURE: -1, EXCEPTION: -2 }; \ No newline at end of file diff --git a/telephony/telephonyjstest/contact_function_merge/entry/src/main/resources/base/element/string.json b/telephony/telephonyjstest/contact_function_merge/entry/src/main/resources/base/element/string.json new file mode 100644 index 000000000..03b8532c5 --- /dev/null +++ b/telephony/telephonyjstest/contact_function_merge/entry/src/main/resources/base/element/string.json @@ -0,0 +1,12 @@ +{ + "string": [ + { + "name": "entry_MainAbility", + "value": "entry_MainAbility" + }, + { + "name": "description_mainability", + "value": "ETS_Empty Ability" + } + ] +} \ No newline at end of file diff --git a/telephony/telephonyjstest/contact_function_merge/entry/src/main/resources/base/media/icon.png b/telephony/telephonyjstest/contact_function_merge/entry/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#X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?$LwTm;Ld;~g zgBUUcL1NbwI<93~JLelR!T{8ny!2;GlTZ0>^ml(^+R|_~_~ni`Q?nE>&S;CQV>t6lK;O%Wu7Z9iVioo2e;2N-6Q>12y&KznfGiYm5kKXj%s&4C#DoOaz{#a9g>V#}`+uu3TK`_GLGEAH6-}!7+gP8V$ z7a!V3qrpV33gMMuno|cXUM@6Qcx-aT?t@4ED0$2S@#?)rC7Fh3j(i;L&54!|0FMe3x*bXtFnlJzLL3aH zpi;lr6%&X;C%SVM=P%MJ6(}KH>m0w_WKuWy{X2p4!2Pqrwm;>=<2o}Dhu*bisL!?5 z)6?@AU&4YWUN)^*jr!Ozt&JdTDOw)?fw~F17S(d{|7GG(G(KeJZ0N2`FVv?5 NG*q?mAC)bG{|A+36q*14 literal 0 HcmV?d00001 diff --git a/telephony/telephonyjstest/contact_function_merge/entry/src/main/resources/rawfile/star-1-2.png b/telephony/telephonyjstest/contact_function_merge/entry/src/main/resources/rawfile/star-1-2.png new file mode 100644 index 0000000000000000000000000000000000000000..450c3dd3ca68bf601bd08e5f41797d376e20d00d GIT binary patch literal 8295 zcma)iby!qi)GiDI3@ITfJq#cs(xo6VIK9g0Is58cut9YYAhAky89NJ&c$4N6Nm zw8Wj?_uaqmbN@K!?C070th3LGz1Mo*9j&FIL_x|(iid|s0au1;Ejqu(x%6MX}UcP^pVq^MKx?9Z3<6HZSZ(YTWwl+ z4})r2h&L?_5Z3xL9JTpl$1We;HwOfV*U2Dd;4VathABE2mL~&90=s!A z17A=j029Bxgn&sP{lPFWGr*0ABr?l!nhT^H>H*JtEAfpTOhQ8`F<+vJ8@ZDt_v2l} zOF0@&=65xE>0mI)Bv(k<5_x1Wr}DE!>r#HG91U6(z}Lz^i4RY3X&Tfw3&nM%1C5a) z%(ySExg?jj0C8QEq$g*CpQ*Xk7yhNiNn@bzJnMOrz${d^ZW9+zK}FP6Wt)@*prd*F z(rz`Qjq{pA&L7Hx1K?P`{_=|>e3O_&^n>(;eRI>{gq^xXjKN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@BU)Y0hT`+mOm$Z_%rB=a%o>I z!2c6lHyKQN)VjiFwa!eE^p8jc$sy$vB+8i25lI~6KPFFh$!o$avA~rj#L6xvR|Z83 z*WD6T9e+5Pyy=F+)pNTf{ny3cy>7Rkd3o*TS?TZJ`NS^NF2%HMkyS{?uJ$`!P4_L^ z1`NFDUbNyg_qREifgktnp1_v{Jbb`7m}2PTyUdOmtJj~m z9bB=ecw4_^rw1IW=of+>nrW5=d3k`3qHCxsIN_F{T1A545};;+fsyC&qChi+YV zr~M63H8ZLCPYmsjY>ls9cL%I)F|JIW-#+48$+lD4k*(P*kDM%zx_fvu4u5ZYUnI}5 zdrycFq>xFU)&X3p@pP2u%$o}}YcRn(MhJ&B2o?KS@cIVz>Ye%o^xV?CB{_Qhu z;}_q1bvO^g{8<3!gYbo4Di{8qzV+(9 zdlmksohQmRTs@qB;(Wo?dER_ux6XQb@q$tQPW?CMu6GVQd;R=iR;-S{Kr%Zks7>b1 zNs{|-+jhObYE}NR&`TGGr^h^4bjh%c>R#@=8nM&Md>_a+zVulsl;){flFekV1t9ob z+SqfV_Pv3$2f)bQ8%Ul2>fdYR^1zs0BQF~olsOj5AodC&Q_7SMFzsz2 z9newxE&jodk~tNHwl%LBMMDbrk=(^b literal 0 HcmV?d00001 diff --git a/telephony/telephonyjstest/contact_performance/BUILD.gn b/telephony/telephonyjstest/contact_performance/BUILD.gn new file mode 100644 index 000000000..cf8ca1bec --- /dev/null +++ b/telephony/telephonyjstest/contact_performance/BUILD.gn @@ -0,0 +1,32 @@ +# 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("ActsContactPerformanceEtsTest") { + hap_profile = "./entry/src/main/config.json" + deps = [ + ":ace_demo_ets_assets", + ":ace_demo_ets_resources", + ] + ets2abc = true + certificate_profile = "./signature/openharmony_sx.p7b" + hap_name = "ActsContactPerformanceEtsTest" +} +ohos_js_assets("ace_demo_ets_assets") { + source_dir = "./entry/src/main/ets/MainAbility" +} +ohos_resources("ace_demo_ets_resources") { + sources = [ "./entry/src/main/resources" ] + hap_profile = "./entry/src/main/config.json" +} diff --git a/telephony/telephonyjstest/contact_performance/Test.json b/telephony/telephonyjstest/contact_performance/Test.json new file mode 100644 index 000000000..1ac6ac21a --- /dev/null +++ b/telephony/telephonyjstest/contact_performance/Test.json @@ -0,0 +1,18 @@ +{ + "description": "Configuration for hjunit demo Tests", + "driver": { + "type": "JSUnitTest", + "test-timeout": "1800000", + "package": "com.ohos.contactperformance", + "shell-timeout": "60000" + }, + "kits": [ + { + "test-file-name": [ + "ActsContactPerformanceEtsTest.hap" + ], + "type": "AppInstallKit", + "cleanup-apps": true + } + ] +} diff --git a/telephony/telephonyjstest/contact_performance/entry/src/main/config.json b/telephony/telephonyjstest/contact_performance/entry/src/main/config.json new file mode 100644 index 000000000..a8d0ec05e --- /dev/null +++ b/telephony/telephonyjstest/contact_performance/entry/src/main/config.json @@ -0,0 +1,93 @@ +{ + "app": { + "bundleName": "com.ohos.contactperformance", + "vendor": "open", + "version": { + "code": 1000000, + "name": "1.0.0" + }, + "apiVersion": { + "compatible": 7, + "releaseType": "Release", + "target": 7 + } + }, + "deviceConfig": {}, + "module": { + "package": "com.ohos.contactperformance", + "name": ".MyApplication", + "mainAbility": ".MainAbility", + "srcPath": "MainAbility", + "deviceType": [ + "phone" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "entry", + "moduleType": "entry", + "installationFree": false + }, + "abilities": [ + { + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ], + "orientation": "unspecified", + "visible": true, + "srcPath": "MainAbility", + "name": ".MainAbility", + "srcLanguage": "ets", + "icon": "$media:icon", + "description": "$string:description_mainability", + "formsEnabled": false, + "label": "$string:entry_MainAbility", + "type": "page", + "launchType": "standard" + } + ], + "js": [ + { + "mode": { + "syntax": "ets", + "type": "pageAbility" + }, + "pages": [ + "pages/index", + "pages/Button", + "pages/Blank", + "pages/DataPanel", + "pages/Divider", + "pages/Text", + "pages/RowSplit", + "pages/Scroll", + "pages/Stack", + "pages/Image", + "pages/Progress", + "pages/Qrcode", + "pages/Rating", + "pages/Span", + "pages/Slider", + "pages/Badge", + "pages/Column", + "pages/ColumnSplit", + "pages/Counter", + "pages/Flex", + "pages/GridContainer" + + ], + "name": ".MainAbility", + "window": { + "designWidth": 720, + "autoDesignWidth": false + } + } + ] + } +} \ No newline at end of file diff --git a/telephony/telephonyjstest/contact_performance/entry/src/main/ets/MainAbility/app.ets b/telephony/telephonyjstest/contact_performance/entry/src/main/ets/MainAbility/app.ets new file mode 100644 index 000000000..261fadca2 --- /dev/null +++ b/telephony/telephonyjstest/contact_performance/entry/src/main/ets/MainAbility/app.ets @@ -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('Application onCreate') + }, + onDestroy() { + console.info('Application onDestroy') + }, +} \ No newline at end of file diff --git a/telephony/telephonyjstest/contact_performance/entry/src/main/ets/MainAbility/pages/Badge.ets b/telephony/telephonyjstest/contact_performance/entry/src/main/ets/MainAbility/pages/Badge.ets new file mode 100644 index 000000000..66de6f8e3 --- /dev/null +++ b/telephony/telephonyjstest/contact_performance/entry/src/main/ets/MainAbility/pages/Badge.ets @@ -0,0 +1,95 @@ +/* + * 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. + */ + +@Entry +@Component +struct badge { + @State counts: number = 33 + @State message: string = 'new' + @State active: boolean = false + private content: string = "badge Page"; + + onPageShow() { + console.info('badge page show called'); + } + + onBuildDone() { + console.info('badge page build done called'); + } + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Scroll() { + Column() { + Text(`${this.content}`) + .fontSize(50) + .fontWeight(FontWeight.Bold) + Badge({ + count: this.counts, + position: BadgePosition.Right, + maxCount: 99, + style: { color: 0xFFFFFF, fontSize: 16, badgeSize: 20, badgeColor: Color.Red } + }) { + Button('message') + .onClick(() => { + this.counts++ + }) + .width(100).height(50).backgroundColor(0x317aff) + } + .width(100) + .height(50) + .key('badge') + + Text("BadgePosition.RightTop").fontSize(16) + Badge({ + count: this.counts, + position: BadgePosition.RightTop, + maxCount: 99, + style: { color: 0xFFFFFF, fontSize: '16', badgeSize: '20', badgeColor: Color.Red } + }) { + Button('message') + .onClick(() => { + this.counts++ + }) + .width(100).height(50).backgroundColor(0x317aff) + } + .width(100) + .height(50) + .key('badge1') + + Text("BadgePosition.Left").fontSize(16) + Badge({ + count: this.counts, + position: BadgePosition.Left, + maxCount: 99, + style: { color: Color.Pink, fontSize: 16, badgeSize: 20, badgeColor: Color.Red } + }) { + Button('message') + .onClick(() => { + this.counts++ + }) + .width(100).height(50).backgroundColor(0x317aff) + } + .width(100) + .height(50) + .key('badge2') + } + } + } + .key('flex') + .width('100%') + .height('100%') + } +} diff --git a/telephony/telephonyjstest/contact_performance/entry/src/main/ets/MainAbility/pages/Blank.ets b/telephony/telephonyjstest/contact_performance/entry/src/main/ets/MainAbility/pages/Blank.ets new file mode 100644 index 000000000..a50fc719e --- /dev/null +++ b/telephony/telephonyjstest/contact_performance/entry/src/main/ets/MainAbility/pages/Blank.ets @@ -0,0 +1,47 @@ +/* + * 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. + */ + +@Entry +@Component +struct blank_testcase { + @State Color: Color = Color.Pink + @State active: boolean = false + private content: string = "Blank Page" + + onPageShow() { + console.info('Blank page show called'); + } + + onBuildDone() { + console.info('Blank page build done called'); + } + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Text(`${this.content}`) + .fontSize(50) + .fontWeight(FontWeight.Bold) + Blank(100) + .color(this.Color) + .key('blank') + Text('on/off').fontSize(18).height(60) + } + .key('flex') + .width('100%') + .height('100%') + + + } +} diff --git a/telephony/telephonyjstest/contact_performance/entry/src/main/ets/MainAbility/pages/Button.ets b/telephony/telephonyjstest/contact_performance/entry/src/main/ets/MainAbility/pages/Button.ets new file mode 100644 index 000000000..ac2271ea3 --- /dev/null +++ b/telephony/telephonyjstest/contact_performance/entry/src/main/ets/MainAbility/pages/Button.ets @@ -0,0 +1,70 @@ +/* + * 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 router from '@system.router' + +@Entry +@Component +struct button_testcase { + @State stateEffect: boolean = true + @State ButtonType: ButtonType = ButtonType.Circle + private content: string = "Button Page"; + + onPageShow() { + console.info('Button page show called'); + } + + onBuildDone() { + console.info('Button page build done called'); + } + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Text(`${this.content}`) + .fontSize(50) + .fontWeight(FontWeight.Bold) + Button('1.value', { type: ButtonType.Circle, stateEffect: this.stateEffect }) + .fontSize(12) + .fontWeight(FontWeight.Bold) + .fontColor(0xCCCCCC) + .height(40) + .width(40) + .key('button') + .backgroundColor('#0D9FFB') + .onClick(() => { + router.back() + }) + .padding(10) + Button() { + Text("2.Capsule") + } + .type(ButtonType.Capsule) + .stateEffect(false) + .backgroundColor('#0D9FFB') + .padding(10) + .key('button1') + + Button() { + Text("3.Normal") + }.type(ButtonType.Normal) + .backgroundColor('#0D9FFB') + .key('button2') + + }.key('flex') + .width('100%') + .height('100%') + } +} + diff --git a/telephony/telephonyjstest/contact_performance/entry/src/main/ets/MainAbility/pages/Column.ets b/telephony/telephonyjstest/contact_performance/entry/src/main/ets/MainAbility/pages/Column.ets new file mode 100644 index 000000000..b9e5c84e2 --- /dev/null +++ b/telephony/telephonyjstest/contact_performance/entry/src/main/ets/MainAbility/pages/Column.ets @@ -0,0 +1,51 @@ +/* + * 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. + */ + +@Entry +@Component +struct column { + @State active: boolean = false + private content: string = "Column Page" + + onPageShow() { + console.info('Column page show called'); + } + + onBuildDone() { + console.info('Column page build done called'); + } + + build() { + Column({ space: 5 }) { + Text('alignItems(Center)').fontSize(9).fontColor(0xCCCCCC).width('90%') + Column() { + Column().width('50%').height(50).backgroundColor(0xAFEEEE) + Column().width('50%').height(50).backgroundColor(0x00FFFF) + }.alignItems(HorizontalAlign.Center).width('90%').border({ width: 1 }).key('column') + + Text('alignItems(Start)').fontSize(9).fontColor(0xCCCCCC).width('90%') + Column({ space: '5' }) { + Column().width('50%').height(50).backgroundColor(0xAFEEEE) + Column().width('50%').height(50).backgroundColor(0x00FFFF) + }.alignItems(HorizontalAlign.Start).width('90%').border({ width: 1 }).key('column1') + + Text('alignItems(End)').fontSize(9).fontColor(0xCCCCCC).width('90%') + Column() { + Column().width('50%').height(50).backgroundColor(0xAFEEEE) + Column().width('50%').height(50).backgroundColor(0x00FFFF) + }.alignItems(HorizontalAlign.End).width('90%').border({ width: 1 }).key('column2') + }.width('100%').padding({ top: 5 }) + } +} diff --git a/telephony/telephonyjstest/contact_performance/entry/src/main/ets/MainAbility/pages/ColumnSplit.ets b/telephony/telephonyjstest/contact_performance/entry/src/main/ets/MainAbility/pages/ColumnSplit.ets new file mode 100644 index 000000000..cb0597310 --- /dev/null +++ b/telephony/telephonyjstest/contact_performance/entry/src/main/ets/MainAbility/pages/ColumnSplit.ets @@ -0,0 +1,70 @@ +/* + * 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. + */ + +@Entry +@Component +struct columnSplit { + private content: string = "ColumnSplit Page" + + onPageShow() { + console.info('ColumnSplit page show called'); + } + + onBuildDone() { + console.info('ColumnSplit page build done called'); + } + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Scroll() { + Column() { + Text(`${this.content}`) + .fontSize(50) + .fontWeight(FontWeight.Bold) + Column() { + Text('ColumnSplit').fontSize(9).fontColor(0xCCCCCC).width('90%') + ColumnSplit() { + Text('1').width('100%').height(50).backgroundColor(0xF5DEB3).textAlign(TextAlign.Center) + Text('2').width('100%').height(50).backgroundColor(0xD2B48C).textAlign(TextAlign.Center) + Text('3').width('100%').height(50).backgroundColor(0xF5DEB3).textAlign(TextAlign.Center) + Text('4').width('100%').height(50).backgroundColor(0xD2B48C).textAlign(TextAlign.Center) + Text('5').width('100%').height(50).backgroundColor(0xF5DEB3).textAlign(TextAlign.Center) + }.key('columnSplit') + .resizeable(true) + .width('90%').height('60%') + + }.width("100%") + + Column() { + Text('ColumnSplit1').fontSize(9).fontColor(0xCCCCCC).width('90%') + ColumnSplit() { + Text('1').width('100%').height(50).backgroundColor(0xF5DEB3).textAlign(TextAlign.Center) + Text('2').width('100%').height(50).backgroundColor(0xD2B48C).textAlign(TextAlign.Center) + Text('3').width('100%').height(50).backgroundColor(0xF5DEB3).textAlign(TextAlign.Center) + Text('4').width('100%').height(50).backgroundColor(0xD2B48C).textAlign(TextAlign.Center) + Text('5').width('100%').height(50).backgroundColor(0xF5DEB3).textAlign(TextAlign.Center) + }.key('columnSplit1') + .resizeable(false) + .width('90%').height('60%') + + }.width("100%") + } + } + } + .key('flex') + .width('100%') + .height('100%') + } +} diff --git a/telephony/telephonyjstest/contact_performance/entry/src/main/ets/MainAbility/pages/Counter.ets b/telephony/telephonyjstest/contact_performance/entry/src/main/ets/MainAbility/pages/Counter.ets new file mode 100644 index 000000000..ecdbfaf10 --- /dev/null +++ b/telephony/telephonyjstest/contact_performance/entry/src/main/ets/MainAbility/pages/Counter.ets @@ -0,0 +1,51 @@ +/* + * 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. + */ + +@Entry +@Component +struct counter { + @State value: number = 0 + @State active: boolean = false + private content: string = "Counter Page" + + onPageShow() { + console.info('Counter page show called'); + } + + onBuildDone() { + console.info('Counter page build done called'); + } + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Text(`${this.content}`) + .fontSize(50) + .fontWeight(FontWeight.Bold) + Counter() { + Text(this.value.toString()) + }.margin(100) + .key('counter') + .onInc(() => { + this.value++ + }) + .onDec(() => { + this.value-- + }) + }.width("100%") + .key('flex') + .width('100%') + .height('100%') + } +} diff --git a/telephony/telephonyjstest/contact_performance/entry/src/main/ets/MainAbility/pages/DataPanel.ets b/telephony/telephonyjstest/contact_performance/entry/src/main/ets/MainAbility/pages/DataPanel.ets new file mode 100644 index 000000000..3c6248484 --- /dev/null +++ b/telephony/telephonyjstest/contact_performance/entry/src/main/ets/MainAbility/pages/DataPanel.ets @@ -0,0 +1,69 @@ +/* + * 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 router from '@system.router' + +@Entry +@Component +struct dataPanel_testcase { + @State width: string= "200" + @State height: string= "100" + @State active: boolean = false + private content: string = "DataPanel Page" + + onPageShow() { + console.info('Blank page show called'); + } + + onBuildDone() { + console.info('Blank page build done called'); + } + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Text(`${this.content}`) + .fontSize(50) + DataPanel({ values: [20, 40, 20], max: 100, type: DataPanelType.Line }) + .width(this.width) + .height(this.height) + .key('DataPanel') + .onClick(() => { + router.back() + }) + .closeEffect(false) + + DataPanel({ values: [20, 40, 20], max: 100, type: DataPanelType.Circle}) + .width(this.width) + .height(this.height) + .key('DataPanel2') + .onClick(() => { + router.back() + }) + .closeEffect(true) + DataPanel({ values: [20, 40, 20], max: 100}) + .width(this.width) + .height(this.height) + .key('DataPanel3') + .onClick(() => { + router.back() + }) + .closeEffect(false) + } + .key('flex') + .width('100%') + .height('100%') + + } +} diff --git a/telephony/telephonyjstest/contact_performance/entry/src/main/ets/MainAbility/pages/Divider.ets b/telephony/telephonyjstest/contact_performance/entry/src/main/ets/MainAbility/pages/Divider.ets new file mode 100644 index 000000000..02bf60779 --- /dev/null +++ b/telephony/telephonyjstest/contact_performance/entry/src/main/ets/MainAbility/pages/Divider.ets @@ -0,0 +1,71 @@ +/* + * 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 router from '@system.router' + +@Entry +@Component +struct divider_textcase { + @State vertical: boolean = true + @State color: Color = Color.Red + @State strokeWidth: number = 7 + @State lineCap: LineCapStyle = LineCapStyle.Butt + @State active: boolean = false + private content: string = "Divider Page"; + + onPageShow() { + console.info('Button page show called'); + } + + onBuildDone() { + console.info('Button page build done called'); + } + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Text(`${this.content}`) + .fontSize(50) + Divider() + .lineCap(LineCapStyle.Butt) + .strokeWidth(this.strokeWidth) + .color(this.color) + .vertical(this.vertical) + .height(150) + .key('divider') + .onClick(() => { + router.back() + }) + Divider() + .lineCap(LineCapStyle.Round) + .vertical(false) + .color(Color.Green) + .strokeWidth(10) + .height(150) + .key('divider1') + Divider() + .lineCap(LineCapStyle.Square) + .color(Color.Green) + .vertical(true) + .strokeWidth(10) + .height(150) + .key('divider2') + } + .key('flex') + .width('100%') + .height('100%') + } +} + + diff --git a/telephony/telephonyjstest/contact_performance/entry/src/main/ets/MainAbility/pages/Flex.ets b/telephony/telephonyjstest/contact_performance/entry/src/main/ets/MainAbility/pages/Flex.ets new file mode 100644 index 000000000..a0e21251e --- /dev/null +++ b/telephony/telephonyjstest/contact_performance/entry/src/main/ets/MainAbility/pages/Flex.ets @@ -0,0 +1,135 @@ +/* + * 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. + */ + +@Entry +@Component +struct flex { + private content: string = "Flex Page" + + onPageShow() { + console.info('Flex page show called'); + } + + onBuildDone() { + console.info('Flex page build done called'); + } + + build() { + Column() { + Column({ space : 2 }) { + Text('direction:Column').fontSize(9).fontColor(0xCCCCCC).width('90%') + Flex({ + direction: FlexDirection.Column, + wrap: FlexWrap.NoWrap, + justifyContent: FlexAlign.Center, + alignItems:ItemAlign.Start, + alignContent: FlexAlign.Start, + }) { + Text('1').width('100%').height(20).backgroundColor(0xF5DEB3) + Text('2').width('100%').height(20).backgroundColor(0xD2B48C) + Text('3').width('100%').height(20).backgroundColor(0xF5DEB3) + } + .key('flex') + .height(70) + .width('90%') + .padding(10) + .backgroundColor(0xAFEEEE) + + Text('direction:Row').fontSize(9).fontColor(0xCCCCCC).width('90%') + Flex({ + direction: FlexDirection.Row, + wrap: FlexWrap.Wrap, + justifyContent: FlexAlign.Start, + alignItems:ItemAlign.Start, + alignContent: FlexAlign.Center, + }) { + Text('1').width('20%').height(20).backgroundColor(0xF5DEB3) + Text('2').width('20%').height(20).backgroundColor(0xD2B48C) + Text('3').width('20%').height(20).backgroundColor(0xF5DEB3) + } + .key('flex1') + .height(70) + .width('90%') + .padding(10) + .backgroundColor(0xAFEEEE) + + Text('direction:RowReverse').fontSize(9).fontColor(0xCCCCCC).width('90%') + Flex({ + direction: FlexDirection.RowReverse, + wrap: FlexWrap.Wrap, + justifyContent: FlexAlign.End, + alignItems:ItemAlign.End, + alignContent: FlexAlign.End, + }) { + Text('1').width('50%').height(20).backgroundColor(0xF5DEB3) + Text('2').width('50%').height(20).backgroundColor(0xD2B48C) + Text('3').width('50%').height(20).backgroundColor(0xF5DEB3) + } + .key('flex2') + .height(90) + .width('90%') + .padding(10) + .backgroundColor(0xAFEEEE) + + Text('justifyContent:SpaceBetween').fontSize(9).fontColor(0xCCCCCC).width('90%') + Flex({ + justifyContent: FlexAlign.SpaceBetween, + wrap: FlexWrap.Wrap, + }) { + Text('1').width('100%').height(20).backgroundColor(0xF5DEB3) + Text('2').width('100%').height(20).backgroundColor(0xD2B48C) + Text('3').width('100%').height(20).backgroundColor(0xF5DEB3) + } + .key('flex3') + .height(100) + .width('90%') + .padding(10) + .backgroundColor(0xAFEEEE) + + Text('justifyContent AND alignContent').fontSize(9).fontColor(0xCCCCCC).width('90%') + Flex({ + justifyContent: FlexAlign.SpaceEvenly, + alignContent: FlexAlign.SpaceEvenly, + wrap: FlexWrap.Wrap, + }) { + Text('1').width('50%').height(20).backgroundColor(0xF5DEB3) + Text('2').width('50%').height(20).backgroundColor(0xD2B48C) + Text('3').width('50%').height(20).backgroundColor(0xF5DEB3) + } + .key('flex4') + .height(90) + .width('90%') + .padding(10) + .backgroundColor(0xAFEEEE) + + Text('justifyContent AND alignContent').fontSize(9).fontColor(0xCCCCCC).width('90%') + Flex({ + justifyContent: FlexAlign.SpaceAround, + alignContent: FlexAlign.SpaceAround, + wrap: FlexWrap.Wrap, + }) { + Text('1').width('50%').height(20).backgroundColor(0xF5DEB3) + Text('2').width('50%').height(20).backgroundColor(0xD2B48C) + Text('3').width('50%').height(20).backgroundColor(0xF5DEB3) + } + .key('flex5') + .height(90) + .width('90%') + .padding(10) + .backgroundColor(0xAFEEEE) + }.width('100%').margin({ top: 5 }) + }.width('100%') + } +} diff --git a/telephony/telephonyjstest/contact_performance/entry/src/main/ets/MainAbility/pages/GridContainer.ets b/telephony/telephonyjstest/contact_performance/entry/src/main/ets/MainAbility/pages/GridContainer.ets new file mode 100644 index 000000000..573581104 --- /dev/null +++ b/telephony/telephonyjstest/contact_performance/entry/src/main/ets/MainAbility/pages/GridContainer.ets @@ -0,0 +1,170 @@ +/* + * 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. + */ + +@Entry +@Component +struct gridContainer { + @State sizeType: SizeType = SizeType.XS + @State active: boolean = false + private content: string = "GridContainer Page" + + onPageShow() { + console.info('GridContainer page show called'); + } + + onBuildDone() { + console.info('GridContainer page build done called'); + } + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Text(`${this.content}`) + .fontSize(50) + .fontWeight(FontWeight.Bold) + Scroll() { + Column({ space: 5 }) { + GridContainer({ columns: 12, sizeType: this.sizeType, gutter: 10, margin: 20 }) { + Row() { + Text('1') + .useSizeType({ + xs: { span: 6, offset: 0 }, + sm: { span: 2, offset: 0 }, + md: { span: 2, offset: 0 }, + lg: { span: 2, offset: 0 } + }) + .height(50).backgroundColor(0x4682B4).textAlign(TextAlign.Center) + Text('2').gridSpan(2) + + .height(50).backgroundColor(0x00BFFF).textAlign(TextAlign.Center) + Text('3').gridOffset(3) + + .height(50).backgroundColor(0x4682B4).textAlign(TextAlign.Center) + } + }.key('gridContainer') + .width('90%') + .alignItems(HorizontalAlign.Start) + + Text('Click Simulate to change the device width').fontSize(9).width('90%').fontColor(0xCCCCCC) + Row() { + Button('XS') + .onClick(() => { + this.sizeType = SizeType.XS + }).backgroundColor(0x317aff) + Button('SM') + .onClick(() => { + this.sizeType = SizeType.SM + }).backgroundColor(0x317aff) + Button('MD') + .onClick(() => { + this.sizeType = SizeType.MD + }).backgroundColor(0x317aff) + Button('LG') + .onClick(() => { + this.sizeType = SizeType.LG + }).backgroundColor(0x317aff) + } + + GridContainer({ columns: "auto", sizeType: SizeType.MD, gutter: '10', margin: '20' }) { + Row() { + Text('1') + .useSizeType({ + xs: { span: 6, offset: 0 }, + sm: { span: 2, offset: 0 }, + md: { span: 2, offset: 0 }, + lg: { span: 2, offset: 0 } + }) + .height(50).backgroundColor(0x4682B4).textAlign(TextAlign.Center) + Text('2').gridSpan(2) + + .height(50).backgroundColor(0x00BFFF).textAlign(TextAlign.Center) + Text('3').gridOffset(3) + + .height(50).backgroundColor(0x4682B4).textAlign(TextAlign.Center) + } + }.key('gridContainer1') + .width('90%') + .alignItems(HorizontalAlign.Center) + + GridContainer({ columns: 12, sizeType: SizeType.SM, gutter: 10, margin: 20 }) { + Row() { + Text('1') + .useSizeType({ + xs: { span: 6, offset: 0 }, + sm: { span: 2, offset: 0 }, + md: { span: 2, offset: 0 }, + lg: { span: 2, offset: 0 } + }) + .height(50).backgroundColor(0x4682B4).textAlign(TextAlign.Center) + Text('2').gridSpan(2) + + .height(50).backgroundColor(0x00BFFF).textAlign(TextAlign.Center) + Text('3').gridOffset(3) + + .height(50).backgroundColor(0x4682B4).textAlign(TextAlign.Center) + } + }.key('gridContainer2') + .width('90%') + .alignItems(HorizontalAlign.End) + + GridContainer({ columns: 12, sizeType: SizeType.LG, gutter: 10, margin: 20 }) { + Row() { + Text('1') + .useSizeType({ + xs: { span: 6, offset: 0 }, + sm: { span: 2, offset: 0 }, + md: { span: 2, offset: 0 }, + lg: { span: 2, offset: 0 } + }) + .height(50).backgroundColor(0x4682B4).textAlign(TextAlign.Center) + Text('2').gridSpan(2) + + .height(50).backgroundColor(0x00BFFF).textAlign(TextAlign.Center) + Text('3').gridOffset(3) + + .height(50).backgroundColor(0x4682B4).textAlign(TextAlign.Center) + } + }.key('gridContainer3') + .width('90%') + .alignItems(HorizontalAlign.End) + + GridContainer({ columns: 12, sizeType: SizeType.Auto, gutter: 10, margin: 20 }) { + Row() { + Text('1') + .useSizeType({ + xs: { span: 6, offset: 0 }, + sm: { span: 2, offset: 0 }, + md: { span: 2, offset: 0 }, + lg: { span: 2, offset: 0 } + }) + .height(50).backgroundColor(0x4682B4).textAlign(TextAlign.Center) + Text('2').gridSpan(2) + + .height(50).backgroundColor(0x00BFFF).textAlign(TextAlign.Center) + Text('3').gridOffset(3) + + .height(50).backgroundColor(0x4682B4).textAlign(TextAlign.Center) + } + }.key('gridContainer4') + .width('90%') + .alignItems(HorizontalAlign.End) + + }.width('100%').margin({ top: 5 }) + } + } + .key('flex') + .width('100%') + .height('100%') + } +} diff --git a/telephony/telephonyjstest/contact_performance/entry/src/main/ets/MainAbility/pages/Image.ets b/telephony/telephonyjstest/contact_performance/entry/src/main/ets/MainAbility/pages/Image.ets new file mode 100644 index 000000000..5cc583e93 --- /dev/null +++ b/telephony/telephonyjstest/contact_performance/entry/src/main/ets/MainAbility/pages/Image.ets @@ -0,0 +1,90 @@ +/* + * 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. + */ + +@Entry +@Component +struct image_textcase { + @State Width: number = 0 + @State height: number = 0 + + onPageShow() { + console.info('Image page show called'); + } + + onBuildDone() { + console.info('Image page build done called'); + } + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Column() { + Text(`Image page`) + .fontSize(50) + .fontWeight(FontWeight.Bold) + Image("/resources/rawfile/hand.png") + .matchTextDirection(false) + .fitOriginalSize(false) + .fillColor(0xCCCCCC) + .objectFit(ImageFit.Cover) + .objectRepeat(ImageRepeat.NoRepeat) + .interpolation(ImageInterpolation.None) + .renderMode(ImageRenderMode.Original) + .autoResize(false) + .syncLoad(false) + .sourceSize({ width: 200, height: 100 }) + .alt("/resources/rawfile/person.png") + .key('image1') + Image("/resources/rawfile/hand.png") + .objectFit(ImageFit.Contain) + .objectRepeat(ImageRepeat.X) + .interpolation(ImageInterpolation.High) + .renderMode(ImageRenderMode.Template) + .key('image2') + .height(180) + .width(180) + .onComplete((msg: { + width: number, + height: number + }) => { + this.Width = msg.width + this.height = msg.height + console.info('Width ----' + this.Width) + console.info('height ----' + this.height) + }) + .onError(() => { + console.info('load image fail') + }) + Image("/resources/rawfile/hand.png") + .objectFit(ImageFit.Fill) + .objectRepeat(ImageRepeat.Y) + .interpolation(ImageInterpolation.Low) + .key('image3') + Image("/resources/rawfile/hand.png") + .objectFit(ImageFit.None) + .objectRepeat(ImageRepeat.XY) + .interpolation(ImageInterpolation.Medium) + .key('image4') + Image("/resources/rawfile/hand.png") + .objectFit(ImageFit.ScaleDown) + .key('image5') + }.width(300) + .height(300) + .borderColor(Color.Pink) + .borderWidth(4) + } + } +} + + diff --git a/telephony/telephonyjstest/contact_performance/entry/src/main/ets/MainAbility/pages/Navigator.ets b/telephony/telephonyjstest/contact_performance/entry/src/main/ets/MainAbility/pages/Navigator.ets new file mode 100644 index 000000000..6c50769cf --- /dev/null +++ b/telephony/telephonyjstest/contact_performance/entry/src/main/ets/MainAbility/pages/Navigator.ets @@ -0,0 +1,60 @@ +/* + * 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. + */ + +@Entry +@Component +struct navigator_testcase { + @State active: boolean = false + @State params: Object = { text: 'news' } + + onPageShow() { + console.info('Navigator page show called'); + } + + onBuildDone() { + console.info('Navigator page build done called'); + } + + build() { + Column() { + Navigator({ target: "pages/index", type: NavigationType.Back }) { + Text('Navigator test in Navigator,back') + }.active(this.active) + .key('navigator') + .params({ + data: 24 + }) + + Navigator({ target: "pages/index", type: NavigationType.Push }) { + Text('Navigator test in Navigator,push') + }.active(this.active) + .key('navigator2') + .params({ + data: 24 + }) + + Navigator({ target: "pages/index", type: NavigationType.Replace }) { + Text('Navigator test in Navigator,replace') + }.active(this.active) + .key('navigator3') + .params({ + data: 24 + }) + }.width(300) + .height(300) + .borderColor(Color.Pink) + .borderWidth(2) + } +} diff --git a/telephony/telephonyjstest/contact_performance/entry/src/main/ets/MainAbility/pages/Panel.ets b/telephony/telephonyjstest/contact_performance/entry/src/main/ets/MainAbility/pages/Panel.ets new file mode 100644 index 000000000..32ddabbd1 --- /dev/null +++ b/telephony/telephonyjstest/contact_performance/entry/src/main/ets/MainAbility/pages/Panel.ets @@ -0,0 +1,96 @@ +/* + * 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. + */ + +@Entry +@Component +struct PanelExample { + @State show: boolean = true + + onPageShow() { + console.info('Panel page show called'); + } + + onBuildDone() { + console.info('Panel page build done called'); + } + + build() { + Column() { + Text('2021-09-30 Today Calendar: 1.afternoon......Click for details') + .width('90%') + .height(50) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + .padding({ left: 20 }) + .onClick(() => { + this.show = !this.show + }) + Panel(this.show) { + Column() { + Text('Today Calendar') + Divider() + Text('1. afternoon 4:00 The project meeting') + } + } + .key('panel') + .type(PanelType.Foldable) + .mode(PanelMode.Half) + .dragBar(true) + .fullHeight(500) + .halfHeight(250) + .miniHeight(100) + .onChange((value: any) => { + console.info(`width:${value.width},height:${value.height},mode:${value.mode}`) + }) + + Panel(this.show) { + Column() { + Text('Today Calendar') + Divider() + Text('1. afternoon 4:00 The project meeting') + } + } + .key('panel2') + .type(PanelType.Minibar) + .mode(PanelMode.Mini) + .dragBar(true) + .fullHeight(500) + .halfHeight(250) + .miniHeight(100) + .onChange((value: any) => { + console.info(`width:${value.width},height:${value.height},mode:${value.mode}`) + }) + + Panel(false) { + Column() { + Text('Today Calendar') + Divider() + Text('1. afternoon 4:00 The project meeting') + } + } + .key('panel3') + .type(PanelType.Temporary) + .mode(PanelMode.Full) + .dragBar(true) + .fullHeight(500) + .halfHeight(250) + .miniHeight(100) + .onChange((value: any) => { + console.info(`width:${value.width},height:${value.height},mode:${value.mode}`) + }) + + }.width('100%').height('50%').backgroundColor(0xDCDCDC).padding({ top: 5 }) + } +} \ No newline at end of file diff --git a/telephony/telephonyjstest/contact_performance/entry/src/main/ets/MainAbility/pages/Progress.ets b/telephony/telephonyjstest/contact_performance/entry/src/main/ets/MainAbility/pages/Progress.ets new file mode 100644 index 000000000..c8608089f --- /dev/null +++ b/telephony/telephonyjstest/contact_performance/entry/src/main/ets/MainAbility/pages/Progress.ets @@ -0,0 +1,76 @@ +/* + * 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. + */ + +@Entry +@Component +struct progress_testcase { + onPageShow() { + console.info('Progress page show called'); + } + + onBuildDone() { + console.info('Progress page build done called'); + } + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Column() { + Text(`Progress page`) + .fontSize(50) + .fontWeight(FontWeight.Bold) + Progress({ value: 20, total: 40, style: ProgressStyle.Linear }) + .value(3) + .color(Color.Blue) + .width(50) + .height(70) + .key('progress') + + Progress({ value: 20, total: 40, style: ProgressStyle.Eclipse }) + .value(3) + .color(Color.Blue) + .width(50) + .height(70) + .key('progress2') + + Progress({ value: 20, total: 40, style: ProgressStyle.Ring }) + .value(3) + .color(Color.Blue) + .width(50) + .height(70) + .key('progress3') + + Progress({ value: 20, total: 40, style: ProgressStyle.ScaleRing }) + .value(3) + .color(Color.Blue) + .width(50) + .height(70) + .key('progress4') + + Progress({ value: 20, total: 40, style: ProgressStyle.Capsule }) + .value(3) + .color(Color.Blue) + .width(50) + .height(70) + .key('progress5') + + } + .width(400) + .height(400) + .borderColor(Color.Pink) + .borderWidth(2) + } + } +} + diff --git a/telephony/telephonyjstest/contact_performance/entry/src/main/ets/MainAbility/pages/Qrcode.ets b/telephony/telephonyjstest/contact_performance/entry/src/main/ets/MainAbility/pages/Qrcode.ets new file mode 100644 index 000000000..5c0dd84ef --- /dev/null +++ b/telephony/telephonyjstest/contact_performance/entry/src/main/ets/MainAbility/pages/Qrcode.ets @@ -0,0 +1,44 @@ +/* + * 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. + */ + +@Entry +@Component +struct qrcode_textcase { + @State Color: Color = Color.Pink + + onPageShow() { + console.info('Qrcode page show called'); + } + + onBuildDone() { + console.info('Qrcode page build done called'); + } + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Text(`Qrcode page`) + .fontSize(50) + .fontWeight(FontWeight.Bold) + QRCode('hello world') + .color("#FFFFC0CB") + .backgroundColor(this.Color) + .width("200") + .height("100") + .key('qrcode') + } + } +} + + diff --git a/telephony/telephonyjstest/contact_performance/entry/src/main/ets/MainAbility/pages/Rating.ets b/telephony/telephonyjstest/contact_performance/entry/src/main/ets/MainAbility/pages/Rating.ets new file mode 100644 index 000000000..b29e26a39 --- /dev/null +++ b/telephony/telephonyjstest/contact_performance/entry/src/main/ets/MainAbility/pages/Rating.ets @@ -0,0 +1,63 @@ +/* + * 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. + */ + +@Entry +@Component +struct rating_testcase { + @State rating: number = 2 + + onPageShow() { + console.info('Rating page show called'); + } + + onBuildDone() { + console.info('Rating page build done called'); + } + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Column() { + Text(`Rating page`) + .fontSize(50) + .fontWeight(FontWeight.Bold) + Rating({ rating: 2, indicator: false }) + .stepSize(0.5) + .stars(5) + .starStyle({ + backgroundUri: '/resources/rawfile/star-1-1.png', + foregroundUri: '/resources/rawfile/star-1-3.png', + secondaryUri: '/resources/rawfile/star-1-2.png' + }) + .onChange((value: number) => { + this.rating = value + }) + .key('rating1') + Rating({ rating: 2, indicator: true }) + .stepSize(0.5) + .stars(5) + .starStyle({ + backgroundUri: '/resources/rawfile/star-1-1.png', + foregroundUri: '/resources/rawfile/star-1-3.png', + secondaryUri: '/resources/rawfile/star-1-2.png' + }) + .key('rating2') + }.width(300) + .height(300) + .borderColor(Color.Pink) + .borderWidth(2) + } + } +} + diff --git a/telephony/telephonyjstest/contact_performance/entry/src/main/ets/MainAbility/pages/RowSplit.ets b/telephony/telephonyjstest/contact_performance/entry/src/main/ets/MainAbility/pages/RowSplit.ets new file mode 100644 index 000000000..0f4f397b1 --- /dev/null +++ b/telephony/telephonyjstest/contact_performance/entry/src/main/ets/MainAbility/pages/RowSplit.ets @@ -0,0 +1,78 @@ +/* + * 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 router from '@system.router' + +@Entry +@Component +struct rowSplit_testcase { + @State resizeable: boolean = false + private content: string = "rowSplit Page"; + + onPageShow() { + console.info('RowSplit page show called'); + } + + onBuildDone() { + console.info('RowSplit page build done called'); + } + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Text(`${this.content}`) + .fontSize(50) + .fontWeight(FontWeight.Bold) + RowSplit() { + Column() { + Text('Demo1.RowSplit') + .fontSize(15) + .fontWeight(FontWeight.Bold) + } + + Column() { + Text('Demo2.RowSplit') + .fontSize(15) + .fontWeight(FontWeight.Bold) + } + } + .height(100) + .key('rowSplit') + .resizeable(this.resizeable) + .onClick(() => { + router.back() + }) + + RowSplit() { + Column() { + Text('Demo3.RowSplit') + .fontSize(15) + .fontWeight(FontWeight.Bold) + } + + Column() { + Text('Demo4.RowSplit') + .fontSize(15) + .fontWeight(FontWeight.Bold) + } + }.height(100) + .key('rowSplit1') + .resizeable(true) + } + .key('flex') + .width('100%') + .height('100%') + } +} + diff --git a/telephony/telephonyjstest/contact_performance/entry/src/main/ets/MainAbility/pages/Scroll.ets b/telephony/telephonyjstest/contact_performance/entry/src/main/ets/MainAbility/pages/Scroll.ets new file mode 100644 index 000000000..363089d22 --- /dev/null +++ b/telephony/telephonyjstest/contact_performance/entry/src/main/ets/MainAbility/pages/Scroll.ets @@ -0,0 +1,200 @@ +/* + * 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. + */ + +@Entry +@Component +struct scroll_testcase { + @State scrollBarWidth: number = 20 + @State scrollable: ScrollDirection = ScrollDirection.None + @State scrollBarColor: Color = Color.Pink + @State scrollBar: BarState= BarState.On + private value1: Array = [1, 2, 3, 4, 5, 6, 7, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30] + @State edge: Edge= Edge.Top + private content: string = "Scroll Page"; + scroller: Scroller = new Scroller(); + + onPageShow() { + console.info('Button page show called'); + } + + onBuildDone() { + console.info('Button page build done called'); + } + + build() { + + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Text(`${this.content}`) + .fontSize(50) + .fontWeight(FontWeight.Bold) + Scroll(this.scroller) { + Column() { + ForEach( + this.value1, + item => { + Text(`${item}`) + .fontSize(15) + .width(400) + .margin(10) + .height(70) + .backgroundColor(0xfff5deb3) + }, + item => item + ) + } + } + .scrollable(ScrollDirection.Vertical) + .scrollBar(this.scrollBar) + .scrollBarColor(this.scrollBarColor) + .scrollBarWidth(this.scrollBarWidth) + .key('scroll') + .width(400) + .height(200) + .onScroll((xOffset: number, yOffset: number) => { + console.info(` current offset is ${xOffset} ${yOffset}`) + }) + .onScrollEnd(() => { + console.info(` now on scroll end`) + }) + .onScrollEdge((side: Edge) => { + console.info(`To the edge`) + }) + Scroll() { + Row() { + Text('scroll uppppp') + .width(60) + .height(100) + .backgroundColor(Color.Yellow) + .margin({ + right: 5, + left: 5 + }) + .key('text') + + Text('scroll to') + .width(60) + .height(100) + .backgroundColor(Color.Green) + .margin({ + right: 5, + left: 5 + }) + .onClick(() => { + this.scroller.scrollTo({ + xOffset: 100, + yOffset: 100, + }) + }) + Text('scroll page') + .width(60) + .height(100) + .backgroundColor(Color.Blue) + .margin({ + right: 5, + left: 5 + }) + .onClick(() => { + this.scroller.scrollPage({ + next: true + }) + }) + Text('scroll Edge') + .width(60) + .height(100) + .backgroundColor(Color.Blue) + .margin({ + right: 5, + left: 5 + }) + .onClick(() => { + this.scroller.scrollEdge(Edge.Top) + }) + Text('scroll Edge') + .width(60) + .height(100) + .backgroundColor(Color.Blue) + .margin({ + right: 5, + left: 5 + }) + .onClick(() => { + this.scroller.currentOffset() + }) + Text('scroll to index') + .width(60) + .height(100) + .backgroundColor(Color.Blue) + .margin({ + right: 5, + left: 5 + }) + .onClick(() => { + this.scroller.scrollToIndex(0) + console.info(` now on scroll end`) + }) + } + } + .key('scroll1') + .height(100) + .scrollable(ScrollDirection.Horizontal) + + Scroll() { + Column() { + Text("start").fontSize(30) + Text("scrollable1") + Text("scrollable2") + Text("scrollable3") + Text("scrollable4") + Text("scrollable1") + Text("scrollable2") + Text("scrollable3") + Text("scrollable4") + } + } + .padding(10) + .scrollable(ScrollDirection.None) + .scrollBar(BarState.Off) + .scrollBarColor(Color.Red) + .scrollBarWidth(5) + .width(300) + .height(200) + .key('scroll2') + + Scroll() { + Column() { + Text("start").fontSize(30) + Text("scrollable1") + Text("scrollable2") + Text("scrollable3") + Text("scrollable4") + Text("scrollable1") + Text("scrollable2") + Text("scrollable3") + Text("scrollable4") + } + } + .padding(10) + .scrollable(ScrollDirection.Free) + .scrollBar(BarState.Off) + .scrollBarColor(Color.Red) + .scrollBarWidth(5) + .width(300) + .height(200) + .key('scroll3') + } + .key('flex') + + } +} diff --git a/telephony/telephonyjstest/contact_performance/entry/src/main/ets/MainAbility/pages/Slider.ets b/telephony/telephonyjstest/contact_performance/entry/src/main/ets/MainAbility/pages/Slider.ets new file mode 100644 index 000000000..625cd0287 --- /dev/null +++ b/telephony/telephonyjstest/contact_performance/entry/src/main/ets/MainAbility/pages/Slider.ets @@ -0,0 +1,82 @@ +/* + * 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. + */ + +@Entry +@Component +struct slider { + @State inSetValue: number= 40 + @State outSetValue: number= 40 + @State direction: Axis= Axis.Horizontal + @State Begin: number = SliderChangeMode.Begin + + onPageShow() { + console.info('Slider page show called'); + } + + onBuildDone() { + console.info('Slider page build done called'); + } + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Column() { + Text(`Slider page`) + .fontSize(50) + .fontWeight(FontWeight.Bold) + Slider({ + value: this.outSetValue, + min: 0, + max: 100, + step: 1, + direction: Axis.Horizontal, + reverse: false, + style: SliderStyle.OutSet + }) + .blockColor('#FFFF0000') + .selectedColor('#FF0000FF') + .trackColor('#FF808080') + .minLabel('10') + .maxLabel('10') + .showTips(false) + .showSteps(false) + .onChange((value: number, mode: SliderChangeMode) => { + this.outSetValue = value + this.Begin = mode + console.info('value: ' + value + '---mode: ' + mode) + }) + .width("100") + .height("100") + .key('slider1') + Slider({ + value: 40, + min: 0, + max: 100, + step: 1, + style: SliderStyle.InSet + }) + .blockColor(Color.Red) + .selectedColor(Color.Blue) + .trackColor(Color.Gray) + .showTips(true) + .showSteps(true) + .key('slider2') + }.width(300) + .height(300) + .borderColor(Color.Pink) + .borderWidth(2) + } + } +} + diff --git a/telephony/telephonyjstest/contact_performance/entry/src/main/ets/MainAbility/pages/Span.ets b/telephony/telephonyjstest/contact_performance/entry/src/main/ets/MainAbility/pages/Span.ets new file mode 100644 index 000000000..df5a71043 --- /dev/null +++ b/telephony/telephonyjstest/contact_performance/entry/src/main/ets/MainAbility/pages/Span.ets @@ -0,0 +1,64 @@ +/* + * 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. + */ + +@Entry +@Component +struct span_textcase { + + onPageShow() { + console.info('Span page show called'); + } + + onBuildDone() { + console.info('Span page build done called'); + } + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Column() { + Text() { + Span('Test Span demo') + .decoration({ type: TextDecorationType.LineThrough, "color": Color.Red }) + .textCase(TextCase.UpperCase) + .fontColor(Color.Blue) + .fontSize("20fp") + .letterSpacing(5) + .fontFamily("sans-serif") + .fontWeight(FontWeight.Bold) + .fontStyle(FontStyle.Italic) + .key('span1') + Span('The second test Span demo') + .textCase(TextCase.LowerCase) + .fontColor(Color.Black) + .letterSpacing('5') + .fontSize(30) + .key('span2') + Span('The third test Span demo') + .textCase(TextCase.Normal) + .fontColor(Color.Yellow) + .fontSize("30fp") + .key('span3') + } + } + .width(300) + .height(300) + .borderColor(Color.Pink) + .borderWidth(4) + } + } +} + + + diff --git a/telephony/telephonyjstest/contact_performance/entry/src/main/ets/MainAbility/pages/Stack.ets b/telephony/telephonyjstest/contact_performance/entry/src/main/ets/MainAbility/pages/Stack.ets new file mode 100644 index 000000000..2a694889f --- /dev/null +++ b/telephony/telephonyjstest/contact_performance/entry/src/main/ets/MainAbility/pages/Stack.ets @@ -0,0 +1,103 @@ +/* + * 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 router from '@system.router' + +@Entry +@Component +struct stack_testcase { + @State alignContent: Alignment = Alignment.Bottom + private content: string = "Stack Page"; + + onPageShow() { + console.info('Stack page show called'); + } + + onBuildDone() { + console.info('Stack page build done called'); + } + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Text(`${this.content}`) + .fontSize(50) + .fontWeight(FontWeight.Bold) + Stack({ alignContent: this.alignContent }) { + Text('First child, show in bottom').width('90%').height('100%').backgroundColor(0xd2cab3).align(Alignment.Top) + Text('Second child, show in top').width('70%').height('60%').backgroundColor(0xc1cbac).align(Alignment.Top) + } + .width('100%') + .height(80) + .margin({ top: 5 }) + .key('stack') + .onClick(() => { + router.back() + }) + + Stack({ alignContent: Alignment.BottomStart }) { + Text('First child, show in bottom').width('90%').height('100%').backgroundColor(0xd2cab3).align(Alignment.Top) + Text('Second child, show in top').width('70%').height('60%').backgroundColor(0xc1cbac).align(Alignment.Top) + }.width('100%').height(80).margin({ top: 5 }) + .key('stack1') + + Stack({ alignContent: Alignment.BottomEnd }) { + Text('First child, show in bottom').width('90%').height('100%').backgroundColor(0xd2cab3).align(Alignment.Top) + Text('Second child, show in top').width('70%').height('60%').backgroundColor(0xc1cbac).align(Alignment.Top) + }.width('100%').height(80).margin({ top: 5 }) + .key('stack2') + + Stack({ alignContent: Alignment.Start }) { + Text('First child, show in bottom').width('90%').height('100%').backgroundColor(0xd2cab3).align(Alignment.Top) + Text('Second child, show in top').width('70%').height('60%').backgroundColor(0xc1cbac).align(Alignment.Top) + }.width('100%').height(80).margin({ top: 5 }) + .key('stack3') + + Stack({ alignContent: Alignment.Center }) { + Text('First child, show in bottom').width('90%').height('100%').backgroundColor(0xd2cab3).align(Alignment.Top) + Text('Second child, show in top').width('70%').height('60%').backgroundColor(0xc1cbac).align(Alignment.Top) + }.width('100%').height(80).margin({ top: 5 }) + .key('stack4') + + Stack({ alignContent: Alignment.End }) { + Text('First child, show in bottom').width('90%').height('100%').backgroundColor(0xd2cab3).align(Alignment.Top) + Text('Second child, show in top').width('70%').height('60%').backgroundColor(0xc1cbac).align(Alignment.Top) + }.width('100%').height(80).margin({ top: 5 }) + .key('stack5') + + Stack({ alignContent: Alignment.Top }) { + Text('First child, show in bottom').width('90%').height('100%').backgroundColor(0xd2cab3).align(Alignment.Top) + Text('Second child, show in top').width('70%').height('60%').backgroundColor(0xc1cbac).align(Alignment.Top) + }.width('100%').height(60).margin({ top: 5 }) + .key('stack6') + + Stack({ alignContent: Alignment.TopStart }) { + Text('First child, show in bottom').width('90%').height('100%').backgroundColor(0xd2cab3).align(Alignment.Top) + Text('Second child, show in top').width('70%').height('60%').backgroundColor(0xc1cbac).align(Alignment.Top) + }.width('100%').height(60).margin({ top: 5 }) + .key('stack7') + + Stack({ alignContent: Alignment.TopEnd }) { + Text('First child, show in bottom').width('90%').height('100%').backgroundColor(0xd2cab3).align(Alignment.Top) + Text('Second child, show in top').width('70%').height('60%').backgroundColor(0xc1cbac).align(Alignment.Top) + }.width('100%').height(60).margin({ top: 5 }) + .key('stack8') + } + .key('flex') + .width('100%') + .height('100%') + + } +} + diff --git a/telephony/telephonyjstest/contact_performance/entry/src/main/ets/MainAbility/pages/Text.ets b/telephony/telephonyjstest/contact_performance/entry/src/main/ets/MainAbility/pages/Text.ets new file mode 100644 index 000000000..fbd1415dc --- /dev/null +++ b/telephony/telephonyjstest/contact_performance/entry/src/main/ets/MainAbility/pages/Text.ets @@ -0,0 +1,237 @@ +/* + * 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. + */ + +// @ts-nocheck +import router from '@system.router' + +var paramInfo = router.getParams() +console.info("cd paramInfo" + JSON.stringify(paramInfo)) + +@Entry +@Component +struct text_textcase { + @State textAlign: TextAlign= TextAlign.End + @State lineHeight: string= '15fp' + @State overflow: TextOverflow = TextOverflow.Ellipsis + @State textOverflow: textOverflow<{ "overflow": TextOverflow }> = { "overflow": this.overflow } + @State maxLines: number = 2 + @State baselineOffset: number = 0 + @State textCase: TextCase= TextCase.Normal + @State decoration: decoration<{ + type: TextDecorationType, + color: Color + }> = { type: TextDecorationType.Underline, color: Color.Red } + @State color: Color = Color.Red + @State width: string= "200" + @State height: string= "100" + @State size: size = { width: 200, height: 100 } + @State marginBottom: string = "10px" + @State marginTop: string = "10px" + @State marginLeft: string = "10px" + @State marginRingt: string= "10px" + @State paddingBottom: string= "5" + @State paddingTop: string= "5" + @State paddingLeft: string= "5" + @State paddingRingt: string= "5" + @State constraintSize: constraintSize = { minWidth: 20, maxWidth: 200, minHeight: 0, maxHeight: 50 } + @State layoutPriority: string= "9px" + @State layoutWeight: string = "10px" + @State align: Alignment = Alignment.Center + @State direction: Direction = Direction.Auto + @State position: position<{ + x: string, + y: string + }> = { x: "50", y: "50" } + @State markAnchor: markAnchor<{ + x: string, + y: string + }> = { x: "50", y: "50" } + @State offset: offset<{ + x: string, + y: string + }> = { x: "50", y: "50" } + @State flexGrow: number = 5 + @State flexShrink: number = 2 + @State flexBasis: number = 0 + @State alignSelf: ItemAlign = ItemAlign.Auto + @State borderStyle: BorderStyle = BorderStyle.Dashed + @State borderRadius: number = 10 + @State borderWidth: string= "4px" + @State borderColor: Color= Color.Blue + @State backgroundColor: Color = Color.Pink + @State backgroundImageSize: ImageSize = ImageSize.Cover + @State backgroundImagePosition: Alignment= Alignment.Center + @State opacity: number= 1 + @State visibility: Visibility= Visibility.Visible + @State enabled: boolean = false + @State zIndex: number = 1 + @State fontStyle: FontStyle = FontStyle.Italic + @State fontSize: number = 15 + @State minFontSize: number = 15 + @State maxFontSize: number = 15 + @State letterSpacing: number= 10 + @State fontWeight: FontWeight= FontWeight.Bold + @State fontColor: Color= Color.Black + @State active: boolean = false + private content: string = "Text Page"; + + onPageShow() { + console.info('Text page show called'); + } + + onBuildDone() { + console.info('Text page build done called'); + } + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Text(`${this.content}`) + .fontSize(50) + .fontWeight(FontWeight.Bold) + Text('Text Anto test,Text Anto test,Text Anto test,Text Anto test,test,Text Anto test,Text Anto test,Text Anto test,Text Anto test,Text Anto test,Text Anto test') + .width(this.width) + .height(this.height) + .padding({ bottom: this.paddingBottom, top: this.paddingTop, right: this.paddingRingt, left: this.paddingLeft }) + .margin({ bottom: this.marginBottom, top: this.marginTop, right: this.marginRingt, left: this.marginLeft }) + .constraintSize(this.constraintSize) + .layoutWeight(this.layoutWeight) + .align(this.align) + .direction(this.direction) + .position(this.position) + .markAnchor(this.markAnchor) + .offset(this.offset) + .flexBasis(this.flexBasis) + .flexGrow(this.flexGrow) + .flexShrink(this.flexShrink) + .alignSelf(this.alignSelf) + .borderStyle(this.borderStyle) + .borderRadius(this.borderRadius) + .borderWidth(this.borderWidth) + .borderColor(this.borderColor) + .backgroundColor(this.backgroundColor) + .opacity(this.opacity) + .visibility(this.visibility) + .enabled(this.enabled) + .zIndex(this.zIndex) + .fontColor(this.fontColor) + .fontSize(this.fontSize) + .minFontSize(this.minFontSize) + .letterSpacing(this.letterSpacing) + .maxFontSize(this.maxFontSize) + .fontWeight(this.fontWeight) + .fontStyle(this.fontStyle) + .fontFamily("sans-serif") + .textAlign(this.textAlign) + .textOverflow(this.textOverflow) + .lineHeight(this.lineHeight) + .baselineOffset(this.baselineOffset) + .maxLines(2) + .textCase(this.textCase) + .decoration(this.decoration) + .aspectRatio(1) + .fontColor(Color.Black) + .key('Text') + Text('Text Anto test,Text Anto test,Text Anto test,Text Anto test,Text Anto test,Text Anto test,Text Anto test,Text Anto test') + .size({ width: 100, height: 50 }) + .padding({ bottom: 5, top: 5, right: 5, left: 10 }) + .margin({ bottom: 15, top: 10, right: 10, left: 10 }) + .fontSize('13') + .textAlign(TextAlign.Start) + .align(Alignment.Start) + .direction(Direction.Ltr) + .alignSelf(ItemAlign.Start) + .borderStyle(BorderStyle.Dotted) + .borderWidth(2) + .visibility(Visibility.Hidden) + .enabled(true) + .fontWeight(FontWeight.Normal) + .textAlign(TextAlign.Start) + .textOverflow(TextOverflow.Clip) + .maxLines(2) + .textCase(TextCase.LowerCase) + .decoration({ "type": TextDecorationType.LineThrough, "color": Color.Red }) + .fontColor(Color.White) + .key('Text1') + Text('Text Anto test,Text Anto test,Text Anto test,Text Anto test,Text Anto test,Text Anto test,Text Anto test,Text Anto test,Text Anto test') + .fontSize(13) + .width('100%') + .textAlign(TextAlign.Center) + .align(Alignment.TopEnd) + .direction(Direction.Rtl) + .alignSelf(ItemAlign.Center) + .borderStyle(BorderStyle.Solid) + .borderWidth(2) + .visibility(Visibility.None) + .fontWeight(FontWeight.Bolder) + .textAlign(TextAlign.Center) + .textOverflow(TextOverflow.None) + .textCase(TextCase.UpperCase) + .decoration({ "type": TextDecorationType.None, "color": Color.Red }) + .fontColor(Color.Blue) + .key('Text2') + Text('Text Anto test,Text Anto test,Text Anto test,Text Anto test') + .fontSize(13) + .align(Alignment.Top) + .alignSelf(ItemAlign.End) + .borderWidth(2) + .width('100%') + .fontWeight(FontWeight.Lighter) + .decoration({ type: TextDecorationType.Overline, color: Color.Red }) + .fontColor(Color.Gray) + .key('Text3') + Text('Text Anto test,Text Anto test') + .fontSize(13) + .align(Alignment.TopStart) + .alignSelf(ItemAlign.Baseline) + .borderWidth(2) + .width('100%') + .fontWeight(FontWeight.Medium) + .fontColor(Color.Brown) + .key('Text4') + Text('Text Anto test,Text Anto test,Text Anto test') + .fontSize(13) + .align(Alignment.End) + .alignSelf(ItemAlign.Stretch) + .borderWidth(2) + .width('100%') + .fontWeight(FontWeight.Regular) + .fontColor(Color.Grey) + .key('Text5') + Text('Text Anto test,Text Anto test,Text Anto test') + .fontSize(13) + .align(Alignment.BottomEnd) + .width('100%') + .fontColor(Color.Orange) + .key('Text6') + Text('Text Anto test,Text Anto test,Text Anto test') + .fontSize(13) + .align(Alignment.Bottom) + .width('100%') + .fontColor(Color.Yellow) + .key('Text7') + Text('Text Anto test,Text Anto test,Text Anto test') + .fontSize(13) + .align(Alignment.BottomStart) + .width('100%') + .key('Text8') + + } + .key('flex') + .width('100%') + .height('100%') + } +} + + diff --git a/telephony/telephonyjstest/contact_performance/entry/src/main/ets/MainAbility/pages/index.ets b/telephony/telephonyjstest/contact_performance/entry/src/main/ets/MainAbility/pages/index.ets new file mode 100644 index 000000000..10359134d --- /dev/null +++ b/telephony/telephonyjstest/contact_performance/entry/src/main/ets/MainAbility/pages/index.ets @@ -0,0 +1,65 @@ +// @ts-nocheck +/** + * 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 file from '@system.file'; + +import {Core, ExpectExtend, InstrumentLog, ReportExtend} from "deccjsunit/index.ets"; +import testsuite from "../test/List.test.ets"; +import featureAbility from "@ohos.ability.featureAbility"; + +@Entry +@Component +struct MyComponent { + aboutToAppear() { + console.info("start run testcase!!!!") + featureAbility.getWant() + .then((Want) => { + const core = Core.getInstance(); + const expectExtend = new ExpectExtend({ + 'id': 'extend' + }); + core.addService('expect', expectExtend); + const reportExtend = new ReportExtend(file); + core.addService('report', reportExtend); + core.init(); + core.subscribeEvent('task', reportExtend); + const configService = core.getDefaultService('config'); + Want.parameters['timeout'] = 100000 + console.info('parameters---->' + JSON.stringify(Want.parameters)); + configService.setConfig(Want.parameters); + testsuite(); + core.execute(); + console.info('Operation successful. Data: ' + JSON.stringify(Want)); + }) + .catch((error) => { + console.error('Operation failed. Cause: ' + JSON.stringify(error)); + }) + } + + build() { + Flex({ + direction: FlexDirection.Column, + alignItems: ItemAlign.Center, + justifyContent: FlexAlign.Center + }) { + Text('ACE ETS TEST') + .fontSize(50) + .fontWeight(FontWeight.Bold) + } + .width('100%') + .height('100%') + } +} + diff --git a/telephony/telephonyjstest/contact_performance/entry/src/main/ets/MainAbility/test/List.test.ets b/telephony/telephonyjstest/contact_performance/entry/src/main/ets/MainAbility/test/List.test.ets new file mode 100644 index 000000000..19c443805 --- /dev/null +++ b/telephony/telephonyjstest/contact_performance/entry/src/main/ets/MainAbility/test/List.test.ets @@ -0,0 +1,22 @@ +/** + * 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. + */ + +//contact import +import PerformanceTest from './contact/Performance_test.js' + +export default function testsuite() { + //contact + PerformanceTest(); +} \ No newline at end of file diff --git a/telephony/telephonyjstest/contact_performance/entry/src/main/ets/MainAbility/test/Utils.ets b/telephony/telephonyjstest/contact_performance/entry/src/main/ets/MainAbility/test/Utils.ets new file mode 100644 index 000000000..65f70088d --- /dev/null +++ b/telephony/telephonyjstest/contact_performance/entry/src/main/ets/MainAbility/test/Utils.ets @@ -0,0 +1,119 @@ +// @ts-nocheck +/** + * 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 class Utils { + static rect_left; + static rect_top; + static rect_right; + static rect_bottom; + static rect_value; + static notCheck = true; + + static sleep(time) { + return new Promise((resolve, reject) => { + setTimeout(() => { + resolve() + }, time) + }).then(() => { + console.info(`sleep ${time} over...`) + }) + } + + static getComponentRect(key) { + let strJson = getInspectorByKey(key); + let obj = JSON.parse(strJson); + console.info("[getInspectorByKey] current component obj is: " + JSON.stringify(obj)); + let rectInfo = JSON.parse('[' + obj.$rect + ']') + console.info("[getInspectorByKey] rectInfo is: " + rectInfo); + this.rect_left = JSON.parse('[' + rectInfo[0] + ']')[0] + this.rect_top = JSON.parse('[' + rectInfo[0] + ']')[1] + this.rect_right = JSON.parse('[' + rectInfo[1] + ']')[0] + this.rect_bottom = JSON.parse('[' + rectInfo[1] + ']')[1] + return this.rect_value = { + "left": this.rect_left, "top": this.rect_top, "right": this.rect_right, "bottom": this.rect_bottom + } + } + + static async swipe(downX, downY, upX, upY, steps) { + console.info('start to swipe') + this.drags(downX, downY, upX, upY, steps, false) + } + + static async drag(downX, downY, upX, upY, steps) { + console.info('start to drag') + this.drags(downX, downY, upX, upY, steps, true) + } + + static async drags(downX, downY, upX, upY, steps, drag) { + var xStep; + var yStep; + var swipeSteps; + var ret; + xStep = 0; + yStep = 0; + ret = false; + swipeSteps = steps; + if (swipeSteps == 0) { + swipeSteps = 1; + } + xStep = (upX - downX) / swipeSteps; + yStep = (upY - downY) / swipeSteps; + console.info('move step is: ' + 'xStep: ' + xStep + ' yStep: ' + yStep) + var downPonit: TouchObject = { + id: 1, + x: downX, + y: downY, + type: TouchType.Down, + } + console.info('down touch started: ' + JSON.stringify(downPonit)) + sendTouchEvent(downPonit); + console.info('start to move') + if (drag) { + await this.sleep(500) + } + for (var i = 1;i <= swipeSteps; i++) { + var movePoint: TouchObject = { + id: 1, + x: downX + (xStep * i), + y: downY + (yStep * i), + type: TouchType.Move + } + console.info('move touch started: ' + JSON.stringify(movePoint)) + ret = sendTouchEvent(movePoint) + if (ret == false) { + break; + } + await this.sleep(5) + } + console.info('start to up') + if (drag) { + await this.sleep(100) + } + var upPoint: TouchObject = { + id: 1, + x: upX, + y: upY, + type: TouchType.Up, + } + console.info('up touch started: ' + JSON.stringify(upPoint)) + sendTouchEvent(upPoint) + await this.sleep(500) + } +} + + + + diff --git a/telephony/telephonyjstest/contact_performance/entry/src/main/ets/MainAbility/test/contact/Performance_test.js b/telephony/telephonyjstest/contact_performance/entry/src/main/ets/MainAbility/test/contact/Performance_test.js new file mode 100644 index 000000000..f54c33bbf --- /dev/null +++ b/telephony/telephonyjstest/contact_performance/entry/src/main/ets/MainAbility/test/contact/Performance_test.js @@ -0,0 +1,627 @@ +/* + * 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 featureAbility from '@ohos.ability.featureAbility'; +import ohosDataAbility from '@ohos.data.dataability'; +import utils from '../Utils.ets' +import {afterAll, afterEach, beforeAll, beforeEach, describe, expect, it} from 'deccjsunit/index' + +const URI_CALLLOG = "dataability:///com.ohos.calllogability"; +const calllogUri = "dataability:///com.ohos.calllogability/calls/calllog"; +const URI_VOICEMAIL = "dataability:///com.ohos.voicemailability"; +const voicemailUri = "dataability:///com.ohos.voicemailability/calls/voicemail"; +const URI_CONTACTS = "dataability:///com.ohos.contactsdataability"; +const rawContactUri = "dataability:///com.ohos.contactsdataability/contacts/raw_contact"; +const contactDataUri = "dataability:///com.ohos.contactsdataability/contacts/contact_data"; +const deletedUri = "dataability:///com.ohos.contactsdataability/contacts/deleted_raw_contact"; + +export default function PerformanceTest() { + describe('PerformanceTest', function () { + console.log(' PerformanceTest is start'); + + function sleep(numberMillis) { + var now = new Date(); + var exitTime = now.getTime() + numberMillis; + while (true) { + now = new Date(); + if (now.getTime() > exitTime) + return; + } + } + + /** + * @tc.number raw_contact_insert_performance_test_900 + * @tc.name The raw_contact table adds 10000 pieces of data, and the time consumption is calculated according to + * the running time of the use case + * @tc.desc Function test + */ + it("raw_contact_insert_performance_test_900", 0, async function (done) { + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + var listAddBluk = []; + for (var i = 0; i < 1000; i++) { + var add = { + "display_name": "xiaoli" + i, "company": "testCompany" + i, "position": "testPosition" + i + }; + listAddBluk[i] = add; + } + try { + let old = new Date(); + var batchInsertCode = await DAHelper.batchInsert(rawContactUri, listAddBluk); + var batchInsertCode = await DAHelper.batchInsert(rawContactUri, listAddBluk); + var batchInsertCode = await DAHelper.batchInsert(rawContactUri, listAddBluk); + var batchInsertCode = await DAHelper.batchInsert(rawContactUri, listAddBluk); + var batchInsertCode = await DAHelper.batchInsert(rawContactUri, listAddBluk); + var batchInsertCode = await DAHelper.batchInsert(rawContactUri, listAddBluk); + var batchInsertCode = await DAHelper.batchInsert(rawContactUri, listAddBluk); + var batchInsertCode = await DAHelper.batchInsert(rawContactUri, listAddBluk); + var batchInsertCode = await DAHelper.batchInsert(rawContactUri, listAddBluk); + var batchInsertCode = await DAHelper.batchInsert(rawContactUri, listAddBluk); + let now = new Date(); + let usedTime = now - old; + console.info('raw_contact_insert_performance_test_900 usedTime = ' + usedTime); + expect(usedTime < 70000).assertTrue(); + sleep(5000); + console.info("logMessage raw_contact_insert_performance_test_900: batchInsertCode = " + batchInsertCode); + expect(batchInsertCode == 0).assertTrue(); + done(); + } catch (error) { + console.info('logMessage raw_contact_insert_performance_test_900: insert error = ' + error); + done(); + } + }); + + /** + * @tc.number raw_contact_update_performance_test_1000 + * @tc.name The raw_contact table updates data whose ID is not equal to 0, and the time consumption is calculated + * according to the running time of the use case + * @tc.desc Function test + */ + it("raw_contact_update_performance_test_1000", 0, async function (done) { + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + var updateValues = { + "favorite": 1 + }; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.greaterThan("id", "0"); + condition.and(); + condition.equalTo("is_deleted", "0"); + try { + let old = new Date(); + var updateCode = await DAHelper.update(rawContactUri, updateValues, condition); + let now = new Date(); + let usedTime = now - old; + console.info('raw_contact_update_performance_test_1000 usedTime = ' + usedTime); + expect(usedTime < 3000).assertTrue(); + sleep(5000); + console.info("logMessage raw_contact_update_performance_test_1000: updateCode = " + updateCode); + expect(updateCode == 0).assertTrue(); + done(); + } catch (error) { + console.info("logMessage raw_contact_update_performance_test_1000: update error = " + error); + done(); + } + }); + + /** + * @tc.number raw_contact_query_performance_test_1100 + * @tc.name The raw_ contact table queries 10000 pieces of data and calculates the time consumption according to + * the running time of the use case + * @tc.desc Function test + */ + it("raw_contact_query_performance_test_1100", 0, async function (done) { + var tag = "raw_contact_query_performance_test_1100"; + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info(tag + ': start ! DAHelper = ' + DAHelper); + var resultColumns = []; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.greaterThan("id", "0"); + condition.and(); + condition.equalTo("is_deleted", "0"); + try { + let old = new Date(); + var resultSet = await DAHelper.query(rawContactUri, resultColumns, condition); + let now = new Date(); + let usedTime = now - old; + console.info('raw_contact_query_performance_test_1100 usedTime = ' + usedTime); + expect(usedTime < 2000).assertTrue(); + sleep(5000); + console.info(tag + ' : logMessage : rowCount' + resultSet.rowCount); + expect(resultSet.rowCount == 10000).assertTrue(); + resultSet.close(); + done(); + } catch (error) { + console.info(tag + " :logMessage : error = " + error); + done(); + } + }); + + /** + * @tc.number raw_contact_delete_performance_test_1200 + * @tc.name The raw_contact table deletes 10000 pieces of data, and the time consumption is calculated according + * to the running time of the use case + * @tc.desc Function test + */ + it("raw_contact_delete_performance_test_1200", 0, async function (done) { + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('raw_contact_delete_performance_test_1200 : start ! DAHelper = ' + DAHelper); + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.greaterThan("id", "0"); + condition.and(); + condition.equalTo("is_deleted", "0"); + try { + let old = new Date(); + var deleteCode = await DAHelper.delete(rawContactUri, condition); + let now = new Date(); + let usedTime = now - old; + console.info('raw_contact_delete_performance_test_1200 usedTime = ' + usedTime); + expect(usedTime < 10000).assertTrue(); + sleep(5000); + console.info("logMessage raw_contact_delete_performance_test_1200: deleteCode = " + deleteCode); + expect(deleteCode == 0).assertTrue(); + done(); + } catch (error) { + console.info('logMessage raw_contact_delete_performance_test_1200: delete error = ' + error); + done(); + } + }); + + /** + * @tc.number contact_data_insert_performance_test_1300 + * @tc.name The contact_data table adds 10000 pieces of data, and the time consumption is calculated according to + * the running time of the use case + * @tc.desc Function test + */ + it("contact_data_insert_performance_test_1300", 0, async function (done) { + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + var rawContactValues = { + "display_name": "xiaoli", + }; + try { + var rawContactId = await DAHelper.insert(rawContactUri, rawContactValues); + sleep(1000); + console.info("logMessage contact_data_insert_performance_test_1300: rawContactId = " + rawContactId); + } catch (error) { + console.info("logMessage contact_data_insert_performance_test_1300: raw_contact insert error = " + error); + } + + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("id", rawContactId.toString()); + var deleteCode = await DAHelper.delete(rawContactUri, condition); + sleep(1000); + console.info("logMessage contact_data_insert_performance_test_1300: deleteCode = " + deleteCode); + + var listAddBluk = []; + for (var i = 0; i < 1000; i++) { + var add = { + "raw_contact_id": rawContactId, "detail_info": "xxx" + i, "content_type": "name" + }; + listAddBluk[i] = add; + } + try { + let old = new Date(); + var batchInsertCode = await DAHelper.batchInsert(contactDataUri, listAddBluk); + var batchInsertCode = await DAHelper.batchInsert(contactDataUri, listAddBluk); + var batchInsertCode = await DAHelper.batchInsert(contactDataUri, listAddBluk); + var batchInsertCode = await DAHelper.batchInsert(contactDataUri, listAddBluk); + var batchInsertCode = await DAHelper.batchInsert(contactDataUri, listAddBluk); + var batchInsertCode = await DAHelper.batchInsert(contactDataUri, listAddBluk); + var batchInsertCode = await DAHelper.batchInsert(contactDataUri, listAddBluk); + var batchInsertCode = await DAHelper.batchInsert(contactDataUri, listAddBluk); + var batchInsertCode = await DAHelper.batchInsert(contactDataUri, listAddBluk); + var batchInsertCode = await DAHelper.batchInsert(contactDataUri, listAddBluk); + let now = new Date(); + let usedTime = now - old; + console.info('contact_data_insert_performance_test_1300 usedTime = ' + usedTime); + expect(usedTime < 70000).assertTrue(); + sleep(5000); + console.info("logMessage contact_data_insert_performance_test_1300: batchInsertCode = " + batchInsertCode); + expect(batchInsertCode == 0).assertTrue(); + done(); + } catch (error) { + console.info('logMessage contact_data_insert_performance_test_1300: insert error = ' + error); + done(); + } + }); + + /** + * @tc.number contact_data_update_performance_test_1400 + * @tc.name The contact_data table updates data whose ID is not equal to 0, and the time consumption is + * calculated according to the running time of the use case + * @tc.desc Function test + */ + it("contact_data_update_performance_test_1400", 0, async function (done) { + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage contact_data_update_performance_test_1400 DAHelper success! DAHelper = ' + DAHelper); + var updateValues = { + "syn_1": "test" + }; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.greaterThan("id", "0"); + try { + let old = new Date(); + var updateCode = await DAHelper.update(contactDataUri, updateValues, condition); + let now = new Date(); + let usedTime = now - old; + console.info('contact_data_update_performance_test_1400 usedTime = ' + usedTime); + expect(usedTime < 50000).assertTrue(); + sleep(8000); + console.info("logMessage contact_data_update_performance_test_1400: updateCode = " + updateCode); + expect(updateCode == 0).assertTrue(); + done(); + } catch (error) { + console.info("logMessage contact_data_update_performance_test_1400: update error = " + error); + done(); + } + }); + + /** + * @tc.number contact_data_query_performance_test_1500 + * @tc.name The contact_datat table queries 10000 pieces of data and calculates the time consumption according to + * the running time of the use case + * @tc.desc Function test + */ + it("contact_data_query_performance_test_1500", 0, async function (done) { + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('contact_data_query_performance_test_1500 start ! DAHelper = ' + DAHelper); + var resultColumns = []; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.greaterThan("id", "0"); + try { + let old = new Date(); + var resultSet = await DAHelper.query(contactDataUri, resultColumns, condition); + let now = new Date(); + let usedTime = now - old; + console.info('contact_data_query_performance_test_1500 usedTime = ' + usedTime); + expect(usedTime < 4000).assertTrue(); + sleep(5000); + console.info('logMessage contact_data_query_performance_test_1500: goToFirstRow' + resultSet.rowCount); + expect(resultSet.rowCount == 10000).assertEqual(true); + resultSet.close(); + done(); + } catch (error) { + console.info("logMessage contact_data_query_performance_test_1500: error = " + error); + done(); + } + }); + + /** + * @tc.number contact_data_delete_performance_test_1600 + * @tc.name The contact_data table deletes 10000 pieces of data, and the time consumption is calculated according + * to the running time of the use case + * @tc.desc Function test + */ + it("contact_data_delete_performance_test_1600", 0, async function (done) { + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('contact_data_delete_performance_test_1600 : start ! DAHelper = ' + DAHelper); + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.greaterThan("id", "0"); + try { + let old = new Date(); + var deleteCode = await DAHelper.delete(contactDataUri, condition); + let now = new Date(); + let usedTime = now - old; + console.info('contact_data_delete_performance_test_1600 usedTime = ' + usedTime); + expect(usedTime < 40000).assertTrue(); + sleep(5000); + console.info("logMessage contact_data_delete_performance_test_1600: deleteCode = " + deleteCode); + expect(deleteCode == 0).assertTrue(); + done(); + } catch (error) { + console.info('logMessage contact_data_delete_performance_test_1600: delete error = ' + error); + done(); + } + }); + + /** + * @tc.number calllog_insert_performance_test_100 + * @tc.name The callog table adds 10000 pieces of data, and the time consumption is calculated according to the + * running time of the use case + * @tc.desc Function test + */ + it("calllog_insert_performance_test_100", 0, async function (done) { + console.info("---------logMessage calllog_insert_performance_test_100 is starting!----------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CALLLOG); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + var listAddBluk = []; + for (var i = 0; i < 1000; i++) { + var add = { + "phone_number": "1511002" + i + }; + listAddBluk[i] = add; + } + try { + let old = new Date(); + var batchInsertCode = await DAHelper.batchInsert(calllogUri, listAddBluk); + var batchInsertCode = await DAHelper.batchInsert(calllogUri, listAddBluk); + var batchInsertCode = await DAHelper.batchInsert(calllogUri, listAddBluk); + var batchInsertCode = await DAHelper.batchInsert(calllogUri, listAddBluk); + var batchInsertCode = await DAHelper.batchInsert(calllogUri, listAddBluk); + var batchInsertCode = await DAHelper.batchInsert(calllogUri, listAddBluk); + var batchInsertCode = await DAHelper.batchInsert(calllogUri, listAddBluk); + var batchInsertCode = await DAHelper.batchInsert(calllogUri, listAddBluk); + var batchInsertCode = await DAHelper.batchInsert(calllogUri, listAddBluk); + var batchInsertCode = await DAHelper.batchInsert(calllogUri, listAddBluk); + let now = new Date(); + let usedTime = now - old; + console.info('calllog_insert_performance_test_100 usedTime = ' + usedTime); + expect(usedTime < 100000).assertTrue(); + sleep(5000); + console.info("logMessage calllog_insert_performance_test_100: batchInsertCode = " + batchInsertCode); + expect(batchInsertCode == 0).assertTrue(); + done(); + } catch (error) { + console.info("logMessage calllog_insert_performance_test_100: batchInsert error = " + error); + done(); + } + }); + + /** + * @tc.number calllog_update_performance_test_200 + * @tc.name The callog table updates data whose ID is not equal to 0, and the time consumption is calculated + * according to the running time of the use case + * @tc.desc Function test + */ + it("calllog_update_performance_test_200", 0, async function (done) { + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CALLLOG); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + var updateValues = { + "answer_state": "1" + }; + try { + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.notEqualTo("id", 0); + let old = new Date(); + var updateCode = await DAHelper.update(calllogUri, updateValues, condition); + let now = new Date(); + let usedTime = now - old; + console.info('calllog_update_performance_test_200 usedTime = ' + usedTime); + expect(usedTime < 1000).assertTrue(); + sleep(5000); + console.info("logMessage calllog_update_performance_test_200: updateCode = " + updateCode); + expect(updateCode == 0).assertTrue(); + done(); + } catch (error) { + console.info("logMessage calllog_update_performance_test_200: update error = " + error); + done(); + } + ; + }); + + /** + * @tc.number calllog_query_performance_test_300 + * @tc.name The callog table queries 10000 pieces of data to see whether they can be queried successfully + * @tc.desc Function test + */ + it("calllog_query_performance_test_300", 0, async function (done) { + var tag = "calllog_query_performance_test_300"; + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CALLLOG); + console.info(tag + ': start ! DAHelper = ' + DAHelper); + var resultColumns = []; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.notEqualTo("id", 0); + + try { + let old = new Date(); + var resultSet = await DAHelper.query(calllogUri, resultColumns, condition); + let now = new Date(); + let usedTime = now - old; + console.info('calllog_query_performance_test_300 usedTime = ' + usedTime); + expect(usedTime < 1000).assertTrue(); + sleep(5000); + console.info(tag + ' : logMessage : rowCount' + resultSet.rowCount); + expect(resultSet.rowCount == 10000).assertTrue(); + resultSet.close(); + done(); + } catch (error) { + console.info("logMessage calllog_query_performance_test_300: error = " + error); + done() + } + }); + + /** + * @tc.number calllog_delete_performance_test_400 + * @tc.name The callog table deletes 10000 pieces of data, and the time consumption is calculated according to + * the running time of the use case + * @tc.desc Function test + */ + it("calllog_delete_performance_test_400", 0, async function (done) { + var tag = "calllog_delete_performance_test_400"; + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CALLLOG); + console.info(tag + ': start ! DAHelper = ' + DAHelper); + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.greaterThan("id", "0"); + let old = new Date(); + var deleteCode = await DAHelper.delete(calllogUri, condition); + let now = new Date(); + let usedTime = now - old; + console.info('calllog_delete_performance_test_400 usedTime = ' + usedTime); + expect(usedTime < 10000).assertTrue(); + sleep(5000); + console.info(tag + " : logMessage : deleteCode = " + deleteCode); + expect(deleteCode == 0).assertTrue(); + done(); + }); + + /** + * @tc.number voicemail_insert_performance_test_500 + * @tc.name The voicemail table adds 10000 pieces of data, and the time consumption is calculated according to + * the running time of the use case + * @tc.desc Function test + */ + it("voicemail_insert_performance_test_500", 0, async function (done) { + console.info("---------logMessage voicemail_insert_performance_test_500 is starting!----------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_VOICEMAIL); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + var listAddBluk = []; + for (var i = 0; i < 1000; i++) { + var add = { + "phone_number": "12345" + i + }; + listAddBluk[i] = add; + } + try { + let old = new Date(); + var batchInsertCode = await DAHelper.batchInsert(voicemailUri, listAddBluk); + var batchInsertCode = await DAHelper.batchInsert(voicemailUri, listAddBluk); + var batchInsertCode = await DAHelper.batchInsert(voicemailUri, listAddBluk); + var batchInsertCode = await DAHelper.batchInsert(voicemailUri, listAddBluk); + var batchInsertCode = await DAHelper.batchInsert(voicemailUri, listAddBluk); + var batchInsertCode = await DAHelper.batchInsert(voicemailUri, listAddBluk); + var batchInsertCode = await DAHelper.batchInsert(voicemailUri, listAddBluk); + var batchInsertCode = await DAHelper.batchInsert(voicemailUri, listAddBluk); + var batchInsertCode = await DAHelper.batchInsert(voicemailUri, listAddBluk); + var batchInsertCode = await DAHelper.batchInsert(voicemailUri, listAddBluk); + let now = new Date(); + let usedTime = now - old; + console.info('voicemail_insert_performance_test_500 usedTime = ' + usedTime); + expect(usedTime < 100000).assertTrue(); + sleep(5000); + console.info("logMessage voicemail_insert_performance_test_500: batchInsertCode = " + batchInsertCode); + expect(batchInsertCode == 0).assertTrue(); + done(); + } catch (error) { + console.info("logMessage voicemail_insert_performance_test_500: batchInsert error = " + error); + done(); + } + }); + + /** + * @tc.number voicemail_update_performance_test_600 + * @tc.name The voicemail table updates data whose ID is not equal to 0, and the time consumption is calculated + * according to the running time of the use case + * @tc.desc Function test + */ + it("voicemail_update_performance_test_600", 0, async function (done) { + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_VOICEMAIL); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + var updateValues = { + "origin_type": "test" + }; + try { + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.notEqualTo("id", 0); + let old = new Date(); + var updateCode = await DAHelper.update(voicemailUri, updateValues, condition); + let now = new Date(); + let usedTime = now - old; + console.info('voicemail_update_performance_test_600 usedTime = ' + usedTime); + expect(usedTime < 10000).assertTrue(); + sleep(5000); + console.info("logMessage voicemail_update_performance_test_600: updateCode = " + updateCode); + expect(updateCode == 0).assertTrue(); + done(); + } catch (error) { + console.info("logMessage voicemail_update_performance_test_600: update error = " + error); + done(); + } + ; + }); + + /** + * @tc.number voicemail_query_performance_test_700 + * @tc.name The voicemail table queries 10000 items, and the time consumption is calculated according to the + * running time of the use case + * @tc.desc Function test + */ + it("voicemail_query_performance_test_700", 0, async function (done) { + var tag = "voicemail_query_performance_test_700"; + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_VOICEMAIL); + console.info(tag + ': start ! DAHelper = ' + DAHelper); + var resultColumns = []; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.greaterThan("id", "0"); + try { + let old = new Date(); + var resultSet = await DAHelper.query(voicemailUri, resultColumns, condition); + let now = new Date(); + let usedTime = now - old; + console.info('voicemail_query_performance_test_700 usedTime = ' + usedTime); + expect(usedTime < 500).assertTrue(); + sleep(5000); + console.info(tag + ' : logMessage : rowCount' + resultSet.rowCount); + expect(resultSet.rowCount == 10000).assertTrue(); + resultSet.close(); + done(); + } catch (error) { + console.info("logMessage voicemail_query_performance_test_700: error = " + error); + done() + } + }); + + /** + * @tc.number voicemail_delete_performance_test_800 + * @tc.name The voicemail table deletes 10000 pieces of data, and the time consumption is calculated according to + * the running time of the use case + * @tc.desc Function test + */ + it("voicemail_delete_performance_test_800", 0, async function (done) { + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + var tag = "voicemail_delete_performance_test_800"; + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_VOICEMAIL); + console.info(tag + ': start ! DAHelper = ' + DAHelper); + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.greaterThan("id", "0"); + try { + let old = new Date(); + var deleteCode = await DAHelper.delete(voicemailUri, condition); + let now = new Date(); + let usedTime = now - old; + console.info('voicemail_delete_performance_test_800 usedTime = ' + usedTime); + expect(usedTime < 500).assertTrue(); + sleep(5000); + console.info(tag + " : logMessage : deleteCode = " + deleteCode); + expect(deleteCode == 0).assertTrue(); + done(); + } catch (error) { + console.info("logMessage voicemail_delete_performance_test_800: error = " + error); + done(); + } + }); + + afterAll(async function () { + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('DeleteContact : start ! DAHelper = ' + DAHelper); + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.notEqualTo("id", "0"); + try { + var resultColumns = ["id"]; + var conditionDelete = new ohosDataAbility.DataAbilityPredicates(); + conditionDelete.greaterThan("id", "0"); + var count = 0; + var deleteCount = 9999; + while (count < deleteCount) { + var result = await DAHelper.query(deletedUri, resultColumns, conditionDelete); + console.info("performance : result.rowCount = " + result.rowCount); + count = result.rowCount; + result.close(); + sleep(5000); + } + var deleteCode = await DAHelper.delete(deletedUri, condition); + console.info("afterAll logMessage DeleteContact: deleteCode = " + deleteCode); + } catch (error) { + console.info('afterAll logMessage DeleteContact: delete error = ' + error); + } + }); + }) +} \ No newline at end of file diff --git a/telephony/telephonyjstest/contact_performance/entry/src/main/ets/MainAbility/test/lib/Const.js b/telephony/telephonyjstest/contact_performance/entry/src/main/ets/MainAbility/test/lib/Const.js new file mode 100644 index 000000000..f9263cd46 --- /dev/null +++ b/telephony/telephonyjstest/contact_performance/entry/src/main/ets/MainAbility/test/lib/Const.js @@ -0,0 +1,36 @@ +/** + * 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. + */ + +// sim slot id +export const DEFAULT_SLOTID = 0; +export const SLOTID3 = 3; +export const SLOTID2 = 2; +export const SLOTID_MINUS1 = -1; + +// sim correct password +export const CORRECT_PIN = '1234'; +export const CORRECT_PIN2 = '18099014'; + +// sim incorrect password +export const INCORRECT_PIN = '134679'; +export const INCORRECT_PIN_LEN3 = '123'; +export const INCORRECT_PUK = '134679'; +export const INCORRECT_PIN2 = '134679'; +export const INCORRECT_PIN2_LEN3 = '123'; +export const INCORRECT_PIN2_LEN9 = '123456789'; +export const INCORRECT_PUK2 = '134679'; + +// lock status response +export const LOCK_RESULT = { SUCCESS: 0, FAILURE: -1, EXCEPTION: -2 }; \ No newline at end of file diff --git a/telephony/telephonyjstest/contact_performance/entry/src/main/resources/base/element/string.json b/telephony/telephonyjstest/contact_performance/entry/src/main/resources/base/element/string.json new file mode 100644 index 000000000..03b8532c5 --- /dev/null +++ b/telephony/telephonyjstest/contact_performance/entry/src/main/resources/base/element/string.json @@ -0,0 +1,12 @@ +{ + "string": [ + { + "name": "entry_MainAbility", + "value": "entry_MainAbility" + }, + { + "name": "description_mainability", + "value": "ETS_Empty Ability" + } + ] +} \ No newline at end of file diff --git a/telephony/telephonyjstest/contact_performance/entry/src/main/resources/base/media/icon.png b/telephony/telephonyjstest/contact_performance/entry/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-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edHgr@z>~3_4XC>T8Fm)?oT1A@qcyCu{3>+XbWI$ zG&nk0VWBy~00_=%?$LwTm;Ld;~g zgBUUcL1NbwI<93~JLelR!T{8ny!2;GlTZ0>^ml(^+R|_~_~ni`Q?nE>&S;CQV>t6lK;O%Wu7Z9iVioo2e;2N-6Q>12y&KznfGiYm5kKXj%s&4C#DoOaz{#a9g>V#}`+uu3TK`_GLGEAH6-}!7+gP8V$ z7a!V3qrpV33gMMuno|cXUM@6Qcx-aT?t@4ED0$2S@#?)rC7Fh3j(i;L&54!|0FMe3x*bXtFnlJzLL3aH zpi;lr6%&X;C%SVM=P%MJ6(}KH>m0w_WKuWy{X2p4!2Pqrwm;>=<2o}Dhu*bisL!?5 z)6?@AU&4YWUN)^*jr!Ozt&JdTDOw)?fw~F17S(d{|7GG(G(KeJZ0N2`FVv?5 NG*q?mAC)bG{|A+36q*14 literal 0 HcmV?d00001 diff --git a/telephony/telephonyjstest/contact_performance/entry/src/main/resources/rawfile/star-1-2.png b/telephony/telephonyjstest/contact_performance/entry/src/main/resources/rawfile/star-1-2.png new file mode 100644 index 0000000000000000000000000000000000000000..450c3dd3ca68bf601bd08e5f41797d376e20d00d GIT binary patch literal 8295 zcma)iby!qi)GiDI3@ITfJq#cs(xo6VIK9g0Is58cut9YYAhAky89NJ&c$4N6Nm zw8Wj?_uaqmbN@K!?C070th3LGz1Mo*9j&FIL_x|(iid|s0au1;Ejqu(x%6MX}UcP^pVq^MKx?9Z3<6HZSZ(YTWwl+ z4})r2h&L?_5Z3xL9JTpl$1We;HwOfV*U2Dd;4VathABE2mL~&90=s!A z17A=j029Bxgn&sP{lPFWGr*0ABr?l!nhT^H>H*JtEAfpTOhQ8`F<+vJ8@ZDt_v2l} zOF0@&=65xE>0mI)Bv(k<5_x1Wr}DE!>r#HG91U6(z}Lz^i4RY3X&Tfw3&nM%1C5a) z%(ySExg?jj0C8QEq$g*CpQ*Xk7yhNiNn@bzJnMOrz${d^ZW9+zK}FP6Wt)@*prd*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`K2tg4!Hvyrou4BsJQuv*UfF)<%CelYIS>D^o?X)3+MK%la6kooW8&G@BU)Y0hT`+mOm$Z_%rB=a%o>I z!2c6lHyKQN)VjiFwa!eE^p8jc$sy$vB+8i25lI~6KPFFh$!o$avA~rj#L6xvR|Z83 z*WD6T9e+5Pyy=F+)pNTf{ny3cy>7Rkd3o*TS?TZJ`NS^NF2%HMkyS{?uJ$`!P4_L^ z1`NFDUbNyg_qREifgktnp1_v{Jbb`7m}2PTyUdOmtJj~m z9bB=ecw4_^rw1IW=of+>nrW5=d3k`3qHCxsIN_F{T1A545};;+fsyC&qChi+YV zr~M63H8ZLCPYmsjY>ls9cL%I)F|JIW-#+48$+lD4k*(P*kDM%zx_fvu4u5ZYUnI}5 zdrycFq>xFU)&X3p@pP2u%$o}}YcRn(MhJ&B2o?KS@cIVz>Ye%o^xV?CB{_Qhu z;}_q1bvO^g{8<3!gYbo4Di{8qzV+(9 zdlmksohQmRTs@qB;(Wo?dER_ux6XQb@q$tQPW?CMu6GVQd;R=iR;-S{Kr%Zks7>b1 zNs{|-+jhObYE}NR&`TGGr^h^4bjh%c>R#@=8nM&Md>_a+zVulsl;){flFekV1t9ob z+SqfV_Pv3$2f)bQ8%Ul2>fdYR^1zs0BQF~olsOj5AodC&Q_7SMFzsz2 z9newxE&jodk~tNHwl%LBMMDbrk=(^b literal 0 HcmV?d00001 diff --git a/telephony/telephonyjstest/contact_stability/BUILD.gn b/telephony/telephonyjstest/contact_stability/BUILD.gn new file mode 100644 index 000000000..0bd78c4a9 --- /dev/null +++ b/telephony/telephonyjstest/contact_stability/BUILD.gn @@ -0,0 +1,32 @@ +# 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("ActsContactStabilityEtsTest") { + hap_profile = "./entry/src/main/config.json" + deps = [ + ":ace_demo_ets_assets", + ":ace_demo_ets_resources", + ] + ets2abc = true + certificate_profile = "./signature/openharmony_sx.p7b" + hap_name = "ActsContactStabilityEtsTest" +} +ohos_js_assets("ace_demo_ets_assets") { + source_dir = "./entry/src/main/ets/MainAbility" +} +ohos_resources("ace_demo_ets_resources") { + sources = [ "./entry/src/main/resources" ] + hap_profile = "./entry/src/main/config.json" +} diff --git a/telephony/telephonyjstest/contact_stability/Test.json b/telephony/telephonyjstest/contact_stability/Test.json new file mode 100644 index 000000000..197a0b946 --- /dev/null +++ b/telephony/telephonyjstest/contact_stability/Test.json @@ -0,0 +1,18 @@ +{ + "description": "Configuration for hjunit demo Tests", + "driver": { + "type": "JSUnitTest", + "test-timeout": "1800000", + "package": "com.ohos.contactstability", + "shell-timeout": "60000" + }, + "kits": [ + { + "test-file-name": [ + "ActsContactStabilityEtsTest.hap" + ], + "type": "AppInstallKit", + "cleanup-apps": true + } + ] +} diff --git a/telephony/telephonyjstest/contact_stability/entry/src/main/config.json b/telephony/telephonyjstest/contact_stability/entry/src/main/config.json new file mode 100644 index 000000000..5aebc1451 --- /dev/null +++ b/telephony/telephonyjstest/contact_stability/entry/src/main/config.json @@ -0,0 +1,93 @@ +{ + "app": { + "bundleName": "com.ohos.contactstability", + "vendor": "open", + "version": { + "code": 1000000, + "name": "1.0.0" + }, + "apiVersion": { + "compatible": 7, + "releaseType": "Release", + "target": 7 + } + }, + "deviceConfig": {}, + "module": { + "package": "com.ohos.contactstability", + "name": ".MyApplication", + "mainAbility": ".MainAbility", + "srcPath": "MainAbility", + "deviceType": [ + "phone" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "entry", + "moduleType": "entry", + "installationFree": false + }, + "abilities": [ + { + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ], + "orientation": "unspecified", + "visible": true, + "srcPath": "MainAbility", + "name": ".MainAbility", + "srcLanguage": "ets", + "icon": "$media:icon", + "description": "$string:description_mainability", + "formsEnabled": false, + "label": "$string:entry_MainAbility", + "type": "page", + "launchType": "standard" + } + ], + "js": [ + { + "mode": { + "syntax": "ets", + "type": "pageAbility" + }, + "pages": [ + "pages/index", + "pages/Button", + "pages/Blank", + "pages/DataPanel", + "pages/Divider", + "pages/Text", + "pages/RowSplit", + "pages/Scroll", + "pages/Stack", + "pages/Image", + "pages/Progress", + "pages/Qrcode", + "pages/Rating", + "pages/Span", + "pages/Slider", + "pages/Badge", + "pages/Column", + "pages/ColumnSplit", + "pages/Counter", + "pages/Flex", + "pages/GridContainer" + + ], + "name": ".MainAbility", + "window": { + "designWidth": 720, + "autoDesignWidth": false + } + } + ] + } +} \ No newline at end of file diff --git a/telephony/telephonyjstest/contact_stability/entry/src/main/ets/MainAbility/app.ets b/telephony/telephonyjstest/contact_stability/entry/src/main/ets/MainAbility/app.ets new file mode 100644 index 000000000..261fadca2 --- /dev/null +++ b/telephony/telephonyjstest/contact_stability/entry/src/main/ets/MainAbility/app.ets @@ -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('Application onCreate') + }, + onDestroy() { + console.info('Application onDestroy') + }, +} \ No newline at end of file diff --git a/telephony/telephonyjstest/contact_stability/entry/src/main/ets/MainAbility/pages/Badge.ets b/telephony/telephonyjstest/contact_stability/entry/src/main/ets/MainAbility/pages/Badge.ets new file mode 100644 index 000000000..66de6f8e3 --- /dev/null +++ b/telephony/telephonyjstest/contact_stability/entry/src/main/ets/MainAbility/pages/Badge.ets @@ -0,0 +1,95 @@ +/* + * 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. + */ + +@Entry +@Component +struct badge { + @State counts: number = 33 + @State message: string = 'new' + @State active: boolean = false + private content: string = "badge Page"; + + onPageShow() { + console.info('badge page show called'); + } + + onBuildDone() { + console.info('badge page build done called'); + } + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Scroll() { + Column() { + Text(`${this.content}`) + .fontSize(50) + .fontWeight(FontWeight.Bold) + Badge({ + count: this.counts, + position: BadgePosition.Right, + maxCount: 99, + style: { color: 0xFFFFFF, fontSize: 16, badgeSize: 20, badgeColor: Color.Red } + }) { + Button('message') + .onClick(() => { + this.counts++ + }) + .width(100).height(50).backgroundColor(0x317aff) + } + .width(100) + .height(50) + .key('badge') + + Text("BadgePosition.RightTop").fontSize(16) + Badge({ + count: this.counts, + position: BadgePosition.RightTop, + maxCount: 99, + style: { color: 0xFFFFFF, fontSize: '16', badgeSize: '20', badgeColor: Color.Red } + }) { + Button('message') + .onClick(() => { + this.counts++ + }) + .width(100).height(50).backgroundColor(0x317aff) + } + .width(100) + .height(50) + .key('badge1') + + Text("BadgePosition.Left").fontSize(16) + Badge({ + count: this.counts, + position: BadgePosition.Left, + maxCount: 99, + style: { color: Color.Pink, fontSize: 16, badgeSize: 20, badgeColor: Color.Red } + }) { + Button('message') + .onClick(() => { + this.counts++ + }) + .width(100).height(50).backgroundColor(0x317aff) + } + .width(100) + .height(50) + .key('badge2') + } + } + } + .key('flex') + .width('100%') + .height('100%') + } +} diff --git a/telephony/telephonyjstest/contact_stability/entry/src/main/ets/MainAbility/pages/Blank.ets b/telephony/telephonyjstest/contact_stability/entry/src/main/ets/MainAbility/pages/Blank.ets new file mode 100644 index 000000000..a50fc719e --- /dev/null +++ b/telephony/telephonyjstest/contact_stability/entry/src/main/ets/MainAbility/pages/Blank.ets @@ -0,0 +1,47 @@ +/* + * 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. + */ + +@Entry +@Component +struct blank_testcase { + @State Color: Color = Color.Pink + @State active: boolean = false + private content: string = "Blank Page" + + onPageShow() { + console.info('Blank page show called'); + } + + onBuildDone() { + console.info('Blank page build done called'); + } + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Text(`${this.content}`) + .fontSize(50) + .fontWeight(FontWeight.Bold) + Blank(100) + .color(this.Color) + .key('blank') + Text('on/off').fontSize(18).height(60) + } + .key('flex') + .width('100%') + .height('100%') + + + } +} diff --git a/telephony/telephonyjstest/contact_stability/entry/src/main/ets/MainAbility/pages/Button.ets b/telephony/telephonyjstest/contact_stability/entry/src/main/ets/MainAbility/pages/Button.ets new file mode 100644 index 000000000..ac2271ea3 --- /dev/null +++ b/telephony/telephonyjstest/contact_stability/entry/src/main/ets/MainAbility/pages/Button.ets @@ -0,0 +1,70 @@ +/* + * 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 router from '@system.router' + +@Entry +@Component +struct button_testcase { + @State stateEffect: boolean = true + @State ButtonType: ButtonType = ButtonType.Circle + private content: string = "Button Page"; + + onPageShow() { + console.info('Button page show called'); + } + + onBuildDone() { + console.info('Button page build done called'); + } + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Text(`${this.content}`) + .fontSize(50) + .fontWeight(FontWeight.Bold) + Button('1.value', { type: ButtonType.Circle, stateEffect: this.stateEffect }) + .fontSize(12) + .fontWeight(FontWeight.Bold) + .fontColor(0xCCCCCC) + .height(40) + .width(40) + .key('button') + .backgroundColor('#0D9FFB') + .onClick(() => { + router.back() + }) + .padding(10) + Button() { + Text("2.Capsule") + } + .type(ButtonType.Capsule) + .stateEffect(false) + .backgroundColor('#0D9FFB') + .padding(10) + .key('button1') + + Button() { + Text("3.Normal") + }.type(ButtonType.Normal) + .backgroundColor('#0D9FFB') + .key('button2') + + }.key('flex') + .width('100%') + .height('100%') + } +} + diff --git a/telephony/telephonyjstest/contact_stability/entry/src/main/ets/MainAbility/pages/Column.ets b/telephony/telephonyjstest/contact_stability/entry/src/main/ets/MainAbility/pages/Column.ets new file mode 100644 index 000000000..b9e5c84e2 --- /dev/null +++ b/telephony/telephonyjstest/contact_stability/entry/src/main/ets/MainAbility/pages/Column.ets @@ -0,0 +1,51 @@ +/* + * 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. + */ + +@Entry +@Component +struct column { + @State active: boolean = false + private content: string = "Column Page" + + onPageShow() { + console.info('Column page show called'); + } + + onBuildDone() { + console.info('Column page build done called'); + } + + build() { + Column({ space: 5 }) { + Text('alignItems(Center)').fontSize(9).fontColor(0xCCCCCC).width('90%') + Column() { + Column().width('50%').height(50).backgroundColor(0xAFEEEE) + Column().width('50%').height(50).backgroundColor(0x00FFFF) + }.alignItems(HorizontalAlign.Center).width('90%').border({ width: 1 }).key('column') + + Text('alignItems(Start)').fontSize(9).fontColor(0xCCCCCC).width('90%') + Column({ space: '5' }) { + Column().width('50%').height(50).backgroundColor(0xAFEEEE) + Column().width('50%').height(50).backgroundColor(0x00FFFF) + }.alignItems(HorizontalAlign.Start).width('90%').border({ width: 1 }).key('column1') + + Text('alignItems(End)').fontSize(9).fontColor(0xCCCCCC).width('90%') + Column() { + Column().width('50%').height(50).backgroundColor(0xAFEEEE) + Column().width('50%').height(50).backgroundColor(0x00FFFF) + }.alignItems(HorizontalAlign.End).width('90%').border({ width: 1 }).key('column2') + }.width('100%').padding({ top: 5 }) + } +} diff --git a/telephony/telephonyjstest/contact_stability/entry/src/main/ets/MainAbility/pages/ColumnSplit.ets b/telephony/telephonyjstest/contact_stability/entry/src/main/ets/MainAbility/pages/ColumnSplit.ets new file mode 100644 index 000000000..cb0597310 --- /dev/null +++ b/telephony/telephonyjstest/contact_stability/entry/src/main/ets/MainAbility/pages/ColumnSplit.ets @@ -0,0 +1,70 @@ +/* + * 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. + */ + +@Entry +@Component +struct columnSplit { + private content: string = "ColumnSplit Page" + + onPageShow() { + console.info('ColumnSplit page show called'); + } + + onBuildDone() { + console.info('ColumnSplit page build done called'); + } + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Scroll() { + Column() { + Text(`${this.content}`) + .fontSize(50) + .fontWeight(FontWeight.Bold) + Column() { + Text('ColumnSplit').fontSize(9).fontColor(0xCCCCCC).width('90%') + ColumnSplit() { + Text('1').width('100%').height(50).backgroundColor(0xF5DEB3).textAlign(TextAlign.Center) + Text('2').width('100%').height(50).backgroundColor(0xD2B48C).textAlign(TextAlign.Center) + Text('3').width('100%').height(50).backgroundColor(0xF5DEB3).textAlign(TextAlign.Center) + Text('4').width('100%').height(50).backgroundColor(0xD2B48C).textAlign(TextAlign.Center) + Text('5').width('100%').height(50).backgroundColor(0xF5DEB3).textAlign(TextAlign.Center) + }.key('columnSplit') + .resizeable(true) + .width('90%').height('60%') + + }.width("100%") + + Column() { + Text('ColumnSplit1').fontSize(9).fontColor(0xCCCCCC).width('90%') + ColumnSplit() { + Text('1').width('100%').height(50).backgroundColor(0xF5DEB3).textAlign(TextAlign.Center) + Text('2').width('100%').height(50).backgroundColor(0xD2B48C).textAlign(TextAlign.Center) + Text('3').width('100%').height(50).backgroundColor(0xF5DEB3).textAlign(TextAlign.Center) + Text('4').width('100%').height(50).backgroundColor(0xD2B48C).textAlign(TextAlign.Center) + Text('5').width('100%').height(50).backgroundColor(0xF5DEB3).textAlign(TextAlign.Center) + }.key('columnSplit1') + .resizeable(false) + .width('90%').height('60%') + + }.width("100%") + } + } + } + .key('flex') + .width('100%') + .height('100%') + } +} diff --git a/telephony/telephonyjstest/contact_stability/entry/src/main/ets/MainAbility/pages/Counter.ets b/telephony/telephonyjstest/contact_stability/entry/src/main/ets/MainAbility/pages/Counter.ets new file mode 100644 index 000000000..ecdbfaf10 --- /dev/null +++ b/telephony/telephonyjstest/contact_stability/entry/src/main/ets/MainAbility/pages/Counter.ets @@ -0,0 +1,51 @@ +/* + * 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. + */ + +@Entry +@Component +struct counter { + @State value: number = 0 + @State active: boolean = false + private content: string = "Counter Page" + + onPageShow() { + console.info('Counter page show called'); + } + + onBuildDone() { + console.info('Counter page build done called'); + } + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Text(`${this.content}`) + .fontSize(50) + .fontWeight(FontWeight.Bold) + Counter() { + Text(this.value.toString()) + }.margin(100) + .key('counter') + .onInc(() => { + this.value++ + }) + .onDec(() => { + this.value-- + }) + }.width("100%") + .key('flex') + .width('100%') + .height('100%') + } +} diff --git a/telephony/telephonyjstest/contact_stability/entry/src/main/ets/MainAbility/pages/DataPanel.ets b/telephony/telephonyjstest/contact_stability/entry/src/main/ets/MainAbility/pages/DataPanel.ets new file mode 100644 index 000000000..3c6248484 --- /dev/null +++ b/telephony/telephonyjstest/contact_stability/entry/src/main/ets/MainAbility/pages/DataPanel.ets @@ -0,0 +1,69 @@ +/* + * 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 router from '@system.router' + +@Entry +@Component +struct dataPanel_testcase { + @State width: string= "200" + @State height: string= "100" + @State active: boolean = false + private content: string = "DataPanel Page" + + onPageShow() { + console.info('Blank page show called'); + } + + onBuildDone() { + console.info('Blank page build done called'); + } + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Text(`${this.content}`) + .fontSize(50) + DataPanel({ values: [20, 40, 20], max: 100, type: DataPanelType.Line }) + .width(this.width) + .height(this.height) + .key('DataPanel') + .onClick(() => { + router.back() + }) + .closeEffect(false) + + DataPanel({ values: [20, 40, 20], max: 100, type: DataPanelType.Circle}) + .width(this.width) + .height(this.height) + .key('DataPanel2') + .onClick(() => { + router.back() + }) + .closeEffect(true) + DataPanel({ values: [20, 40, 20], max: 100}) + .width(this.width) + .height(this.height) + .key('DataPanel3') + .onClick(() => { + router.back() + }) + .closeEffect(false) + } + .key('flex') + .width('100%') + .height('100%') + + } +} diff --git a/telephony/telephonyjstest/contact_stability/entry/src/main/ets/MainAbility/pages/Divider.ets b/telephony/telephonyjstest/contact_stability/entry/src/main/ets/MainAbility/pages/Divider.ets new file mode 100644 index 000000000..02bf60779 --- /dev/null +++ b/telephony/telephonyjstest/contact_stability/entry/src/main/ets/MainAbility/pages/Divider.ets @@ -0,0 +1,71 @@ +/* + * 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 router from '@system.router' + +@Entry +@Component +struct divider_textcase { + @State vertical: boolean = true + @State color: Color = Color.Red + @State strokeWidth: number = 7 + @State lineCap: LineCapStyle = LineCapStyle.Butt + @State active: boolean = false + private content: string = "Divider Page"; + + onPageShow() { + console.info('Button page show called'); + } + + onBuildDone() { + console.info('Button page build done called'); + } + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Text(`${this.content}`) + .fontSize(50) + Divider() + .lineCap(LineCapStyle.Butt) + .strokeWidth(this.strokeWidth) + .color(this.color) + .vertical(this.vertical) + .height(150) + .key('divider') + .onClick(() => { + router.back() + }) + Divider() + .lineCap(LineCapStyle.Round) + .vertical(false) + .color(Color.Green) + .strokeWidth(10) + .height(150) + .key('divider1') + Divider() + .lineCap(LineCapStyle.Square) + .color(Color.Green) + .vertical(true) + .strokeWidth(10) + .height(150) + .key('divider2') + } + .key('flex') + .width('100%') + .height('100%') + } +} + + diff --git a/telephony/telephonyjstest/contact_stability/entry/src/main/ets/MainAbility/pages/Flex.ets b/telephony/telephonyjstest/contact_stability/entry/src/main/ets/MainAbility/pages/Flex.ets new file mode 100644 index 000000000..a0e21251e --- /dev/null +++ b/telephony/telephonyjstest/contact_stability/entry/src/main/ets/MainAbility/pages/Flex.ets @@ -0,0 +1,135 @@ +/* + * 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. + */ + +@Entry +@Component +struct flex { + private content: string = "Flex Page" + + onPageShow() { + console.info('Flex page show called'); + } + + onBuildDone() { + console.info('Flex page build done called'); + } + + build() { + Column() { + Column({ space : 2 }) { + Text('direction:Column').fontSize(9).fontColor(0xCCCCCC).width('90%') + Flex({ + direction: FlexDirection.Column, + wrap: FlexWrap.NoWrap, + justifyContent: FlexAlign.Center, + alignItems:ItemAlign.Start, + alignContent: FlexAlign.Start, + }) { + Text('1').width('100%').height(20).backgroundColor(0xF5DEB3) + Text('2').width('100%').height(20).backgroundColor(0xD2B48C) + Text('3').width('100%').height(20).backgroundColor(0xF5DEB3) + } + .key('flex') + .height(70) + .width('90%') + .padding(10) + .backgroundColor(0xAFEEEE) + + Text('direction:Row').fontSize(9).fontColor(0xCCCCCC).width('90%') + Flex({ + direction: FlexDirection.Row, + wrap: FlexWrap.Wrap, + justifyContent: FlexAlign.Start, + alignItems:ItemAlign.Start, + alignContent: FlexAlign.Center, + }) { + Text('1').width('20%').height(20).backgroundColor(0xF5DEB3) + Text('2').width('20%').height(20).backgroundColor(0xD2B48C) + Text('3').width('20%').height(20).backgroundColor(0xF5DEB3) + } + .key('flex1') + .height(70) + .width('90%') + .padding(10) + .backgroundColor(0xAFEEEE) + + Text('direction:RowReverse').fontSize(9).fontColor(0xCCCCCC).width('90%') + Flex({ + direction: FlexDirection.RowReverse, + wrap: FlexWrap.Wrap, + justifyContent: FlexAlign.End, + alignItems:ItemAlign.End, + alignContent: FlexAlign.End, + }) { + Text('1').width('50%').height(20).backgroundColor(0xF5DEB3) + Text('2').width('50%').height(20).backgroundColor(0xD2B48C) + Text('3').width('50%').height(20).backgroundColor(0xF5DEB3) + } + .key('flex2') + .height(90) + .width('90%') + .padding(10) + .backgroundColor(0xAFEEEE) + + Text('justifyContent:SpaceBetween').fontSize(9).fontColor(0xCCCCCC).width('90%') + Flex({ + justifyContent: FlexAlign.SpaceBetween, + wrap: FlexWrap.Wrap, + }) { + Text('1').width('100%').height(20).backgroundColor(0xF5DEB3) + Text('2').width('100%').height(20).backgroundColor(0xD2B48C) + Text('3').width('100%').height(20).backgroundColor(0xF5DEB3) + } + .key('flex3') + .height(100) + .width('90%') + .padding(10) + .backgroundColor(0xAFEEEE) + + Text('justifyContent AND alignContent').fontSize(9).fontColor(0xCCCCCC).width('90%') + Flex({ + justifyContent: FlexAlign.SpaceEvenly, + alignContent: FlexAlign.SpaceEvenly, + wrap: FlexWrap.Wrap, + }) { + Text('1').width('50%').height(20).backgroundColor(0xF5DEB3) + Text('2').width('50%').height(20).backgroundColor(0xD2B48C) + Text('3').width('50%').height(20).backgroundColor(0xF5DEB3) + } + .key('flex4') + .height(90) + .width('90%') + .padding(10) + .backgroundColor(0xAFEEEE) + + Text('justifyContent AND alignContent').fontSize(9).fontColor(0xCCCCCC).width('90%') + Flex({ + justifyContent: FlexAlign.SpaceAround, + alignContent: FlexAlign.SpaceAround, + wrap: FlexWrap.Wrap, + }) { + Text('1').width('50%').height(20).backgroundColor(0xF5DEB3) + Text('2').width('50%').height(20).backgroundColor(0xD2B48C) + Text('3').width('50%').height(20).backgroundColor(0xF5DEB3) + } + .key('flex5') + .height(90) + .width('90%') + .padding(10) + .backgroundColor(0xAFEEEE) + }.width('100%').margin({ top: 5 }) + }.width('100%') + } +} diff --git a/telephony/telephonyjstest/contact_stability/entry/src/main/ets/MainAbility/pages/GridContainer.ets b/telephony/telephonyjstest/contact_stability/entry/src/main/ets/MainAbility/pages/GridContainer.ets new file mode 100644 index 000000000..573581104 --- /dev/null +++ b/telephony/telephonyjstest/contact_stability/entry/src/main/ets/MainAbility/pages/GridContainer.ets @@ -0,0 +1,170 @@ +/* + * 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. + */ + +@Entry +@Component +struct gridContainer { + @State sizeType: SizeType = SizeType.XS + @State active: boolean = false + private content: string = "GridContainer Page" + + onPageShow() { + console.info('GridContainer page show called'); + } + + onBuildDone() { + console.info('GridContainer page build done called'); + } + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Text(`${this.content}`) + .fontSize(50) + .fontWeight(FontWeight.Bold) + Scroll() { + Column({ space: 5 }) { + GridContainer({ columns: 12, sizeType: this.sizeType, gutter: 10, margin: 20 }) { + Row() { + Text('1') + .useSizeType({ + xs: { span: 6, offset: 0 }, + sm: { span: 2, offset: 0 }, + md: { span: 2, offset: 0 }, + lg: { span: 2, offset: 0 } + }) + .height(50).backgroundColor(0x4682B4).textAlign(TextAlign.Center) + Text('2').gridSpan(2) + + .height(50).backgroundColor(0x00BFFF).textAlign(TextAlign.Center) + Text('3').gridOffset(3) + + .height(50).backgroundColor(0x4682B4).textAlign(TextAlign.Center) + } + }.key('gridContainer') + .width('90%') + .alignItems(HorizontalAlign.Start) + + Text('Click Simulate to change the device width').fontSize(9).width('90%').fontColor(0xCCCCCC) + Row() { + Button('XS') + .onClick(() => { + this.sizeType = SizeType.XS + }).backgroundColor(0x317aff) + Button('SM') + .onClick(() => { + this.sizeType = SizeType.SM + }).backgroundColor(0x317aff) + Button('MD') + .onClick(() => { + this.sizeType = SizeType.MD + }).backgroundColor(0x317aff) + Button('LG') + .onClick(() => { + this.sizeType = SizeType.LG + }).backgroundColor(0x317aff) + } + + GridContainer({ columns: "auto", sizeType: SizeType.MD, gutter: '10', margin: '20' }) { + Row() { + Text('1') + .useSizeType({ + xs: { span: 6, offset: 0 }, + sm: { span: 2, offset: 0 }, + md: { span: 2, offset: 0 }, + lg: { span: 2, offset: 0 } + }) + .height(50).backgroundColor(0x4682B4).textAlign(TextAlign.Center) + Text('2').gridSpan(2) + + .height(50).backgroundColor(0x00BFFF).textAlign(TextAlign.Center) + Text('3').gridOffset(3) + + .height(50).backgroundColor(0x4682B4).textAlign(TextAlign.Center) + } + }.key('gridContainer1') + .width('90%') + .alignItems(HorizontalAlign.Center) + + GridContainer({ columns: 12, sizeType: SizeType.SM, gutter: 10, margin: 20 }) { + Row() { + Text('1') + .useSizeType({ + xs: { span: 6, offset: 0 }, + sm: { span: 2, offset: 0 }, + md: { span: 2, offset: 0 }, + lg: { span: 2, offset: 0 } + }) + .height(50).backgroundColor(0x4682B4).textAlign(TextAlign.Center) + Text('2').gridSpan(2) + + .height(50).backgroundColor(0x00BFFF).textAlign(TextAlign.Center) + Text('3').gridOffset(3) + + .height(50).backgroundColor(0x4682B4).textAlign(TextAlign.Center) + } + }.key('gridContainer2') + .width('90%') + .alignItems(HorizontalAlign.End) + + GridContainer({ columns: 12, sizeType: SizeType.LG, gutter: 10, margin: 20 }) { + Row() { + Text('1') + .useSizeType({ + xs: { span: 6, offset: 0 }, + sm: { span: 2, offset: 0 }, + md: { span: 2, offset: 0 }, + lg: { span: 2, offset: 0 } + }) + .height(50).backgroundColor(0x4682B4).textAlign(TextAlign.Center) + Text('2').gridSpan(2) + + .height(50).backgroundColor(0x00BFFF).textAlign(TextAlign.Center) + Text('3').gridOffset(3) + + .height(50).backgroundColor(0x4682B4).textAlign(TextAlign.Center) + } + }.key('gridContainer3') + .width('90%') + .alignItems(HorizontalAlign.End) + + GridContainer({ columns: 12, sizeType: SizeType.Auto, gutter: 10, margin: 20 }) { + Row() { + Text('1') + .useSizeType({ + xs: { span: 6, offset: 0 }, + sm: { span: 2, offset: 0 }, + md: { span: 2, offset: 0 }, + lg: { span: 2, offset: 0 } + }) + .height(50).backgroundColor(0x4682B4).textAlign(TextAlign.Center) + Text('2').gridSpan(2) + + .height(50).backgroundColor(0x00BFFF).textAlign(TextAlign.Center) + Text('3').gridOffset(3) + + .height(50).backgroundColor(0x4682B4).textAlign(TextAlign.Center) + } + }.key('gridContainer4') + .width('90%') + .alignItems(HorizontalAlign.End) + + }.width('100%').margin({ top: 5 }) + } + } + .key('flex') + .width('100%') + .height('100%') + } +} diff --git a/telephony/telephonyjstest/contact_stability/entry/src/main/ets/MainAbility/pages/Image.ets b/telephony/telephonyjstest/contact_stability/entry/src/main/ets/MainAbility/pages/Image.ets new file mode 100644 index 000000000..5cc583e93 --- /dev/null +++ b/telephony/telephonyjstest/contact_stability/entry/src/main/ets/MainAbility/pages/Image.ets @@ -0,0 +1,90 @@ +/* + * 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. + */ + +@Entry +@Component +struct image_textcase { + @State Width: number = 0 + @State height: number = 0 + + onPageShow() { + console.info('Image page show called'); + } + + onBuildDone() { + console.info('Image page build done called'); + } + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Column() { + Text(`Image page`) + .fontSize(50) + .fontWeight(FontWeight.Bold) + Image("/resources/rawfile/hand.png") + .matchTextDirection(false) + .fitOriginalSize(false) + .fillColor(0xCCCCCC) + .objectFit(ImageFit.Cover) + .objectRepeat(ImageRepeat.NoRepeat) + .interpolation(ImageInterpolation.None) + .renderMode(ImageRenderMode.Original) + .autoResize(false) + .syncLoad(false) + .sourceSize({ width: 200, height: 100 }) + .alt("/resources/rawfile/person.png") + .key('image1') + Image("/resources/rawfile/hand.png") + .objectFit(ImageFit.Contain) + .objectRepeat(ImageRepeat.X) + .interpolation(ImageInterpolation.High) + .renderMode(ImageRenderMode.Template) + .key('image2') + .height(180) + .width(180) + .onComplete((msg: { + width: number, + height: number + }) => { + this.Width = msg.width + this.height = msg.height + console.info('Width ----' + this.Width) + console.info('height ----' + this.height) + }) + .onError(() => { + console.info('load image fail') + }) + Image("/resources/rawfile/hand.png") + .objectFit(ImageFit.Fill) + .objectRepeat(ImageRepeat.Y) + .interpolation(ImageInterpolation.Low) + .key('image3') + Image("/resources/rawfile/hand.png") + .objectFit(ImageFit.None) + .objectRepeat(ImageRepeat.XY) + .interpolation(ImageInterpolation.Medium) + .key('image4') + Image("/resources/rawfile/hand.png") + .objectFit(ImageFit.ScaleDown) + .key('image5') + }.width(300) + .height(300) + .borderColor(Color.Pink) + .borderWidth(4) + } + } +} + + diff --git a/telephony/telephonyjstest/contact_stability/entry/src/main/ets/MainAbility/pages/Navigator.ets b/telephony/telephonyjstest/contact_stability/entry/src/main/ets/MainAbility/pages/Navigator.ets new file mode 100644 index 000000000..6c50769cf --- /dev/null +++ b/telephony/telephonyjstest/contact_stability/entry/src/main/ets/MainAbility/pages/Navigator.ets @@ -0,0 +1,60 @@ +/* + * 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. + */ + +@Entry +@Component +struct navigator_testcase { + @State active: boolean = false + @State params: Object = { text: 'news' } + + onPageShow() { + console.info('Navigator page show called'); + } + + onBuildDone() { + console.info('Navigator page build done called'); + } + + build() { + Column() { + Navigator({ target: "pages/index", type: NavigationType.Back }) { + Text('Navigator test in Navigator,back') + }.active(this.active) + .key('navigator') + .params({ + data: 24 + }) + + Navigator({ target: "pages/index", type: NavigationType.Push }) { + Text('Navigator test in Navigator,push') + }.active(this.active) + .key('navigator2') + .params({ + data: 24 + }) + + Navigator({ target: "pages/index", type: NavigationType.Replace }) { + Text('Navigator test in Navigator,replace') + }.active(this.active) + .key('navigator3') + .params({ + data: 24 + }) + }.width(300) + .height(300) + .borderColor(Color.Pink) + .borderWidth(2) + } +} diff --git a/telephony/telephonyjstest/contact_stability/entry/src/main/ets/MainAbility/pages/Panel.ets b/telephony/telephonyjstest/contact_stability/entry/src/main/ets/MainAbility/pages/Panel.ets new file mode 100644 index 000000000..32ddabbd1 --- /dev/null +++ b/telephony/telephonyjstest/contact_stability/entry/src/main/ets/MainAbility/pages/Panel.ets @@ -0,0 +1,96 @@ +/* + * 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. + */ + +@Entry +@Component +struct PanelExample { + @State show: boolean = true + + onPageShow() { + console.info('Panel page show called'); + } + + onBuildDone() { + console.info('Panel page build done called'); + } + + build() { + Column() { + Text('2021-09-30 Today Calendar: 1.afternoon......Click for details') + .width('90%') + .height(50) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + .padding({ left: 20 }) + .onClick(() => { + this.show = !this.show + }) + Panel(this.show) { + Column() { + Text('Today Calendar') + Divider() + Text('1. afternoon 4:00 The project meeting') + } + } + .key('panel') + .type(PanelType.Foldable) + .mode(PanelMode.Half) + .dragBar(true) + .fullHeight(500) + .halfHeight(250) + .miniHeight(100) + .onChange((value: any) => { + console.info(`width:${value.width},height:${value.height},mode:${value.mode}`) + }) + + Panel(this.show) { + Column() { + Text('Today Calendar') + Divider() + Text('1. afternoon 4:00 The project meeting') + } + } + .key('panel2') + .type(PanelType.Minibar) + .mode(PanelMode.Mini) + .dragBar(true) + .fullHeight(500) + .halfHeight(250) + .miniHeight(100) + .onChange((value: any) => { + console.info(`width:${value.width},height:${value.height},mode:${value.mode}`) + }) + + Panel(false) { + Column() { + Text('Today Calendar') + Divider() + Text('1. afternoon 4:00 The project meeting') + } + } + .key('panel3') + .type(PanelType.Temporary) + .mode(PanelMode.Full) + .dragBar(true) + .fullHeight(500) + .halfHeight(250) + .miniHeight(100) + .onChange((value: any) => { + console.info(`width:${value.width},height:${value.height},mode:${value.mode}`) + }) + + }.width('100%').height('50%').backgroundColor(0xDCDCDC).padding({ top: 5 }) + } +} \ No newline at end of file diff --git a/telephony/telephonyjstest/contact_stability/entry/src/main/ets/MainAbility/pages/Progress.ets b/telephony/telephonyjstest/contact_stability/entry/src/main/ets/MainAbility/pages/Progress.ets new file mode 100644 index 000000000..c8608089f --- /dev/null +++ b/telephony/telephonyjstest/contact_stability/entry/src/main/ets/MainAbility/pages/Progress.ets @@ -0,0 +1,76 @@ +/* + * 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. + */ + +@Entry +@Component +struct progress_testcase { + onPageShow() { + console.info('Progress page show called'); + } + + onBuildDone() { + console.info('Progress page build done called'); + } + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Column() { + Text(`Progress page`) + .fontSize(50) + .fontWeight(FontWeight.Bold) + Progress({ value: 20, total: 40, style: ProgressStyle.Linear }) + .value(3) + .color(Color.Blue) + .width(50) + .height(70) + .key('progress') + + Progress({ value: 20, total: 40, style: ProgressStyle.Eclipse }) + .value(3) + .color(Color.Blue) + .width(50) + .height(70) + .key('progress2') + + Progress({ value: 20, total: 40, style: ProgressStyle.Ring }) + .value(3) + .color(Color.Blue) + .width(50) + .height(70) + .key('progress3') + + Progress({ value: 20, total: 40, style: ProgressStyle.ScaleRing }) + .value(3) + .color(Color.Blue) + .width(50) + .height(70) + .key('progress4') + + Progress({ value: 20, total: 40, style: ProgressStyle.Capsule }) + .value(3) + .color(Color.Blue) + .width(50) + .height(70) + .key('progress5') + + } + .width(400) + .height(400) + .borderColor(Color.Pink) + .borderWidth(2) + } + } +} + diff --git a/telephony/telephonyjstest/contact_stability/entry/src/main/ets/MainAbility/pages/Qrcode.ets b/telephony/telephonyjstest/contact_stability/entry/src/main/ets/MainAbility/pages/Qrcode.ets new file mode 100644 index 000000000..5c0dd84ef --- /dev/null +++ b/telephony/telephonyjstest/contact_stability/entry/src/main/ets/MainAbility/pages/Qrcode.ets @@ -0,0 +1,44 @@ +/* + * 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. + */ + +@Entry +@Component +struct qrcode_textcase { + @State Color: Color = Color.Pink + + onPageShow() { + console.info('Qrcode page show called'); + } + + onBuildDone() { + console.info('Qrcode page build done called'); + } + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Text(`Qrcode page`) + .fontSize(50) + .fontWeight(FontWeight.Bold) + QRCode('hello world') + .color("#FFFFC0CB") + .backgroundColor(this.Color) + .width("200") + .height("100") + .key('qrcode') + } + } +} + + diff --git a/telephony/telephonyjstest/contact_stability/entry/src/main/ets/MainAbility/pages/Rating.ets b/telephony/telephonyjstest/contact_stability/entry/src/main/ets/MainAbility/pages/Rating.ets new file mode 100644 index 000000000..b29e26a39 --- /dev/null +++ b/telephony/telephonyjstest/contact_stability/entry/src/main/ets/MainAbility/pages/Rating.ets @@ -0,0 +1,63 @@ +/* + * 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. + */ + +@Entry +@Component +struct rating_testcase { + @State rating: number = 2 + + onPageShow() { + console.info('Rating page show called'); + } + + onBuildDone() { + console.info('Rating page build done called'); + } + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Column() { + Text(`Rating page`) + .fontSize(50) + .fontWeight(FontWeight.Bold) + Rating({ rating: 2, indicator: false }) + .stepSize(0.5) + .stars(5) + .starStyle({ + backgroundUri: '/resources/rawfile/star-1-1.png', + foregroundUri: '/resources/rawfile/star-1-3.png', + secondaryUri: '/resources/rawfile/star-1-2.png' + }) + .onChange((value: number) => { + this.rating = value + }) + .key('rating1') + Rating({ rating: 2, indicator: true }) + .stepSize(0.5) + .stars(5) + .starStyle({ + backgroundUri: '/resources/rawfile/star-1-1.png', + foregroundUri: '/resources/rawfile/star-1-3.png', + secondaryUri: '/resources/rawfile/star-1-2.png' + }) + .key('rating2') + }.width(300) + .height(300) + .borderColor(Color.Pink) + .borderWidth(2) + } + } +} + diff --git a/telephony/telephonyjstest/contact_stability/entry/src/main/ets/MainAbility/pages/RowSplit.ets b/telephony/telephonyjstest/contact_stability/entry/src/main/ets/MainAbility/pages/RowSplit.ets new file mode 100644 index 000000000..0f4f397b1 --- /dev/null +++ b/telephony/telephonyjstest/contact_stability/entry/src/main/ets/MainAbility/pages/RowSplit.ets @@ -0,0 +1,78 @@ +/* + * 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 router from '@system.router' + +@Entry +@Component +struct rowSplit_testcase { + @State resizeable: boolean = false + private content: string = "rowSplit Page"; + + onPageShow() { + console.info('RowSplit page show called'); + } + + onBuildDone() { + console.info('RowSplit page build done called'); + } + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Text(`${this.content}`) + .fontSize(50) + .fontWeight(FontWeight.Bold) + RowSplit() { + Column() { + Text('Demo1.RowSplit') + .fontSize(15) + .fontWeight(FontWeight.Bold) + } + + Column() { + Text('Demo2.RowSplit') + .fontSize(15) + .fontWeight(FontWeight.Bold) + } + } + .height(100) + .key('rowSplit') + .resizeable(this.resizeable) + .onClick(() => { + router.back() + }) + + RowSplit() { + Column() { + Text('Demo3.RowSplit') + .fontSize(15) + .fontWeight(FontWeight.Bold) + } + + Column() { + Text('Demo4.RowSplit') + .fontSize(15) + .fontWeight(FontWeight.Bold) + } + }.height(100) + .key('rowSplit1') + .resizeable(true) + } + .key('flex') + .width('100%') + .height('100%') + } +} + diff --git a/telephony/telephonyjstest/contact_stability/entry/src/main/ets/MainAbility/pages/Scroll.ets b/telephony/telephonyjstest/contact_stability/entry/src/main/ets/MainAbility/pages/Scroll.ets new file mode 100644 index 000000000..363089d22 --- /dev/null +++ b/telephony/telephonyjstest/contact_stability/entry/src/main/ets/MainAbility/pages/Scroll.ets @@ -0,0 +1,200 @@ +/* + * 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. + */ + +@Entry +@Component +struct scroll_testcase { + @State scrollBarWidth: number = 20 + @State scrollable: ScrollDirection = ScrollDirection.None + @State scrollBarColor: Color = Color.Pink + @State scrollBar: BarState= BarState.On + private value1: Array = [1, 2, 3, 4, 5, 6, 7, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30] + @State edge: Edge= Edge.Top + private content: string = "Scroll Page"; + scroller: Scroller = new Scroller(); + + onPageShow() { + console.info('Button page show called'); + } + + onBuildDone() { + console.info('Button page build done called'); + } + + build() { + + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Text(`${this.content}`) + .fontSize(50) + .fontWeight(FontWeight.Bold) + Scroll(this.scroller) { + Column() { + ForEach( + this.value1, + item => { + Text(`${item}`) + .fontSize(15) + .width(400) + .margin(10) + .height(70) + .backgroundColor(0xfff5deb3) + }, + item => item + ) + } + } + .scrollable(ScrollDirection.Vertical) + .scrollBar(this.scrollBar) + .scrollBarColor(this.scrollBarColor) + .scrollBarWidth(this.scrollBarWidth) + .key('scroll') + .width(400) + .height(200) + .onScroll((xOffset: number, yOffset: number) => { + console.info(` current offset is ${xOffset} ${yOffset}`) + }) + .onScrollEnd(() => { + console.info(` now on scroll end`) + }) + .onScrollEdge((side: Edge) => { + console.info(`To the edge`) + }) + Scroll() { + Row() { + Text('scroll uppppp') + .width(60) + .height(100) + .backgroundColor(Color.Yellow) + .margin({ + right: 5, + left: 5 + }) + .key('text') + + Text('scroll to') + .width(60) + .height(100) + .backgroundColor(Color.Green) + .margin({ + right: 5, + left: 5 + }) + .onClick(() => { + this.scroller.scrollTo({ + xOffset: 100, + yOffset: 100, + }) + }) + Text('scroll page') + .width(60) + .height(100) + .backgroundColor(Color.Blue) + .margin({ + right: 5, + left: 5 + }) + .onClick(() => { + this.scroller.scrollPage({ + next: true + }) + }) + Text('scroll Edge') + .width(60) + .height(100) + .backgroundColor(Color.Blue) + .margin({ + right: 5, + left: 5 + }) + .onClick(() => { + this.scroller.scrollEdge(Edge.Top) + }) + Text('scroll Edge') + .width(60) + .height(100) + .backgroundColor(Color.Blue) + .margin({ + right: 5, + left: 5 + }) + .onClick(() => { + this.scroller.currentOffset() + }) + Text('scroll to index') + .width(60) + .height(100) + .backgroundColor(Color.Blue) + .margin({ + right: 5, + left: 5 + }) + .onClick(() => { + this.scroller.scrollToIndex(0) + console.info(` now on scroll end`) + }) + } + } + .key('scroll1') + .height(100) + .scrollable(ScrollDirection.Horizontal) + + Scroll() { + Column() { + Text("start").fontSize(30) + Text("scrollable1") + Text("scrollable2") + Text("scrollable3") + Text("scrollable4") + Text("scrollable1") + Text("scrollable2") + Text("scrollable3") + Text("scrollable4") + } + } + .padding(10) + .scrollable(ScrollDirection.None) + .scrollBar(BarState.Off) + .scrollBarColor(Color.Red) + .scrollBarWidth(5) + .width(300) + .height(200) + .key('scroll2') + + Scroll() { + Column() { + Text("start").fontSize(30) + Text("scrollable1") + Text("scrollable2") + Text("scrollable3") + Text("scrollable4") + Text("scrollable1") + Text("scrollable2") + Text("scrollable3") + Text("scrollable4") + } + } + .padding(10) + .scrollable(ScrollDirection.Free) + .scrollBar(BarState.Off) + .scrollBarColor(Color.Red) + .scrollBarWidth(5) + .width(300) + .height(200) + .key('scroll3') + } + .key('flex') + + } +} diff --git a/telephony/telephonyjstest/contact_stability/entry/src/main/ets/MainAbility/pages/Slider.ets b/telephony/telephonyjstest/contact_stability/entry/src/main/ets/MainAbility/pages/Slider.ets new file mode 100644 index 000000000..625cd0287 --- /dev/null +++ b/telephony/telephonyjstest/contact_stability/entry/src/main/ets/MainAbility/pages/Slider.ets @@ -0,0 +1,82 @@ +/* + * 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. + */ + +@Entry +@Component +struct slider { + @State inSetValue: number= 40 + @State outSetValue: number= 40 + @State direction: Axis= Axis.Horizontal + @State Begin: number = SliderChangeMode.Begin + + onPageShow() { + console.info('Slider page show called'); + } + + onBuildDone() { + console.info('Slider page build done called'); + } + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Column() { + Text(`Slider page`) + .fontSize(50) + .fontWeight(FontWeight.Bold) + Slider({ + value: this.outSetValue, + min: 0, + max: 100, + step: 1, + direction: Axis.Horizontal, + reverse: false, + style: SliderStyle.OutSet + }) + .blockColor('#FFFF0000') + .selectedColor('#FF0000FF') + .trackColor('#FF808080') + .minLabel('10') + .maxLabel('10') + .showTips(false) + .showSteps(false) + .onChange((value: number, mode: SliderChangeMode) => { + this.outSetValue = value + this.Begin = mode + console.info('value: ' + value + '---mode: ' + mode) + }) + .width("100") + .height("100") + .key('slider1') + Slider({ + value: 40, + min: 0, + max: 100, + step: 1, + style: SliderStyle.InSet + }) + .blockColor(Color.Red) + .selectedColor(Color.Blue) + .trackColor(Color.Gray) + .showTips(true) + .showSteps(true) + .key('slider2') + }.width(300) + .height(300) + .borderColor(Color.Pink) + .borderWidth(2) + } + } +} + diff --git a/telephony/telephonyjstest/contact_stability/entry/src/main/ets/MainAbility/pages/Span.ets b/telephony/telephonyjstest/contact_stability/entry/src/main/ets/MainAbility/pages/Span.ets new file mode 100644 index 000000000..df5a71043 --- /dev/null +++ b/telephony/telephonyjstest/contact_stability/entry/src/main/ets/MainAbility/pages/Span.ets @@ -0,0 +1,64 @@ +/* + * 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. + */ + +@Entry +@Component +struct span_textcase { + + onPageShow() { + console.info('Span page show called'); + } + + onBuildDone() { + console.info('Span page build done called'); + } + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Column() { + Text() { + Span('Test Span demo') + .decoration({ type: TextDecorationType.LineThrough, "color": Color.Red }) + .textCase(TextCase.UpperCase) + .fontColor(Color.Blue) + .fontSize("20fp") + .letterSpacing(5) + .fontFamily("sans-serif") + .fontWeight(FontWeight.Bold) + .fontStyle(FontStyle.Italic) + .key('span1') + Span('The second test Span demo') + .textCase(TextCase.LowerCase) + .fontColor(Color.Black) + .letterSpacing('5') + .fontSize(30) + .key('span2') + Span('The third test Span demo') + .textCase(TextCase.Normal) + .fontColor(Color.Yellow) + .fontSize("30fp") + .key('span3') + } + } + .width(300) + .height(300) + .borderColor(Color.Pink) + .borderWidth(4) + } + } +} + + + diff --git a/telephony/telephonyjstest/contact_stability/entry/src/main/ets/MainAbility/pages/Stack.ets b/telephony/telephonyjstest/contact_stability/entry/src/main/ets/MainAbility/pages/Stack.ets new file mode 100644 index 000000000..2a694889f --- /dev/null +++ b/telephony/telephonyjstest/contact_stability/entry/src/main/ets/MainAbility/pages/Stack.ets @@ -0,0 +1,103 @@ +/* + * 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 router from '@system.router' + +@Entry +@Component +struct stack_testcase { + @State alignContent: Alignment = Alignment.Bottom + private content: string = "Stack Page"; + + onPageShow() { + console.info('Stack page show called'); + } + + onBuildDone() { + console.info('Stack page build done called'); + } + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Text(`${this.content}`) + .fontSize(50) + .fontWeight(FontWeight.Bold) + Stack({ alignContent: this.alignContent }) { + Text('First child, show in bottom').width('90%').height('100%').backgroundColor(0xd2cab3).align(Alignment.Top) + Text('Second child, show in top').width('70%').height('60%').backgroundColor(0xc1cbac).align(Alignment.Top) + } + .width('100%') + .height(80) + .margin({ top: 5 }) + .key('stack') + .onClick(() => { + router.back() + }) + + Stack({ alignContent: Alignment.BottomStart }) { + Text('First child, show in bottom').width('90%').height('100%').backgroundColor(0xd2cab3).align(Alignment.Top) + Text('Second child, show in top').width('70%').height('60%').backgroundColor(0xc1cbac).align(Alignment.Top) + }.width('100%').height(80).margin({ top: 5 }) + .key('stack1') + + Stack({ alignContent: Alignment.BottomEnd }) { + Text('First child, show in bottom').width('90%').height('100%').backgroundColor(0xd2cab3).align(Alignment.Top) + Text('Second child, show in top').width('70%').height('60%').backgroundColor(0xc1cbac).align(Alignment.Top) + }.width('100%').height(80).margin({ top: 5 }) + .key('stack2') + + Stack({ alignContent: Alignment.Start }) { + Text('First child, show in bottom').width('90%').height('100%').backgroundColor(0xd2cab3).align(Alignment.Top) + Text('Second child, show in top').width('70%').height('60%').backgroundColor(0xc1cbac).align(Alignment.Top) + }.width('100%').height(80).margin({ top: 5 }) + .key('stack3') + + Stack({ alignContent: Alignment.Center }) { + Text('First child, show in bottom').width('90%').height('100%').backgroundColor(0xd2cab3).align(Alignment.Top) + Text('Second child, show in top').width('70%').height('60%').backgroundColor(0xc1cbac).align(Alignment.Top) + }.width('100%').height(80).margin({ top: 5 }) + .key('stack4') + + Stack({ alignContent: Alignment.End }) { + Text('First child, show in bottom').width('90%').height('100%').backgroundColor(0xd2cab3).align(Alignment.Top) + Text('Second child, show in top').width('70%').height('60%').backgroundColor(0xc1cbac).align(Alignment.Top) + }.width('100%').height(80).margin({ top: 5 }) + .key('stack5') + + Stack({ alignContent: Alignment.Top }) { + Text('First child, show in bottom').width('90%').height('100%').backgroundColor(0xd2cab3).align(Alignment.Top) + Text('Second child, show in top').width('70%').height('60%').backgroundColor(0xc1cbac).align(Alignment.Top) + }.width('100%').height(60).margin({ top: 5 }) + .key('stack6') + + Stack({ alignContent: Alignment.TopStart }) { + Text('First child, show in bottom').width('90%').height('100%').backgroundColor(0xd2cab3).align(Alignment.Top) + Text('Second child, show in top').width('70%').height('60%').backgroundColor(0xc1cbac).align(Alignment.Top) + }.width('100%').height(60).margin({ top: 5 }) + .key('stack7') + + Stack({ alignContent: Alignment.TopEnd }) { + Text('First child, show in bottom').width('90%').height('100%').backgroundColor(0xd2cab3).align(Alignment.Top) + Text('Second child, show in top').width('70%').height('60%').backgroundColor(0xc1cbac).align(Alignment.Top) + }.width('100%').height(60).margin({ top: 5 }) + .key('stack8') + } + .key('flex') + .width('100%') + .height('100%') + + } +} + diff --git a/telephony/telephonyjstest/contact_stability/entry/src/main/ets/MainAbility/pages/Text.ets b/telephony/telephonyjstest/contact_stability/entry/src/main/ets/MainAbility/pages/Text.ets new file mode 100644 index 000000000..fbd1415dc --- /dev/null +++ b/telephony/telephonyjstest/contact_stability/entry/src/main/ets/MainAbility/pages/Text.ets @@ -0,0 +1,237 @@ +/* + * 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. + */ + +// @ts-nocheck +import router from '@system.router' + +var paramInfo = router.getParams() +console.info("cd paramInfo" + JSON.stringify(paramInfo)) + +@Entry +@Component +struct text_textcase { + @State textAlign: TextAlign= TextAlign.End + @State lineHeight: string= '15fp' + @State overflow: TextOverflow = TextOverflow.Ellipsis + @State textOverflow: textOverflow<{ "overflow": TextOverflow }> = { "overflow": this.overflow } + @State maxLines: number = 2 + @State baselineOffset: number = 0 + @State textCase: TextCase= TextCase.Normal + @State decoration: decoration<{ + type: TextDecorationType, + color: Color + }> = { type: TextDecorationType.Underline, color: Color.Red } + @State color: Color = Color.Red + @State width: string= "200" + @State height: string= "100" + @State size: size = { width: 200, height: 100 } + @State marginBottom: string = "10px" + @State marginTop: string = "10px" + @State marginLeft: string = "10px" + @State marginRingt: string= "10px" + @State paddingBottom: string= "5" + @State paddingTop: string= "5" + @State paddingLeft: string= "5" + @State paddingRingt: string= "5" + @State constraintSize: constraintSize = { minWidth: 20, maxWidth: 200, minHeight: 0, maxHeight: 50 } + @State layoutPriority: string= "9px" + @State layoutWeight: string = "10px" + @State align: Alignment = Alignment.Center + @State direction: Direction = Direction.Auto + @State position: position<{ + x: string, + y: string + }> = { x: "50", y: "50" } + @State markAnchor: markAnchor<{ + x: string, + y: string + }> = { x: "50", y: "50" } + @State offset: offset<{ + x: string, + y: string + }> = { x: "50", y: "50" } + @State flexGrow: number = 5 + @State flexShrink: number = 2 + @State flexBasis: number = 0 + @State alignSelf: ItemAlign = ItemAlign.Auto + @State borderStyle: BorderStyle = BorderStyle.Dashed + @State borderRadius: number = 10 + @State borderWidth: string= "4px" + @State borderColor: Color= Color.Blue + @State backgroundColor: Color = Color.Pink + @State backgroundImageSize: ImageSize = ImageSize.Cover + @State backgroundImagePosition: Alignment= Alignment.Center + @State opacity: number= 1 + @State visibility: Visibility= Visibility.Visible + @State enabled: boolean = false + @State zIndex: number = 1 + @State fontStyle: FontStyle = FontStyle.Italic + @State fontSize: number = 15 + @State minFontSize: number = 15 + @State maxFontSize: number = 15 + @State letterSpacing: number= 10 + @State fontWeight: FontWeight= FontWeight.Bold + @State fontColor: Color= Color.Black + @State active: boolean = false + private content: string = "Text Page"; + + onPageShow() { + console.info('Text page show called'); + } + + onBuildDone() { + console.info('Text page build done called'); + } + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Text(`${this.content}`) + .fontSize(50) + .fontWeight(FontWeight.Bold) + Text('Text Anto test,Text Anto test,Text Anto test,Text Anto test,test,Text Anto test,Text Anto test,Text Anto test,Text Anto test,Text Anto test,Text Anto test') + .width(this.width) + .height(this.height) + .padding({ bottom: this.paddingBottom, top: this.paddingTop, right: this.paddingRingt, left: this.paddingLeft }) + .margin({ bottom: this.marginBottom, top: this.marginTop, right: this.marginRingt, left: this.marginLeft }) + .constraintSize(this.constraintSize) + .layoutWeight(this.layoutWeight) + .align(this.align) + .direction(this.direction) + .position(this.position) + .markAnchor(this.markAnchor) + .offset(this.offset) + .flexBasis(this.flexBasis) + .flexGrow(this.flexGrow) + .flexShrink(this.flexShrink) + .alignSelf(this.alignSelf) + .borderStyle(this.borderStyle) + .borderRadius(this.borderRadius) + .borderWidth(this.borderWidth) + .borderColor(this.borderColor) + .backgroundColor(this.backgroundColor) + .opacity(this.opacity) + .visibility(this.visibility) + .enabled(this.enabled) + .zIndex(this.zIndex) + .fontColor(this.fontColor) + .fontSize(this.fontSize) + .minFontSize(this.minFontSize) + .letterSpacing(this.letterSpacing) + .maxFontSize(this.maxFontSize) + .fontWeight(this.fontWeight) + .fontStyle(this.fontStyle) + .fontFamily("sans-serif") + .textAlign(this.textAlign) + .textOverflow(this.textOverflow) + .lineHeight(this.lineHeight) + .baselineOffset(this.baselineOffset) + .maxLines(2) + .textCase(this.textCase) + .decoration(this.decoration) + .aspectRatio(1) + .fontColor(Color.Black) + .key('Text') + Text('Text Anto test,Text Anto test,Text Anto test,Text Anto test,Text Anto test,Text Anto test,Text Anto test,Text Anto test') + .size({ width: 100, height: 50 }) + .padding({ bottom: 5, top: 5, right: 5, left: 10 }) + .margin({ bottom: 15, top: 10, right: 10, left: 10 }) + .fontSize('13') + .textAlign(TextAlign.Start) + .align(Alignment.Start) + .direction(Direction.Ltr) + .alignSelf(ItemAlign.Start) + .borderStyle(BorderStyle.Dotted) + .borderWidth(2) + .visibility(Visibility.Hidden) + .enabled(true) + .fontWeight(FontWeight.Normal) + .textAlign(TextAlign.Start) + .textOverflow(TextOverflow.Clip) + .maxLines(2) + .textCase(TextCase.LowerCase) + .decoration({ "type": TextDecorationType.LineThrough, "color": Color.Red }) + .fontColor(Color.White) + .key('Text1') + Text('Text Anto test,Text Anto test,Text Anto test,Text Anto test,Text Anto test,Text Anto test,Text Anto test,Text Anto test,Text Anto test') + .fontSize(13) + .width('100%') + .textAlign(TextAlign.Center) + .align(Alignment.TopEnd) + .direction(Direction.Rtl) + .alignSelf(ItemAlign.Center) + .borderStyle(BorderStyle.Solid) + .borderWidth(2) + .visibility(Visibility.None) + .fontWeight(FontWeight.Bolder) + .textAlign(TextAlign.Center) + .textOverflow(TextOverflow.None) + .textCase(TextCase.UpperCase) + .decoration({ "type": TextDecorationType.None, "color": Color.Red }) + .fontColor(Color.Blue) + .key('Text2') + Text('Text Anto test,Text Anto test,Text Anto test,Text Anto test') + .fontSize(13) + .align(Alignment.Top) + .alignSelf(ItemAlign.End) + .borderWidth(2) + .width('100%') + .fontWeight(FontWeight.Lighter) + .decoration({ type: TextDecorationType.Overline, color: Color.Red }) + .fontColor(Color.Gray) + .key('Text3') + Text('Text Anto test,Text Anto test') + .fontSize(13) + .align(Alignment.TopStart) + .alignSelf(ItemAlign.Baseline) + .borderWidth(2) + .width('100%') + .fontWeight(FontWeight.Medium) + .fontColor(Color.Brown) + .key('Text4') + Text('Text Anto test,Text Anto test,Text Anto test') + .fontSize(13) + .align(Alignment.End) + .alignSelf(ItemAlign.Stretch) + .borderWidth(2) + .width('100%') + .fontWeight(FontWeight.Regular) + .fontColor(Color.Grey) + .key('Text5') + Text('Text Anto test,Text Anto test,Text Anto test') + .fontSize(13) + .align(Alignment.BottomEnd) + .width('100%') + .fontColor(Color.Orange) + .key('Text6') + Text('Text Anto test,Text Anto test,Text Anto test') + .fontSize(13) + .align(Alignment.Bottom) + .width('100%') + .fontColor(Color.Yellow) + .key('Text7') + Text('Text Anto test,Text Anto test,Text Anto test') + .fontSize(13) + .align(Alignment.BottomStart) + .width('100%') + .key('Text8') + + } + .key('flex') + .width('100%') + .height('100%') + } +} + + diff --git a/telephony/telephonyjstest/contact_stability/entry/src/main/ets/MainAbility/pages/index.ets b/telephony/telephonyjstest/contact_stability/entry/src/main/ets/MainAbility/pages/index.ets new file mode 100644 index 000000000..10359134d --- /dev/null +++ b/telephony/telephonyjstest/contact_stability/entry/src/main/ets/MainAbility/pages/index.ets @@ -0,0 +1,65 @@ +// @ts-nocheck +/** + * 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 file from '@system.file'; + +import {Core, ExpectExtend, InstrumentLog, ReportExtend} from "deccjsunit/index.ets"; +import testsuite from "../test/List.test.ets"; +import featureAbility from "@ohos.ability.featureAbility"; + +@Entry +@Component +struct MyComponent { + aboutToAppear() { + console.info("start run testcase!!!!") + featureAbility.getWant() + .then((Want) => { + const core = Core.getInstance(); + const expectExtend = new ExpectExtend({ + 'id': 'extend' + }); + core.addService('expect', expectExtend); + const reportExtend = new ReportExtend(file); + core.addService('report', reportExtend); + core.init(); + core.subscribeEvent('task', reportExtend); + const configService = core.getDefaultService('config'); + Want.parameters['timeout'] = 100000 + console.info('parameters---->' + JSON.stringify(Want.parameters)); + configService.setConfig(Want.parameters); + testsuite(); + core.execute(); + console.info('Operation successful. Data: ' + JSON.stringify(Want)); + }) + .catch((error) => { + console.error('Operation failed. Cause: ' + JSON.stringify(error)); + }) + } + + build() { + Flex({ + direction: FlexDirection.Column, + alignItems: ItemAlign.Center, + justifyContent: FlexAlign.Center + }) { + Text('ACE ETS TEST') + .fontSize(50) + .fontWeight(FontWeight.Bold) + } + .width('100%') + .height('100%') + } +} + diff --git a/telephony/telephonyjstest/contact_stability/entry/src/main/ets/MainAbility/test/List.test.ets b/telephony/telephonyjstest/contact_stability/entry/src/main/ets/MainAbility/test/List.test.ets new file mode 100644 index 000000000..a51a5eab3 --- /dev/null +++ b/telephony/telephonyjstest/contact_stability/entry/src/main/ets/MainAbility/test/List.test.ets @@ -0,0 +1,22 @@ +/** + * 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. + */ + +//contact import +import StabilityTest from './contact/Stability_test.js' + +export default function testsuite() { + //contact + StabilityTest(); +} \ No newline at end of file diff --git a/telephony/telephonyjstest/contact_stability/entry/src/main/ets/MainAbility/test/Utils.ets b/telephony/telephonyjstest/contact_stability/entry/src/main/ets/MainAbility/test/Utils.ets new file mode 100644 index 000000000..65f70088d --- /dev/null +++ b/telephony/telephonyjstest/contact_stability/entry/src/main/ets/MainAbility/test/Utils.ets @@ -0,0 +1,119 @@ +// @ts-nocheck +/** + * 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 class Utils { + static rect_left; + static rect_top; + static rect_right; + static rect_bottom; + static rect_value; + static notCheck = true; + + static sleep(time) { + return new Promise((resolve, reject) => { + setTimeout(() => { + resolve() + }, time) + }).then(() => { + console.info(`sleep ${time} over...`) + }) + } + + static getComponentRect(key) { + let strJson = getInspectorByKey(key); + let obj = JSON.parse(strJson); + console.info("[getInspectorByKey] current component obj is: " + JSON.stringify(obj)); + let rectInfo = JSON.parse('[' + obj.$rect + ']') + console.info("[getInspectorByKey] rectInfo is: " + rectInfo); + this.rect_left = JSON.parse('[' + rectInfo[0] + ']')[0] + this.rect_top = JSON.parse('[' + rectInfo[0] + ']')[1] + this.rect_right = JSON.parse('[' + rectInfo[1] + ']')[0] + this.rect_bottom = JSON.parse('[' + rectInfo[1] + ']')[1] + return this.rect_value = { + "left": this.rect_left, "top": this.rect_top, "right": this.rect_right, "bottom": this.rect_bottom + } + } + + static async swipe(downX, downY, upX, upY, steps) { + console.info('start to swipe') + this.drags(downX, downY, upX, upY, steps, false) + } + + static async drag(downX, downY, upX, upY, steps) { + console.info('start to drag') + this.drags(downX, downY, upX, upY, steps, true) + } + + static async drags(downX, downY, upX, upY, steps, drag) { + var xStep; + var yStep; + var swipeSteps; + var ret; + xStep = 0; + yStep = 0; + ret = false; + swipeSteps = steps; + if (swipeSteps == 0) { + swipeSteps = 1; + } + xStep = (upX - downX) / swipeSteps; + yStep = (upY - downY) / swipeSteps; + console.info('move step is: ' + 'xStep: ' + xStep + ' yStep: ' + yStep) + var downPonit: TouchObject = { + id: 1, + x: downX, + y: downY, + type: TouchType.Down, + } + console.info('down touch started: ' + JSON.stringify(downPonit)) + sendTouchEvent(downPonit); + console.info('start to move') + if (drag) { + await this.sleep(500) + } + for (var i = 1;i <= swipeSteps; i++) { + var movePoint: TouchObject = { + id: 1, + x: downX + (xStep * i), + y: downY + (yStep * i), + type: TouchType.Move + } + console.info('move touch started: ' + JSON.stringify(movePoint)) + ret = sendTouchEvent(movePoint) + if (ret == false) { + break; + } + await this.sleep(5) + } + console.info('start to up') + if (drag) { + await this.sleep(100) + } + var upPoint: TouchObject = { + id: 1, + x: upX, + y: upY, + type: TouchType.Up, + } + console.info('up touch started: ' + JSON.stringify(upPoint)) + sendTouchEvent(upPoint) + await this.sleep(500) + } +} + + + + diff --git a/telephony/telephonyjstest/contact_stability/entry/src/main/ets/MainAbility/test/contact/Stability_test.js b/telephony/telephonyjstest/contact_stability/entry/src/main/ets/MainAbility/test/contact/Stability_test.js new file mode 100644 index 000000000..c48dcb218 --- /dev/null +++ b/telephony/telephonyjstest/contact_stability/entry/src/main/ets/MainAbility/test/contact/Stability_test.js @@ -0,0 +1,538 @@ +/* + * 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 featureAbility from '@ohos.ability.featureAbility'; +import ohosDataAbility from '@ohos.data.dataability'; +import utils from '../Utils.ets' +import {afterAll, afterEach, beforeAll, beforeEach, describe, expect, it} from 'deccjsunit/index' + +const URI_CALLLOG = "dataability:///com.ohos.calllogability"; +const calllogUri = "dataability:///com.ohos.calllogability/calls/calllog"; + +const URI_VOICEMAIL = "dataability:///com.ohos.voicemailability"; +const voicemailUri = "dataability:///com.ohos.voicemailability/calls/voicemail"; + +const URI_CONTACTS = "dataability:///com.ohos.contactsdataability"; +const rawContactUri = "dataability:///com.ohos.contactsdataability/contacts/raw_contact"; +const contactDataUri = "dataability:///com.ohos.contactsdataability/contacts/contact_data"; +const deletedUri = "dataability:///com.ohos.contactsdataability/contacts/deleted_raw_contact"; + +export default function StabilityTest() { + describe('StabilityTest', function () { + console.log(' StabilityTest is start'); + + function sleep(numberMillis) { + var now = new Date(); + var exitTime = now.getTime() + numberMillis; + while (true) { + now = new Date(); + if (now.getTime() > exitTime) + return; + } + } + + /** + * @tc.number raw_contact_insert_stability_test_900 + * @tc.name Add 10000 pieces of data to the raw_contact table to see if they can be successfully inserted + * @tc.desc Function test + */ + it("raw_contact_insert_stability_test_900", 0, async function (done) { + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + var listAddBluk = []; + for (var i = 0; i < 1000; i++) { + var add = { + "display_name": "xiaoli" + i, "company": "testCompany" + i, "position": "testPosition" + i + }; + listAddBluk[i] = add; + } + try { + var batchInsertCode = await DAHelper.batchInsert(rawContactUri, listAddBluk); + var batchInsertCode = await DAHelper.batchInsert(rawContactUri, listAddBluk); + var batchInsertCode = await DAHelper.batchInsert(rawContactUri, listAddBluk); + var batchInsertCode = await DAHelper.batchInsert(rawContactUri, listAddBluk); + var batchInsertCode = await DAHelper.batchInsert(rawContactUri, listAddBluk); + var batchInsertCode = await DAHelper.batchInsert(rawContactUri, listAddBluk); + var batchInsertCode = await DAHelper.batchInsert(rawContactUri, listAddBluk); + var batchInsertCode = await DAHelper.batchInsert(rawContactUri, listAddBluk); + var batchInsertCode = await DAHelper.batchInsert(rawContactUri, listAddBluk); + var batchInsertCode = await DAHelper.batchInsert(rawContactUri, listAddBluk); + sleep(1000); + console.info("logMessage raw_contact_insert_stability_test_900: contactDataId1 = " + batchInsertCode); + expect(batchInsertCode == 0).assertTrue(); + done(); + } catch (error) { + console.info('logMessage raw_contact_insert_stability_test_900: insert error = ' + error); + done(); + } + }); + + /** + * @tc.number raw_contact_update_stability_test_1000 + * @tc.name The raw_contact table updates the data whose ID is not equal to 0 to see whether they can be updated + * successfully + * @tc.desc Function test + */ + it("raw_contact_update_stability_test_1000", 0, async function (done) { + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + var updateValues = { + "favorite": 1 + }; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.greaterThan("id", "0"); + condition.and(); + condition.equalTo("is_deleted", "0"); + try { + var updateCode = await DAHelper.update(rawContactUri, updateValues, condition); + sleep(1000); + console.info("logMessage raw_contact_update_stability_test_1000: updateCode = " + updateCode); + expect(updateCode == 0).assertTrue(); + done(); + } catch (error) { + console.info("logMessage raw_contact_update_stability_test_1000: update error = " + error); + done(); + } + }); + + /** + * @tc.number raw_contact_query_stability_test_1100 + * @tc.name The raw_contact table queries 10000 pieces of data to see whether they can be queried successfully + * @tc.desc Function test + */ + it("raw_contact_query_stability_test_1100", 0, async function (done) { + var tag = "raw_contact_query_stability_test_1100"; + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info(tag + ': start ! DAHelper = ' + DAHelper); + var resultColumns = ["id"]; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.greaterThan("id", "0"); + condition.and(); + condition.equalTo("is_deleted", "0"); + try { + var resultSet = await DAHelper.query(rawContactUri, resultColumns, condition); + sleep(1000); + console.info(tag + ' : logMessage : rowCount' + resultSet.rowCount); + expect(resultSet.rowCount == 10000).assertTrue(); + resultSet.close(); + done(); + } catch (error) { + console.info(tag + " :logMessage : error = " + error); + done(); + } + }); + + /** + * @tc.number raw_contact_delete_stability_test_1200 + * @tc.name Delete 10000 pieces of data in raw_contact table to see if they can be deleted successfully + * @tc.desc Function test + */ + it("raw_contact_delete_stability_test_1200", 0, async function (done) { + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('raw_contact_delete_stability_test_1200 : start ! DAHelper = ' + DAHelper); + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.greaterThan("id", "0"); + condition.and(); + condition.equalTo("is_deleted", "0"); + try { + var deleteCode = await DAHelper.delete(rawContactUri, condition); + sleep(1000); + console.info("logMessage raw_contact_delete_stability_test_1200: deleteCode = " + deleteCode); + expect(deleteCode == 0).assertTrue(); + done(); + } catch (error) { + console.info('logMessage raw_contact_delete_stability_test_1200: delete error = ' + error); + done(); + } + }); + + /** + * @tc.number contact_data_insert_stability_test_1300 + * @tc.name Add 10000 pieces of data to the contact_data table to see if they can be successfully inserted + * @tc.desc Function test + */ + it("contact_data_insert_stability_test_1300", 0, async function (done) { + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + var rawContactValues = { + "display_name": "xiaoli", + }; + try { + var rawContactId = await DAHelper.insert(rawContactUri, rawContactValues); + sleep(1000); + console.info("logMessage contact_data_insert_stability_test_1300: rawContactId = " + rawContactId); + } catch (error) { + console.info("logMessage contact_data_insert_stability_test_1300: raw_contact insert error = " + error); + } + + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.equalTo("id", rawContactId.toString()); + var deleteCode = await DAHelper.delete(rawContactUri, condition); + sleep(1000); + console.info("logMessage contact_data_insert_stability_test_1300: deleteCode = " + deleteCode); + + var listAddBluk = []; + for (var i = 0; i < 1000; i++) { + var add = { + "raw_contact_id": rawContactId, "detail_info": "xxx" + i, "content_type": "name" + }; + listAddBluk[i] = add; + } + try { + var batchInsertCode = await DAHelper.batchInsert(contactDataUri, listAddBluk); + var batchInsertCode = await DAHelper.batchInsert(contactDataUri, listAddBluk); + var batchInsertCode = await DAHelper.batchInsert(contactDataUri, listAddBluk); + var batchInsertCode = await DAHelper.batchInsert(contactDataUri, listAddBluk); + var batchInsertCode = await DAHelper.batchInsert(contactDataUri, listAddBluk); + var batchInsertCode = await DAHelper.batchInsert(contactDataUri, listAddBluk); + var batchInsertCode = await DAHelper.batchInsert(contactDataUri, listAddBluk); + var batchInsertCode = await DAHelper.batchInsert(contactDataUri, listAddBluk); + var batchInsertCode = await DAHelper.batchInsert(contactDataUri, listAddBluk); + var batchInsertCode = await DAHelper.batchInsert(contactDataUri, listAddBluk); + sleep(2000); + console.info("logMessage contact_data_insert_stability_test_1300: batchInsertCode = " + batchInsertCode); + expect(batchInsertCode == 0).assertTrue(); + done(); + } catch (error) { + console.info('logMessage contact_data_insert_stability_test_1300: insert error = ' + error); + done(); + } + }); + + /** + * @tc.number contact_data_update_stability_test_1400 + * @tc.name The contact_data table updates the data whose ID is not equal to 0 to see whether they can be updated + * successfully + * @tc.desc Function test + */ + it("contact_data_update_stability_test_1400", 0, async function (done) { + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('logMessage contact_data_update_stability_test_1400 DAHelper success! DAHelper = ' + DAHelper); + var updateValues = { + "syn_1": "test" + }; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.greaterThan("id", "0"); + try { + var updateCode = await DAHelper.update(contactDataUri, updateValues, condition); + sleep(2000); + console.info("logMessage contact_data_update_stability_test_1400: updateCode = " + updateCode); + expect(updateCode == 0).assertTrue(); + done(); + } catch (error) { + console.info("logMessage contact_data_update_stability_test_1400: update error = " + error); + done(); + } + }); + + /** + * @tc.number contact_data_query_stability_test_1500 + * @tc.name The contact_data table queries 10000 pieces of data to see whether they can be queried successfully + * @tc.desc Function test + */ + it("contact_data_query_stability_test_1500", 0, async function (done) { + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('contact_data_query_stability_test_1500 start ! DAHelper = ' + DAHelper); + var resultColumns = ["id"]; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.greaterThan("id", "0"); + try { + var resultSet = await DAHelper.query(contactDataUri, resultColumns, condition); + sleep(2000); + console.info(' contact_data_query_stability_test_1500 : resultSet.rowCount = ' + resultSet.rowCount); + expect(resultSet.rowCount == 10000).assertEqual(true); + resultSet.close(); + done(); + } catch (error) { + console.info("logMessage contact_data_query_stability_test_1500: error = " + error); + done(); + } + }); + + /** + * @tc.number contact_data_delete_stability_test_1600 + * @tc.name Delete 10000 pieces of data in contact_data table to see if they can be deleted successfully + * @tc.desc Function test + */ + it("contact_data_delete_stability_test_1600", 0, async function (done) { + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('contact_data_delete_stability_test_1600 : start ! DAHelper = ' + DAHelper); + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.greaterThan("id", "0"); + try { + var deleteCode = await DAHelper.delete(contactDataUri, condition); + sleep(2000); + console.info("logMessage contact_data_delete_stability_test_1600: deleteCode = " + deleteCode); + expect(deleteCode == 0).assertTrue(); + done(); + } catch (error) { + console.info('logMessage contact_data_delete_stability_test_1600: delete error = ' + error); + done(); + } + }); + + /** + * @tc.number calllog_insert_stability_test_100 + * @tc.name Add 10000 pieces of data to the callog table to see if they can be successfully inserted + * @tc.desc Function test + */ + it("calllog_insert_stability_test_100", 0, async function (done) { + console.info("---------logMessage calllog_insert_stability_test_100 is starting!----------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CALLLOG); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + var listAddBluk = []; + for (var i = 0; i < 1000; i++) { + var add = { + "phone_number": "1511002" + i + }; + listAddBluk[i] = add; + } + try { + var batchInsertCode = await DAHelper.batchInsert(calllogUri, listAddBluk); + var batchInsertCode = await DAHelper.batchInsert(calllogUri, listAddBluk); + var batchInsertCode = await DAHelper.batchInsert(calllogUri, listAddBluk); + var batchInsertCode = await DAHelper.batchInsert(calllogUri, listAddBluk); + var batchInsertCode = await DAHelper.batchInsert(calllogUri, listAddBluk); + var batchInsertCode = await DAHelper.batchInsert(calllogUri, listAddBluk); + var batchInsertCode = await DAHelper.batchInsert(calllogUri, listAddBluk); + var batchInsertCode = await DAHelper.batchInsert(calllogUri, listAddBluk); + var batchInsertCode = await DAHelper.batchInsert(calllogUri, listAddBluk); + var batchInsertCode = await DAHelper.batchInsert(calllogUri, listAddBluk); + sleep(1000); + console.info("logMessage calllog_insert_stability_test_100: batchInsertCode = " + batchInsertCode); + expect(batchInsertCode == 0).assertTrue(); + done(); + } catch (error) { + console.info("logMessage calllog_insert_stability_test_100: batchInsert error = " + error); + done(); + } + }); + + /** + * @tc.number calllog_update_stability_test_200 + * @tc.name The callog table updates the data whose ID is not equal to 0 to see whether they can be updated + * successfully + * @tc.desc Function test + */ + it("calllog_update_stability_test_200", 0, async function (done) { + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CALLLOG); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + var updateValues = { + "answer_state": "1" + }; + try { + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.greaterThan("id", "0"); + var updateCode = await DAHelper.update(calllogUri, updateValues, condition); + sleep(1000); + console.info("logMessage calllog_update_stability_test_200: updateCode = " + updateCode); + expect(updateCode == 0).assertTrue(); + done(); + } catch (error) { + console.info("logMessage calllog_update_stability_test_200: update error = " + error); + done(); + } + ; + }); + + /** + * @tc.number calllog_query_stability_test_300 + * @tc.name The callog table queries 10000 pieces of data to see whether they can be queried successfully + * @tc.desc Function test + */ + it("calllog_query_stability_test_300", 0, async function (done) { + var tag = "calllog_query_stability_test_300"; + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CALLLOG); + console.info(tag + ': start ! DAHelper = ' + DAHelper); + var resultColumns = ["id"]; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.notEqualTo("id", 0); + + try { + var resultSet = await DAHelper.query(calllogUri, resultColumns, condition); + sleep(5000); + console.info(tag + ' : logMessage : rowCount' + resultSet.rowCount); + expect(resultSet.rowCount == 10000).assertTrue(); + resultSet.close(); + done(); + } catch (error) { + console.info("logMessage calllog_query_stability_test_300: error = " + error); + done() + } + }); + + /** + * @tc.number calllog_delete_stability_test_400 + * @tc.name Delete 10000 pieces of data in callog table to see if they can be deleted successfully + * @tc.desc Function test + */ + it("calllog_delete_stability_test_400", 0, async function (done) { + var tag = "calllog_delete_stability_test_400"; + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CALLLOG); + console.info(tag + ': start ! DAHelper = ' + DAHelper); + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.greaterThan("id", "0"); + var deleteCode = await DAHelper.delete(calllogUri, condition); + sleep(5000); + console.info(tag + " : logMessage : deleteCode = " + deleteCode); + expect(deleteCode == 0).assertTrue(); + done(); + }); + + /** + * @tc.number voicemail_insert_stability_test_500 + * @tc.name Add 10000 pieces of data to the voicemail table to see if they can be successfully inserted + * @tc.desc Function test + */ + it("voicemail_insert_stability_test_500", 0, async function (done) { + console.info("---------logMessage voicemail_insert_stability_test_500 is starting!----------"); + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_VOICEMAIL); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + + var listAddBluk = []; + for (var i = 0; i < 1000; i++) { + var add = { + "phone_number": "12345" + i + }; + listAddBluk[i] = add; + } + try { + var batchInsertCode = await DAHelper.batchInsert(voicemailUri, listAddBluk); + var batchInsertCode = await DAHelper.batchInsert(voicemailUri, listAddBluk); + var batchInsertCode = await DAHelper.batchInsert(voicemailUri, listAddBluk); + var batchInsertCode = await DAHelper.batchInsert(voicemailUri, listAddBluk); + var batchInsertCode = await DAHelper.batchInsert(voicemailUri, listAddBluk); + var batchInsertCode = await DAHelper.batchInsert(voicemailUri, listAddBluk); + var batchInsertCode = await DAHelper.batchInsert(voicemailUri, listAddBluk); + var batchInsertCode = await DAHelper.batchInsert(voicemailUri, listAddBluk); + var batchInsertCode = await DAHelper.batchInsert(voicemailUri, listAddBluk); + var batchInsertCode = await DAHelper.batchInsert(voicemailUri, listAddBluk); + sleep(1000); + console.info("logMessage voicemail_insert_stability_test_500: batchInsertCode = " + batchInsertCode); + expect(batchInsertCode == 0).assertTrue(); + done(); + } catch (error) { + console.info("logMessage voicemail_insert_stability_test_500: batchInsert error = " + error); + done(); + } + }); + + /** + * @tc.number voicemail_update_stability_test_600 + * @tc.name The voicemail table updates the data whose ID is not equal to 0 to see whether they can be updated + * successfully + * @tc.desc Function test + */ + it("voicemail_update_stability_test_600", 0, async function (done) { + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_VOICEMAIL); + console.info('logMessage get DAHelper success! DAHelper = ' + DAHelper); + var updateValues = { + "origin_type": "test" + }; + try { + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.notEqualTo("id", 0); + var updateCode = await DAHelper.update(voicemailUri, updateValues, condition); + sleep(1000); + console.info("logMessage voicemail_update_stability_test_600: updateCode = " + updateCode); + expect(updateCode == 0).assertTrue(); + done(); + } catch (error) { + console.info("logMessage voicemail_update_stability_test_600: update error = " + error); + done(); + } + ; + }); + + /** + * @tc.number voicemail_query_stability_test_700 + * @tc.name The voicemail table queries 10000 pieces of data to see whether they can be queried successfully + * @tc.desc Function test + */ + it("voicemail_query_stability_test_700", 0, async function (done) { + if(utils.notCheck){ + expect(true).assertTrue(); + done(); + return; + } + var tag = "voicemail_query_stability_test_700"; + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_VOICEMAIL); + console.info(tag + ': start ! DAHelper = ' + DAHelper); + var resultColumns = ["id"]; + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.greaterThan("id", "0"); + try { + var resultSet = await DAHelper.query(voicemailUri, resultColumns, condition); + sleep(1000); + console.info(tag + ' : resultSet.rowCount = ' + resultSet.rowCount); + expect(resultSet.rowCount == 10000).assertEqual(true); + resultSet.close(); + done(); + } catch (error) { + console.info("logMessage voicemail_query_stability_test_700: error = " + error); + done() + } + }); + + /** + * @tc.number voicemail_delete_stability_test_800 + * @tc.name Delete 10000 pieces of data in voicemail table to see if they can be deleted successfully + * @tc.desc Function test + */ + it("voicemail_delete_stability_test_800", 0, async function (done) { + var tag = "voicemail_delete_stability_test_800"; + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_VOICEMAIL); + console.info(tag + ': start ! DAHelper = ' + DAHelper); + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.greaterThan("id", "0"); + try { + var deleteCode = await DAHelper.delete(voicemailUri, condition); + sleep(2000); + console.info(tag + " : logMessage : deleteCode = " + deleteCode); + expect(deleteCode == 0).assertTrue(); + done(); + } catch (error) { + console.info("logMessage voicemail_delete_stability_test_800: error = " + error); + done(); + } + }); + + afterAll(async function () { + var DAHelper = featureAbility.acquireDataAbilityHelper(URI_CONTACTS); + console.info('Stability : start ! DAHelper = ' + DAHelper); + var condition = new ohosDataAbility.DataAbilityPredicates(); + condition.notEqualTo("id", "0"); + try { + var resultColumns = ["id"]; + var conditionDelete = new ohosDataAbility.DataAbilityPredicates(); + conditionDelete.greaterThan("id", "0"); + var count = 0; + var deleteCount = 9999; + while (count < deleteCount) { + var result = await DAHelper.query(deletedUri, resultColumns, conditionDelete); + console.info("Stability : result.rowCount = " + result.rowCount); + count = result.rowCount; + result.close(); + sleep(5000); + } + var deleteCode = await DAHelper.delete(deletedUri, condition); + console.info("Stability afterAll logMessage DeleteContact: deleteCode = " + deleteCode); + } catch (error) { + console.info('Stability afterAll logMessage DeleteContact: delete error = ' + error); + } + }); + }) +} \ No newline at end of file diff --git a/telephony/telephonyjstest/contact_stability/entry/src/main/ets/MainAbility/test/lib/Const.js b/telephony/telephonyjstest/contact_stability/entry/src/main/ets/MainAbility/test/lib/Const.js new file mode 100644 index 000000000..f9263cd46 --- /dev/null +++ b/telephony/telephonyjstest/contact_stability/entry/src/main/ets/MainAbility/test/lib/Const.js @@ -0,0 +1,36 @@ +/** + * 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. + */ + +// sim slot id +export const DEFAULT_SLOTID = 0; +export const SLOTID3 = 3; +export const SLOTID2 = 2; +export const SLOTID_MINUS1 = -1; + +// sim correct password +export const CORRECT_PIN = '1234'; +export const CORRECT_PIN2 = '18099014'; + +// sim incorrect password +export const INCORRECT_PIN = '134679'; +export const INCORRECT_PIN_LEN3 = '123'; +export const INCORRECT_PUK = '134679'; +export const INCORRECT_PIN2 = '134679'; +export const INCORRECT_PIN2_LEN3 = '123'; +export const INCORRECT_PIN2_LEN9 = '123456789'; +export const INCORRECT_PUK2 = '134679'; + +// lock status response +export const LOCK_RESULT = { SUCCESS: 0, FAILURE: -1, EXCEPTION: -2 }; \ No newline at end of file diff --git a/telephony/telephonyjstest/contact_stability/entry/src/main/resources/base/element/string.json b/telephony/telephonyjstest/contact_stability/entry/src/main/resources/base/element/string.json new file mode 100644 index 000000000..03b8532c5 --- /dev/null +++ b/telephony/telephonyjstest/contact_stability/entry/src/main/resources/base/element/string.json @@ -0,0 +1,12 @@ +{ + "string": [ + { + "name": "entry_MainAbility", + "value": "entry_MainAbility" + }, + { + "name": "description_mainability", + "value": "ETS_Empty Ability" + } + ] +} \ No newline at end of file diff --git a/telephony/telephonyjstest/contact_stability/entry/src/main/resources/base/media/icon.png b/telephony/telephonyjstest/contact_stability/entry/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!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X2p4!2Pqrwm;>=<2o}Dhu*bisL!?5 z)6?@AU&4YWUN)^*jr!Ozt&JdTDOw)?fw~F17S(d{|7GG(G(KeJZ0N2`FVv?5 NG*q?mAC)bG{|A+36q*14 literal 0 HcmV?d00001 diff --git a/telephony/telephonyjstest/contact_stability/entry/src/main/resources/rawfile/star-1-2.png b/telephony/telephonyjstest/contact_stability/entry/src/main/resources/rawfile/star-1-2.png new file mode 100644 index 0000000000000000000000000000000000000000..450c3dd3ca68bf601bd08e5f41797d376e20d00d GIT binary patch literal 8295 zcma)iby!qi)GiDI3@ITfJq#cs(xo6VIK9g0Is58cut9YYAhAky89NJ&c$4N6Nm zw8Wj?_uaqmbN@K!?C070th3LGz1Mo*9j&FIL_x|(iid|s0au1;Ejqu(x%6MX}UcP^pVq^MKx?9Z3<6HZSZ(YTWwl+ z4})r2h&L?_5Z3xL9JTpl$1We;HwOfV*U2Dd;4VathABE2mL~&90=s!A z17A=j029Bxgn&sP{lPFWGr*0ABr?l!nhT^H>H*JtEAfpTOhQ8`F<+vJ8@ZDt_v2l} zOF0@&=65xE>0mI)Bv(k<5_x1Wr}DE!>r#HG91U6(z}Lz^i4RY3X&Tfw3&nM%1C5a) z%(ySExg?jj0C8QEq$g*CpQ*Xk7yhNiNn@bzJnMOrz${d^ZW9+zK}FP6Wt)@*prd*F z(rz`Qjq{pA&L7Hx1K?P`{_=|>e3O_&^n>(;eRI>{gq^xXjKN& z@MCLic)gQH^`1Je&lNP6cFPmo@#}YJ&*-b0%L%rIiIEC%K9b2VMf24JMlrxCU;4bM9NM`z%7*&=MO^=(k?eYD|N0NSRUq1vD*l*s- z4;5;mae9K07G>0^3_eR`n2mvtsZw7^GmKor6U4O}T!EZW#(u#BA_V$L+A#=JNj^p8 zMo$u9AUc@@o>+Zc_I+>hn*oW`p*FU_>v9MlGJsQZG`UKU!kSII&(iR9spGPLK_?dv zH62cSuh@C=`WqBAh*E;+sLBQMSO4tFt#w3r4D|KjW&wIRodFgZ;AhwXl8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%I)F|JIW-#+48$+lD4k*(P*kDM%zx_fvu4u5ZYUnI}5 zdrycFq>xFU)&X3p@pP2u%$o}}YcRn(MhJ&B2o?KS@cIVz>Ye%o^xV?CB{_Qhu z;}_q1bvO^g{8<3!gYbo4Di{8qzV+(9 zdlmksohQmRTs@qB;(Wo?dER_ux6XQb@q$tQPW?CMu6GVQd;R=iR;-S{Kr%Zks7>b1 zNs{|-+jhObYE}NR&`TGGr^h^4bjh%c>R#@=8nM&Md>_a+zVulsl;){flFekV1t9ob z+SqfV_Pv3$2f)bQ8%Ul2>fdYR^1zs0BQF~olsOj5AodC&Q_7SMFzsz2 z9newxE&jodk~tNHwl%LBMMDbrk=(^b literal 0 HcmV?d00001 diff --git a/telephony/telephonyjstest/netmanager_http/BUILD.gn b/telephony/telephonyjstest/netmanager_http/BUILD.gn new file mode 100644 index 000000000..8b9be1eba --- /dev/null +++ b/telephony/telephonyjstest/netmanager_http/BUILD.gn @@ -0,0 +1,32 @@ +# 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("ActsNetManagerHttpEtsTest") { + hap_profile = "./entry/src/main/config.json" + deps = [ + ":ace_demo_ets_assets", + ":ace_demo_ets_resources", + ] + ets2abc = true + certificate_profile = "./signature/openharmony_sx.p7b" + hap_name = "ActsNetManagerHttpEtsTest" +} +ohos_js_assets("ace_demo_ets_assets") { + source_dir = "./entry/src/main/ets/MainAbility" +} +ohos_resources("ace_demo_ets_resources") { + sources = [ "./entry/src/main/resources" ] + hap_profile = "./entry/src/main/config.json" +} diff --git a/telephony/telephonyjstest/netmanager_http/Test.json b/telephony/telephonyjstest/netmanager_http/Test.json new file mode 100644 index 000000000..4a6a32283 --- /dev/null +++ b/telephony/telephonyjstest/netmanager_http/Test.json @@ -0,0 +1,18 @@ +{ + "description": "Configuration for hjunit demo Tests", + "driver": { + "type": "JSUnitTest", + "test-timeout": "1800000", + "package": "com.ohos.netmanagerhttp", + "shell-timeout": "60000" + }, + "kits": [ + { + "test-file-name": [ + "ActsNetManagerHttpEtsTest.hap" + ], + "type": "AppInstallKit", + "cleanup-apps": true + } + ] +} diff --git a/telephony/telephonyjstest/netmanager_http/entry/src/main/config.json b/telephony/telephonyjstest/netmanager_http/entry/src/main/config.json new file mode 100644 index 000000000..aca07cdb7 --- /dev/null +++ b/telephony/telephonyjstest/netmanager_http/entry/src/main/config.json @@ -0,0 +1,93 @@ +{ + "app": { + "bundleName": "com.ohos.netmanagerhttp", + "vendor": "open", + "version": { + "code": 1000000, + "name": "1.0.0" + }, + "apiVersion": { + "compatible": 7, + "releaseType": "Release", + "target": 7 + } + }, + "deviceConfig": {}, + "module": { + "package": "com.ohos.netmanagerhttp", + "name": ".MyApplication", + "mainAbility": ".MainAbility", + "srcPath": "MainAbility", + "deviceType": [ + "phone" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "entry", + "moduleType": "entry", + "installationFree": false + }, + "abilities": [ + { + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ], + "orientation": "unspecified", + "visible": true, + "srcPath": "MainAbility", + "name": ".MainAbility", + "srcLanguage": "ets", + "icon": "$media:icon", + "description": "$string:description_mainability", + "formsEnabled": false, + "label": "$string:entry_MainAbility", + "type": "page", + "launchType": "standard" + } + ], + "js": [ + { + "mode": { + "syntax": "ets", + "type": "pageAbility" + }, + "pages": [ + "pages/index", + "pages/Button", + "pages/Blank", + "pages/DataPanel", + "pages/Divider", + "pages/Text", + "pages/RowSplit", + "pages/Scroll", + "pages/Stack", + "pages/Image", + "pages/Progress", + "pages/Qrcode", + "pages/Rating", + "pages/Span", + "pages/Slider", + "pages/Badge", + "pages/Column", + "pages/ColumnSplit", + "pages/Counter", + "pages/Flex", + "pages/GridContainer" + + ], + "name": ".MainAbility", + "window": { + "designWidth": 720, + "autoDesignWidth": false + } + } + ] + } +} \ No newline at end of file diff --git a/telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/app.ets b/telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/app.ets new file mode 100644 index 000000000..261fadca2 --- /dev/null +++ b/telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/app.ets @@ -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('Application onCreate') + }, + onDestroy() { + console.info('Application onDestroy') + }, +} \ No newline at end of file diff --git a/telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/pages/Badge.ets b/telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/pages/Badge.ets new file mode 100644 index 000000000..66de6f8e3 --- /dev/null +++ b/telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/pages/Badge.ets @@ -0,0 +1,95 @@ +/* + * 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. + */ + +@Entry +@Component +struct badge { + @State counts: number = 33 + @State message: string = 'new' + @State active: boolean = false + private content: string = "badge Page"; + + onPageShow() { + console.info('badge page show called'); + } + + onBuildDone() { + console.info('badge page build done called'); + } + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Scroll() { + Column() { + Text(`${this.content}`) + .fontSize(50) + .fontWeight(FontWeight.Bold) + Badge({ + count: this.counts, + position: BadgePosition.Right, + maxCount: 99, + style: { color: 0xFFFFFF, fontSize: 16, badgeSize: 20, badgeColor: Color.Red } + }) { + Button('message') + .onClick(() => { + this.counts++ + }) + .width(100).height(50).backgroundColor(0x317aff) + } + .width(100) + .height(50) + .key('badge') + + Text("BadgePosition.RightTop").fontSize(16) + Badge({ + count: this.counts, + position: BadgePosition.RightTop, + maxCount: 99, + style: { color: 0xFFFFFF, fontSize: '16', badgeSize: '20', badgeColor: Color.Red } + }) { + Button('message') + .onClick(() => { + this.counts++ + }) + .width(100).height(50).backgroundColor(0x317aff) + } + .width(100) + .height(50) + .key('badge1') + + Text("BadgePosition.Left").fontSize(16) + Badge({ + count: this.counts, + position: BadgePosition.Left, + maxCount: 99, + style: { color: Color.Pink, fontSize: 16, badgeSize: 20, badgeColor: Color.Red } + }) { + Button('message') + .onClick(() => { + this.counts++ + }) + .width(100).height(50).backgroundColor(0x317aff) + } + .width(100) + .height(50) + .key('badge2') + } + } + } + .key('flex') + .width('100%') + .height('100%') + } +} diff --git a/telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/pages/Blank.ets b/telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/pages/Blank.ets new file mode 100644 index 000000000..a50fc719e --- /dev/null +++ b/telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/pages/Blank.ets @@ -0,0 +1,47 @@ +/* + * 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. + */ + +@Entry +@Component +struct blank_testcase { + @State Color: Color = Color.Pink + @State active: boolean = false + private content: string = "Blank Page" + + onPageShow() { + console.info('Blank page show called'); + } + + onBuildDone() { + console.info('Blank page build done called'); + } + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Text(`${this.content}`) + .fontSize(50) + .fontWeight(FontWeight.Bold) + Blank(100) + .color(this.Color) + .key('blank') + Text('on/off').fontSize(18).height(60) + } + .key('flex') + .width('100%') + .height('100%') + + + } +} diff --git a/telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/pages/Button.ets b/telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/pages/Button.ets new file mode 100644 index 000000000..ac2271ea3 --- /dev/null +++ b/telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/pages/Button.ets @@ -0,0 +1,70 @@ +/* + * 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 router from '@system.router' + +@Entry +@Component +struct button_testcase { + @State stateEffect: boolean = true + @State ButtonType: ButtonType = ButtonType.Circle + private content: string = "Button Page"; + + onPageShow() { + console.info('Button page show called'); + } + + onBuildDone() { + console.info('Button page build done called'); + } + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Text(`${this.content}`) + .fontSize(50) + .fontWeight(FontWeight.Bold) + Button('1.value', { type: ButtonType.Circle, stateEffect: this.stateEffect }) + .fontSize(12) + .fontWeight(FontWeight.Bold) + .fontColor(0xCCCCCC) + .height(40) + .width(40) + .key('button') + .backgroundColor('#0D9FFB') + .onClick(() => { + router.back() + }) + .padding(10) + Button() { + Text("2.Capsule") + } + .type(ButtonType.Capsule) + .stateEffect(false) + .backgroundColor('#0D9FFB') + .padding(10) + .key('button1') + + Button() { + Text("3.Normal") + }.type(ButtonType.Normal) + .backgroundColor('#0D9FFB') + .key('button2') + + }.key('flex') + .width('100%') + .height('100%') + } +} + diff --git a/telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/pages/Column.ets b/telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/pages/Column.ets new file mode 100644 index 000000000..b9e5c84e2 --- /dev/null +++ b/telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/pages/Column.ets @@ -0,0 +1,51 @@ +/* + * 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. + */ + +@Entry +@Component +struct column { + @State active: boolean = false + private content: string = "Column Page" + + onPageShow() { + console.info('Column page show called'); + } + + onBuildDone() { + console.info('Column page build done called'); + } + + build() { + Column({ space: 5 }) { + Text('alignItems(Center)').fontSize(9).fontColor(0xCCCCCC).width('90%') + Column() { + Column().width('50%').height(50).backgroundColor(0xAFEEEE) + Column().width('50%').height(50).backgroundColor(0x00FFFF) + }.alignItems(HorizontalAlign.Center).width('90%').border({ width: 1 }).key('column') + + Text('alignItems(Start)').fontSize(9).fontColor(0xCCCCCC).width('90%') + Column({ space: '5' }) { + Column().width('50%').height(50).backgroundColor(0xAFEEEE) + Column().width('50%').height(50).backgroundColor(0x00FFFF) + }.alignItems(HorizontalAlign.Start).width('90%').border({ width: 1 }).key('column1') + + Text('alignItems(End)').fontSize(9).fontColor(0xCCCCCC).width('90%') + Column() { + Column().width('50%').height(50).backgroundColor(0xAFEEEE) + Column().width('50%').height(50).backgroundColor(0x00FFFF) + }.alignItems(HorizontalAlign.End).width('90%').border({ width: 1 }).key('column2') + }.width('100%').padding({ top: 5 }) + } +} diff --git a/telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/pages/ColumnSplit.ets b/telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/pages/ColumnSplit.ets new file mode 100644 index 000000000..cb0597310 --- /dev/null +++ b/telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/pages/ColumnSplit.ets @@ -0,0 +1,70 @@ +/* + * 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. + */ + +@Entry +@Component +struct columnSplit { + private content: string = "ColumnSplit Page" + + onPageShow() { + console.info('ColumnSplit page show called'); + } + + onBuildDone() { + console.info('ColumnSplit page build done called'); + } + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Scroll() { + Column() { + Text(`${this.content}`) + .fontSize(50) + .fontWeight(FontWeight.Bold) + Column() { + Text('ColumnSplit').fontSize(9).fontColor(0xCCCCCC).width('90%') + ColumnSplit() { + Text('1').width('100%').height(50).backgroundColor(0xF5DEB3).textAlign(TextAlign.Center) + Text('2').width('100%').height(50).backgroundColor(0xD2B48C).textAlign(TextAlign.Center) + Text('3').width('100%').height(50).backgroundColor(0xF5DEB3).textAlign(TextAlign.Center) + Text('4').width('100%').height(50).backgroundColor(0xD2B48C).textAlign(TextAlign.Center) + Text('5').width('100%').height(50).backgroundColor(0xF5DEB3).textAlign(TextAlign.Center) + }.key('columnSplit') + .resizeable(true) + .width('90%').height('60%') + + }.width("100%") + + Column() { + Text('ColumnSplit1').fontSize(9).fontColor(0xCCCCCC).width('90%') + ColumnSplit() { + Text('1').width('100%').height(50).backgroundColor(0xF5DEB3).textAlign(TextAlign.Center) + Text('2').width('100%').height(50).backgroundColor(0xD2B48C).textAlign(TextAlign.Center) + Text('3').width('100%').height(50).backgroundColor(0xF5DEB3).textAlign(TextAlign.Center) + Text('4').width('100%').height(50).backgroundColor(0xD2B48C).textAlign(TextAlign.Center) + Text('5').width('100%').height(50).backgroundColor(0xF5DEB3).textAlign(TextAlign.Center) + }.key('columnSplit1') + .resizeable(false) + .width('90%').height('60%') + + }.width("100%") + } + } + } + .key('flex') + .width('100%') + .height('100%') + } +} diff --git a/telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/pages/Counter.ets b/telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/pages/Counter.ets new file mode 100644 index 000000000..ecdbfaf10 --- /dev/null +++ b/telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/pages/Counter.ets @@ -0,0 +1,51 @@ +/* + * 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. + */ + +@Entry +@Component +struct counter { + @State value: number = 0 + @State active: boolean = false + private content: string = "Counter Page" + + onPageShow() { + console.info('Counter page show called'); + } + + onBuildDone() { + console.info('Counter page build done called'); + } + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Text(`${this.content}`) + .fontSize(50) + .fontWeight(FontWeight.Bold) + Counter() { + Text(this.value.toString()) + }.margin(100) + .key('counter') + .onInc(() => { + this.value++ + }) + .onDec(() => { + this.value-- + }) + }.width("100%") + .key('flex') + .width('100%') + .height('100%') + } +} diff --git a/telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/pages/DataPanel.ets b/telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/pages/DataPanel.ets new file mode 100644 index 000000000..3c6248484 --- /dev/null +++ b/telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/pages/DataPanel.ets @@ -0,0 +1,69 @@ +/* + * 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 router from '@system.router' + +@Entry +@Component +struct dataPanel_testcase { + @State width: string= "200" + @State height: string= "100" + @State active: boolean = false + private content: string = "DataPanel Page" + + onPageShow() { + console.info('Blank page show called'); + } + + onBuildDone() { + console.info('Blank page build done called'); + } + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Text(`${this.content}`) + .fontSize(50) + DataPanel({ values: [20, 40, 20], max: 100, type: DataPanelType.Line }) + .width(this.width) + .height(this.height) + .key('DataPanel') + .onClick(() => { + router.back() + }) + .closeEffect(false) + + DataPanel({ values: [20, 40, 20], max: 100, type: DataPanelType.Circle}) + .width(this.width) + .height(this.height) + .key('DataPanel2') + .onClick(() => { + router.back() + }) + .closeEffect(true) + DataPanel({ values: [20, 40, 20], max: 100}) + .width(this.width) + .height(this.height) + .key('DataPanel3') + .onClick(() => { + router.back() + }) + .closeEffect(false) + } + .key('flex') + .width('100%') + .height('100%') + + } +} diff --git a/telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/pages/Divider.ets b/telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/pages/Divider.ets new file mode 100644 index 000000000..02bf60779 --- /dev/null +++ b/telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/pages/Divider.ets @@ -0,0 +1,71 @@ +/* + * 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 router from '@system.router' + +@Entry +@Component +struct divider_textcase { + @State vertical: boolean = true + @State color: Color = Color.Red + @State strokeWidth: number = 7 + @State lineCap: LineCapStyle = LineCapStyle.Butt + @State active: boolean = false + private content: string = "Divider Page"; + + onPageShow() { + console.info('Button page show called'); + } + + onBuildDone() { + console.info('Button page build done called'); + } + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Text(`${this.content}`) + .fontSize(50) + Divider() + .lineCap(LineCapStyle.Butt) + .strokeWidth(this.strokeWidth) + .color(this.color) + .vertical(this.vertical) + .height(150) + .key('divider') + .onClick(() => { + router.back() + }) + Divider() + .lineCap(LineCapStyle.Round) + .vertical(false) + .color(Color.Green) + .strokeWidth(10) + .height(150) + .key('divider1') + Divider() + .lineCap(LineCapStyle.Square) + .color(Color.Green) + .vertical(true) + .strokeWidth(10) + .height(150) + .key('divider2') + } + .key('flex') + .width('100%') + .height('100%') + } +} + + diff --git a/telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/pages/Flex.ets b/telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/pages/Flex.ets new file mode 100644 index 000000000..a0e21251e --- /dev/null +++ b/telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/pages/Flex.ets @@ -0,0 +1,135 @@ +/* + * 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. + */ + +@Entry +@Component +struct flex { + private content: string = "Flex Page" + + onPageShow() { + console.info('Flex page show called'); + } + + onBuildDone() { + console.info('Flex page build done called'); + } + + build() { + Column() { + Column({ space : 2 }) { + Text('direction:Column').fontSize(9).fontColor(0xCCCCCC).width('90%') + Flex({ + direction: FlexDirection.Column, + wrap: FlexWrap.NoWrap, + justifyContent: FlexAlign.Center, + alignItems:ItemAlign.Start, + alignContent: FlexAlign.Start, + }) { + Text('1').width('100%').height(20).backgroundColor(0xF5DEB3) + Text('2').width('100%').height(20).backgroundColor(0xD2B48C) + Text('3').width('100%').height(20).backgroundColor(0xF5DEB3) + } + .key('flex') + .height(70) + .width('90%') + .padding(10) + .backgroundColor(0xAFEEEE) + + Text('direction:Row').fontSize(9).fontColor(0xCCCCCC).width('90%') + Flex({ + direction: FlexDirection.Row, + wrap: FlexWrap.Wrap, + justifyContent: FlexAlign.Start, + alignItems:ItemAlign.Start, + alignContent: FlexAlign.Center, + }) { + Text('1').width('20%').height(20).backgroundColor(0xF5DEB3) + Text('2').width('20%').height(20).backgroundColor(0xD2B48C) + Text('3').width('20%').height(20).backgroundColor(0xF5DEB3) + } + .key('flex1') + .height(70) + .width('90%') + .padding(10) + .backgroundColor(0xAFEEEE) + + Text('direction:RowReverse').fontSize(9).fontColor(0xCCCCCC).width('90%') + Flex({ + direction: FlexDirection.RowReverse, + wrap: FlexWrap.Wrap, + justifyContent: FlexAlign.End, + alignItems:ItemAlign.End, + alignContent: FlexAlign.End, + }) { + Text('1').width('50%').height(20).backgroundColor(0xF5DEB3) + Text('2').width('50%').height(20).backgroundColor(0xD2B48C) + Text('3').width('50%').height(20).backgroundColor(0xF5DEB3) + } + .key('flex2') + .height(90) + .width('90%') + .padding(10) + .backgroundColor(0xAFEEEE) + + Text('justifyContent:SpaceBetween').fontSize(9).fontColor(0xCCCCCC).width('90%') + Flex({ + justifyContent: FlexAlign.SpaceBetween, + wrap: FlexWrap.Wrap, + }) { + Text('1').width('100%').height(20).backgroundColor(0xF5DEB3) + Text('2').width('100%').height(20).backgroundColor(0xD2B48C) + Text('3').width('100%').height(20).backgroundColor(0xF5DEB3) + } + .key('flex3') + .height(100) + .width('90%') + .padding(10) + .backgroundColor(0xAFEEEE) + + Text('justifyContent AND alignContent').fontSize(9).fontColor(0xCCCCCC).width('90%') + Flex({ + justifyContent: FlexAlign.SpaceEvenly, + alignContent: FlexAlign.SpaceEvenly, + wrap: FlexWrap.Wrap, + }) { + Text('1').width('50%').height(20).backgroundColor(0xF5DEB3) + Text('2').width('50%').height(20).backgroundColor(0xD2B48C) + Text('3').width('50%').height(20).backgroundColor(0xF5DEB3) + } + .key('flex4') + .height(90) + .width('90%') + .padding(10) + .backgroundColor(0xAFEEEE) + + Text('justifyContent AND alignContent').fontSize(9).fontColor(0xCCCCCC).width('90%') + Flex({ + justifyContent: FlexAlign.SpaceAround, + alignContent: FlexAlign.SpaceAround, + wrap: FlexWrap.Wrap, + }) { + Text('1').width('50%').height(20).backgroundColor(0xF5DEB3) + Text('2').width('50%').height(20).backgroundColor(0xD2B48C) + Text('3').width('50%').height(20).backgroundColor(0xF5DEB3) + } + .key('flex5') + .height(90) + .width('90%') + .padding(10) + .backgroundColor(0xAFEEEE) + }.width('100%').margin({ top: 5 }) + }.width('100%') + } +} diff --git a/telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/pages/GridContainer.ets b/telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/pages/GridContainer.ets new file mode 100644 index 000000000..573581104 --- /dev/null +++ b/telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/pages/GridContainer.ets @@ -0,0 +1,170 @@ +/* + * 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. + */ + +@Entry +@Component +struct gridContainer { + @State sizeType: SizeType = SizeType.XS + @State active: boolean = false + private content: string = "GridContainer Page" + + onPageShow() { + console.info('GridContainer page show called'); + } + + onBuildDone() { + console.info('GridContainer page build done called'); + } + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Text(`${this.content}`) + .fontSize(50) + .fontWeight(FontWeight.Bold) + Scroll() { + Column({ space: 5 }) { + GridContainer({ columns: 12, sizeType: this.sizeType, gutter: 10, margin: 20 }) { + Row() { + Text('1') + .useSizeType({ + xs: { span: 6, offset: 0 }, + sm: { span: 2, offset: 0 }, + md: { span: 2, offset: 0 }, + lg: { span: 2, offset: 0 } + }) + .height(50).backgroundColor(0x4682B4).textAlign(TextAlign.Center) + Text('2').gridSpan(2) + + .height(50).backgroundColor(0x00BFFF).textAlign(TextAlign.Center) + Text('3').gridOffset(3) + + .height(50).backgroundColor(0x4682B4).textAlign(TextAlign.Center) + } + }.key('gridContainer') + .width('90%') + .alignItems(HorizontalAlign.Start) + + Text('Click Simulate to change the device width').fontSize(9).width('90%').fontColor(0xCCCCCC) + Row() { + Button('XS') + .onClick(() => { + this.sizeType = SizeType.XS + }).backgroundColor(0x317aff) + Button('SM') + .onClick(() => { + this.sizeType = SizeType.SM + }).backgroundColor(0x317aff) + Button('MD') + .onClick(() => { + this.sizeType = SizeType.MD + }).backgroundColor(0x317aff) + Button('LG') + .onClick(() => { + this.sizeType = SizeType.LG + }).backgroundColor(0x317aff) + } + + GridContainer({ columns: "auto", sizeType: SizeType.MD, gutter: '10', margin: '20' }) { + Row() { + Text('1') + .useSizeType({ + xs: { span: 6, offset: 0 }, + sm: { span: 2, offset: 0 }, + md: { span: 2, offset: 0 }, + lg: { span: 2, offset: 0 } + }) + .height(50).backgroundColor(0x4682B4).textAlign(TextAlign.Center) + Text('2').gridSpan(2) + + .height(50).backgroundColor(0x00BFFF).textAlign(TextAlign.Center) + Text('3').gridOffset(3) + + .height(50).backgroundColor(0x4682B4).textAlign(TextAlign.Center) + } + }.key('gridContainer1') + .width('90%') + .alignItems(HorizontalAlign.Center) + + GridContainer({ columns: 12, sizeType: SizeType.SM, gutter: 10, margin: 20 }) { + Row() { + Text('1') + .useSizeType({ + xs: { span: 6, offset: 0 }, + sm: { span: 2, offset: 0 }, + md: { span: 2, offset: 0 }, + lg: { span: 2, offset: 0 } + }) + .height(50).backgroundColor(0x4682B4).textAlign(TextAlign.Center) + Text('2').gridSpan(2) + + .height(50).backgroundColor(0x00BFFF).textAlign(TextAlign.Center) + Text('3').gridOffset(3) + + .height(50).backgroundColor(0x4682B4).textAlign(TextAlign.Center) + } + }.key('gridContainer2') + .width('90%') + .alignItems(HorizontalAlign.End) + + GridContainer({ columns: 12, sizeType: SizeType.LG, gutter: 10, margin: 20 }) { + Row() { + Text('1') + .useSizeType({ + xs: { span: 6, offset: 0 }, + sm: { span: 2, offset: 0 }, + md: { span: 2, offset: 0 }, + lg: { span: 2, offset: 0 } + }) + .height(50).backgroundColor(0x4682B4).textAlign(TextAlign.Center) + Text('2').gridSpan(2) + + .height(50).backgroundColor(0x00BFFF).textAlign(TextAlign.Center) + Text('3').gridOffset(3) + + .height(50).backgroundColor(0x4682B4).textAlign(TextAlign.Center) + } + }.key('gridContainer3') + .width('90%') + .alignItems(HorizontalAlign.End) + + GridContainer({ columns: 12, sizeType: SizeType.Auto, gutter: 10, margin: 20 }) { + Row() { + Text('1') + .useSizeType({ + xs: { span: 6, offset: 0 }, + sm: { span: 2, offset: 0 }, + md: { span: 2, offset: 0 }, + lg: { span: 2, offset: 0 } + }) + .height(50).backgroundColor(0x4682B4).textAlign(TextAlign.Center) + Text('2').gridSpan(2) + + .height(50).backgroundColor(0x00BFFF).textAlign(TextAlign.Center) + Text('3').gridOffset(3) + + .height(50).backgroundColor(0x4682B4).textAlign(TextAlign.Center) + } + }.key('gridContainer4') + .width('90%') + .alignItems(HorizontalAlign.End) + + }.width('100%').margin({ top: 5 }) + } + } + .key('flex') + .width('100%') + .height('100%') + } +} diff --git a/telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/pages/Image.ets b/telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/pages/Image.ets new file mode 100644 index 000000000..5cc583e93 --- /dev/null +++ b/telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/pages/Image.ets @@ -0,0 +1,90 @@ +/* + * 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. + */ + +@Entry +@Component +struct image_textcase { + @State Width: number = 0 + @State height: number = 0 + + onPageShow() { + console.info('Image page show called'); + } + + onBuildDone() { + console.info('Image page build done called'); + } + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Column() { + Text(`Image page`) + .fontSize(50) + .fontWeight(FontWeight.Bold) + Image("/resources/rawfile/hand.png") + .matchTextDirection(false) + .fitOriginalSize(false) + .fillColor(0xCCCCCC) + .objectFit(ImageFit.Cover) + .objectRepeat(ImageRepeat.NoRepeat) + .interpolation(ImageInterpolation.None) + .renderMode(ImageRenderMode.Original) + .autoResize(false) + .syncLoad(false) + .sourceSize({ width: 200, height: 100 }) + .alt("/resources/rawfile/person.png") + .key('image1') + Image("/resources/rawfile/hand.png") + .objectFit(ImageFit.Contain) + .objectRepeat(ImageRepeat.X) + .interpolation(ImageInterpolation.High) + .renderMode(ImageRenderMode.Template) + .key('image2') + .height(180) + .width(180) + .onComplete((msg: { + width: number, + height: number + }) => { + this.Width = msg.width + this.height = msg.height + console.info('Width ----' + this.Width) + console.info('height ----' + this.height) + }) + .onError(() => { + console.info('load image fail') + }) + Image("/resources/rawfile/hand.png") + .objectFit(ImageFit.Fill) + .objectRepeat(ImageRepeat.Y) + .interpolation(ImageInterpolation.Low) + .key('image3') + Image("/resources/rawfile/hand.png") + .objectFit(ImageFit.None) + .objectRepeat(ImageRepeat.XY) + .interpolation(ImageInterpolation.Medium) + .key('image4') + Image("/resources/rawfile/hand.png") + .objectFit(ImageFit.ScaleDown) + .key('image5') + }.width(300) + .height(300) + .borderColor(Color.Pink) + .borderWidth(4) + } + } +} + + diff --git a/telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/pages/Navigator.ets b/telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/pages/Navigator.ets new file mode 100644 index 000000000..6c50769cf --- /dev/null +++ b/telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/pages/Navigator.ets @@ -0,0 +1,60 @@ +/* + * 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. + */ + +@Entry +@Component +struct navigator_testcase { + @State active: boolean = false + @State params: Object = { text: 'news' } + + onPageShow() { + console.info('Navigator page show called'); + } + + onBuildDone() { + console.info('Navigator page build done called'); + } + + build() { + Column() { + Navigator({ target: "pages/index", type: NavigationType.Back }) { + Text('Navigator test in Navigator,back') + }.active(this.active) + .key('navigator') + .params({ + data: 24 + }) + + Navigator({ target: "pages/index", type: NavigationType.Push }) { + Text('Navigator test in Navigator,push') + }.active(this.active) + .key('navigator2') + .params({ + data: 24 + }) + + Navigator({ target: "pages/index", type: NavigationType.Replace }) { + Text('Navigator test in Navigator,replace') + }.active(this.active) + .key('navigator3') + .params({ + data: 24 + }) + }.width(300) + .height(300) + .borderColor(Color.Pink) + .borderWidth(2) + } +} diff --git a/telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/pages/Panel.ets b/telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/pages/Panel.ets new file mode 100644 index 000000000..32ddabbd1 --- /dev/null +++ b/telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/pages/Panel.ets @@ -0,0 +1,96 @@ +/* + * 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. + */ + +@Entry +@Component +struct PanelExample { + @State show: boolean = true + + onPageShow() { + console.info('Panel page show called'); + } + + onBuildDone() { + console.info('Panel page build done called'); + } + + build() { + Column() { + Text('2021-09-30 Today Calendar: 1.afternoon......Click for details') + .width('90%') + .height(50) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + .padding({ left: 20 }) + .onClick(() => { + this.show = !this.show + }) + Panel(this.show) { + Column() { + Text('Today Calendar') + Divider() + Text('1. afternoon 4:00 The project meeting') + } + } + .key('panel') + .type(PanelType.Foldable) + .mode(PanelMode.Half) + .dragBar(true) + .fullHeight(500) + .halfHeight(250) + .miniHeight(100) + .onChange((value: any) => { + console.info(`width:${value.width},height:${value.height},mode:${value.mode}`) + }) + + Panel(this.show) { + Column() { + Text('Today Calendar') + Divider() + Text('1. afternoon 4:00 The project meeting') + } + } + .key('panel2') + .type(PanelType.Minibar) + .mode(PanelMode.Mini) + .dragBar(true) + .fullHeight(500) + .halfHeight(250) + .miniHeight(100) + .onChange((value: any) => { + console.info(`width:${value.width},height:${value.height},mode:${value.mode}`) + }) + + Panel(false) { + Column() { + Text('Today Calendar') + Divider() + Text('1. afternoon 4:00 The project meeting') + } + } + .key('panel3') + .type(PanelType.Temporary) + .mode(PanelMode.Full) + .dragBar(true) + .fullHeight(500) + .halfHeight(250) + .miniHeight(100) + .onChange((value: any) => { + console.info(`width:${value.width},height:${value.height},mode:${value.mode}`) + }) + + }.width('100%').height('50%').backgroundColor(0xDCDCDC).padding({ top: 5 }) + } +} \ No newline at end of file diff --git a/telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/pages/Progress.ets b/telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/pages/Progress.ets new file mode 100644 index 000000000..c8608089f --- /dev/null +++ b/telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/pages/Progress.ets @@ -0,0 +1,76 @@ +/* + * 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. + */ + +@Entry +@Component +struct progress_testcase { + onPageShow() { + console.info('Progress page show called'); + } + + onBuildDone() { + console.info('Progress page build done called'); + } + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Column() { + Text(`Progress page`) + .fontSize(50) + .fontWeight(FontWeight.Bold) + Progress({ value: 20, total: 40, style: ProgressStyle.Linear }) + .value(3) + .color(Color.Blue) + .width(50) + .height(70) + .key('progress') + + Progress({ value: 20, total: 40, style: ProgressStyle.Eclipse }) + .value(3) + .color(Color.Blue) + .width(50) + .height(70) + .key('progress2') + + Progress({ value: 20, total: 40, style: ProgressStyle.Ring }) + .value(3) + .color(Color.Blue) + .width(50) + .height(70) + .key('progress3') + + Progress({ value: 20, total: 40, style: ProgressStyle.ScaleRing }) + .value(3) + .color(Color.Blue) + .width(50) + .height(70) + .key('progress4') + + Progress({ value: 20, total: 40, style: ProgressStyle.Capsule }) + .value(3) + .color(Color.Blue) + .width(50) + .height(70) + .key('progress5') + + } + .width(400) + .height(400) + .borderColor(Color.Pink) + .borderWidth(2) + } + } +} + diff --git a/telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/pages/Qrcode.ets b/telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/pages/Qrcode.ets new file mode 100644 index 000000000..5c0dd84ef --- /dev/null +++ b/telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/pages/Qrcode.ets @@ -0,0 +1,44 @@ +/* + * 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. + */ + +@Entry +@Component +struct qrcode_textcase { + @State Color: Color = Color.Pink + + onPageShow() { + console.info('Qrcode page show called'); + } + + onBuildDone() { + console.info('Qrcode page build done called'); + } + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Text(`Qrcode page`) + .fontSize(50) + .fontWeight(FontWeight.Bold) + QRCode('hello world') + .color("#FFFFC0CB") + .backgroundColor(this.Color) + .width("200") + .height("100") + .key('qrcode') + } + } +} + + diff --git a/telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/pages/Rating.ets b/telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/pages/Rating.ets new file mode 100644 index 000000000..b29e26a39 --- /dev/null +++ b/telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/pages/Rating.ets @@ -0,0 +1,63 @@ +/* + * 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. + */ + +@Entry +@Component +struct rating_testcase { + @State rating: number = 2 + + onPageShow() { + console.info('Rating page show called'); + } + + onBuildDone() { + console.info('Rating page build done called'); + } + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Column() { + Text(`Rating page`) + .fontSize(50) + .fontWeight(FontWeight.Bold) + Rating({ rating: 2, indicator: false }) + .stepSize(0.5) + .stars(5) + .starStyle({ + backgroundUri: '/resources/rawfile/star-1-1.png', + foregroundUri: '/resources/rawfile/star-1-3.png', + secondaryUri: '/resources/rawfile/star-1-2.png' + }) + .onChange((value: number) => { + this.rating = value + }) + .key('rating1') + Rating({ rating: 2, indicator: true }) + .stepSize(0.5) + .stars(5) + .starStyle({ + backgroundUri: '/resources/rawfile/star-1-1.png', + foregroundUri: '/resources/rawfile/star-1-3.png', + secondaryUri: '/resources/rawfile/star-1-2.png' + }) + .key('rating2') + }.width(300) + .height(300) + .borderColor(Color.Pink) + .borderWidth(2) + } + } +} + diff --git a/telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/pages/RowSplit.ets b/telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/pages/RowSplit.ets new file mode 100644 index 000000000..0f4f397b1 --- /dev/null +++ b/telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/pages/RowSplit.ets @@ -0,0 +1,78 @@ +/* + * 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 router from '@system.router' + +@Entry +@Component +struct rowSplit_testcase { + @State resizeable: boolean = false + private content: string = "rowSplit Page"; + + onPageShow() { + console.info('RowSplit page show called'); + } + + onBuildDone() { + console.info('RowSplit page build done called'); + } + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Text(`${this.content}`) + .fontSize(50) + .fontWeight(FontWeight.Bold) + RowSplit() { + Column() { + Text('Demo1.RowSplit') + .fontSize(15) + .fontWeight(FontWeight.Bold) + } + + Column() { + Text('Demo2.RowSplit') + .fontSize(15) + .fontWeight(FontWeight.Bold) + } + } + .height(100) + .key('rowSplit') + .resizeable(this.resizeable) + .onClick(() => { + router.back() + }) + + RowSplit() { + Column() { + Text('Demo3.RowSplit') + .fontSize(15) + .fontWeight(FontWeight.Bold) + } + + Column() { + Text('Demo4.RowSplit') + .fontSize(15) + .fontWeight(FontWeight.Bold) + } + }.height(100) + .key('rowSplit1') + .resizeable(true) + } + .key('flex') + .width('100%') + .height('100%') + } +} + diff --git a/telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/pages/Scroll.ets b/telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/pages/Scroll.ets new file mode 100644 index 000000000..363089d22 --- /dev/null +++ b/telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/pages/Scroll.ets @@ -0,0 +1,200 @@ +/* + * 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. + */ + +@Entry +@Component +struct scroll_testcase { + @State scrollBarWidth: number = 20 + @State scrollable: ScrollDirection = ScrollDirection.None + @State scrollBarColor: Color = Color.Pink + @State scrollBar: BarState= BarState.On + private value1: Array = [1, 2, 3, 4, 5, 6, 7, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30] + @State edge: Edge= Edge.Top + private content: string = "Scroll Page"; + scroller: Scroller = new Scroller(); + + onPageShow() { + console.info('Button page show called'); + } + + onBuildDone() { + console.info('Button page build done called'); + } + + build() { + + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Text(`${this.content}`) + .fontSize(50) + .fontWeight(FontWeight.Bold) + Scroll(this.scroller) { + Column() { + ForEach( + this.value1, + item => { + Text(`${item}`) + .fontSize(15) + .width(400) + .margin(10) + .height(70) + .backgroundColor(0xfff5deb3) + }, + item => item + ) + } + } + .scrollable(ScrollDirection.Vertical) + .scrollBar(this.scrollBar) + .scrollBarColor(this.scrollBarColor) + .scrollBarWidth(this.scrollBarWidth) + .key('scroll') + .width(400) + .height(200) + .onScroll((xOffset: number, yOffset: number) => { + console.info(` current offset is ${xOffset} ${yOffset}`) + }) + .onScrollEnd(() => { + console.info(` now on scroll end`) + }) + .onScrollEdge((side: Edge) => { + console.info(`To the edge`) + }) + Scroll() { + Row() { + Text('scroll uppppp') + .width(60) + .height(100) + .backgroundColor(Color.Yellow) + .margin({ + right: 5, + left: 5 + }) + .key('text') + + Text('scroll to') + .width(60) + .height(100) + .backgroundColor(Color.Green) + .margin({ + right: 5, + left: 5 + }) + .onClick(() => { + this.scroller.scrollTo({ + xOffset: 100, + yOffset: 100, + }) + }) + Text('scroll page') + .width(60) + .height(100) + .backgroundColor(Color.Blue) + .margin({ + right: 5, + left: 5 + }) + .onClick(() => { + this.scroller.scrollPage({ + next: true + }) + }) + Text('scroll Edge') + .width(60) + .height(100) + .backgroundColor(Color.Blue) + .margin({ + right: 5, + left: 5 + }) + .onClick(() => { + this.scroller.scrollEdge(Edge.Top) + }) + Text('scroll Edge') + .width(60) + .height(100) + .backgroundColor(Color.Blue) + .margin({ + right: 5, + left: 5 + }) + .onClick(() => { + this.scroller.currentOffset() + }) + Text('scroll to index') + .width(60) + .height(100) + .backgroundColor(Color.Blue) + .margin({ + right: 5, + left: 5 + }) + .onClick(() => { + this.scroller.scrollToIndex(0) + console.info(` now on scroll end`) + }) + } + } + .key('scroll1') + .height(100) + .scrollable(ScrollDirection.Horizontal) + + Scroll() { + Column() { + Text("start").fontSize(30) + Text("scrollable1") + Text("scrollable2") + Text("scrollable3") + Text("scrollable4") + Text("scrollable1") + Text("scrollable2") + Text("scrollable3") + Text("scrollable4") + } + } + .padding(10) + .scrollable(ScrollDirection.None) + .scrollBar(BarState.Off) + .scrollBarColor(Color.Red) + .scrollBarWidth(5) + .width(300) + .height(200) + .key('scroll2') + + Scroll() { + Column() { + Text("start").fontSize(30) + Text("scrollable1") + Text("scrollable2") + Text("scrollable3") + Text("scrollable4") + Text("scrollable1") + Text("scrollable2") + Text("scrollable3") + Text("scrollable4") + } + } + .padding(10) + .scrollable(ScrollDirection.Free) + .scrollBar(BarState.Off) + .scrollBarColor(Color.Red) + .scrollBarWidth(5) + .width(300) + .height(200) + .key('scroll3') + } + .key('flex') + + } +} diff --git a/telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/pages/Slider.ets b/telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/pages/Slider.ets new file mode 100644 index 000000000..625cd0287 --- /dev/null +++ b/telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/pages/Slider.ets @@ -0,0 +1,82 @@ +/* + * 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. + */ + +@Entry +@Component +struct slider { + @State inSetValue: number= 40 + @State outSetValue: number= 40 + @State direction: Axis= Axis.Horizontal + @State Begin: number = SliderChangeMode.Begin + + onPageShow() { + console.info('Slider page show called'); + } + + onBuildDone() { + console.info('Slider page build done called'); + } + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Column() { + Text(`Slider page`) + .fontSize(50) + .fontWeight(FontWeight.Bold) + Slider({ + value: this.outSetValue, + min: 0, + max: 100, + step: 1, + direction: Axis.Horizontal, + reverse: false, + style: SliderStyle.OutSet + }) + .blockColor('#FFFF0000') + .selectedColor('#FF0000FF') + .trackColor('#FF808080') + .minLabel('10') + .maxLabel('10') + .showTips(false) + .showSteps(false) + .onChange((value: number, mode: SliderChangeMode) => { + this.outSetValue = value + this.Begin = mode + console.info('value: ' + value + '---mode: ' + mode) + }) + .width("100") + .height("100") + .key('slider1') + Slider({ + value: 40, + min: 0, + max: 100, + step: 1, + style: SliderStyle.InSet + }) + .blockColor(Color.Red) + .selectedColor(Color.Blue) + .trackColor(Color.Gray) + .showTips(true) + .showSteps(true) + .key('slider2') + }.width(300) + .height(300) + .borderColor(Color.Pink) + .borderWidth(2) + } + } +} + diff --git a/telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/pages/Span.ets b/telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/pages/Span.ets new file mode 100644 index 000000000..df5a71043 --- /dev/null +++ b/telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/pages/Span.ets @@ -0,0 +1,64 @@ +/* + * 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. + */ + +@Entry +@Component +struct span_textcase { + + onPageShow() { + console.info('Span page show called'); + } + + onBuildDone() { + console.info('Span page build done called'); + } + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Column() { + Text() { + Span('Test Span demo') + .decoration({ type: TextDecorationType.LineThrough, "color": Color.Red }) + .textCase(TextCase.UpperCase) + .fontColor(Color.Blue) + .fontSize("20fp") + .letterSpacing(5) + .fontFamily("sans-serif") + .fontWeight(FontWeight.Bold) + .fontStyle(FontStyle.Italic) + .key('span1') + Span('The second test Span demo') + .textCase(TextCase.LowerCase) + .fontColor(Color.Black) + .letterSpacing('5') + .fontSize(30) + .key('span2') + Span('The third test Span demo') + .textCase(TextCase.Normal) + .fontColor(Color.Yellow) + .fontSize("30fp") + .key('span3') + } + } + .width(300) + .height(300) + .borderColor(Color.Pink) + .borderWidth(4) + } + } +} + + + diff --git a/telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/pages/Stack.ets b/telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/pages/Stack.ets new file mode 100644 index 000000000..2a694889f --- /dev/null +++ b/telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/pages/Stack.ets @@ -0,0 +1,103 @@ +/* + * 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 router from '@system.router' + +@Entry +@Component +struct stack_testcase { + @State alignContent: Alignment = Alignment.Bottom + private content: string = "Stack Page"; + + onPageShow() { + console.info('Stack page show called'); + } + + onBuildDone() { + console.info('Stack page build done called'); + } + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Text(`${this.content}`) + .fontSize(50) + .fontWeight(FontWeight.Bold) + Stack({ alignContent: this.alignContent }) { + Text('First child, show in bottom').width('90%').height('100%').backgroundColor(0xd2cab3).align(Alignment.Top) + Text('Second child, show in top').width('70%').height('60%').backgroundColor(0xc1cbac).align(Alignment.Top) + } + .width('100%') + .height(80) + .margin({ top: 5 }) + .key('stack') + .onClick(() => { + router.back() + }) + + Stack({ alignContent: Alignment.BottomStart }) { + Text('First child, show in bottom').width('90%').height('100%').backgroundColor(0xd2cab3).align(Alignment.Top) + Text('Second child, show in top').width('70%').height('60%').backgroundColor(0xc1cbac).align(Alignment.Top) + }.width('100%').height(80).margin({ top: 5 }) + .key('stack1') + + Stack({ alignContent: Alignment.BottomEnd }) { + Text('First child, show in bottom').width('90%').height('100%').backgroundColor(0xd2cab3).align(Alignment.Top) + Text('Second child, show in top').width('70%').height('60%').backgroundColor(0xc1cbac).align(Alignment.Top) + }.width('100%').height(80).margin({ top: 5 }) + .key('stack2') + + Stack({ alignContent: Alignment.Start }) { + Text('First child, show in bottom').width('90%').height('100%').backgroundColor(0xd2cab3).align(Alignment.Top) + Text('Second child, show in top').width('70%').height('60%').backgroundColor(0xc1cbac).align(Alignment.Top) + }.width('100%').height(80).margin({ top: 5 }) + .key('stack3') + + Stack({ alignContent: Alignment.Center }) { + Text('First child, show in bottom').width('90%').height('100%').backgroundColor(0xd2cab3).align(Alignment.Top) + Text('Second child, show in top').width('70%').height('60%').backgroundColor(0xc1cbac).align(Alignment.Top) + }.width('100%').height(80).margin({ top: 5 }) + .key('stack4') + + Stack({ alignContent: Alignment.End }) { + Text('First child, show in bottom').width('90%').height('100%').backgroundColor(0xd2cab3).align(Alignment.Top) + Text('Second child, show in top').width('70%').height('60%').backgroundColor(0xc1cbac).align(Alignment.Top) + }.width('100%').height(80).margin({ top: 5 }) + .key('stack5') + + Stack({ alignContent: Alignment.Top }) { + Text('First child, show in bottom').width('90%').height('100%').backgroundColor(0xd2cab3).align(Alignment.Top) + Text('Second child, show in top').width('70%').height('60%').backgroundColor(0xc1cbac).align(Alignment.Top) + }.width('100%').height(60).margin({ top: 5 }) + .key('stack6') + + Stack({ alignContent: Alignment.TopStart }) { + Text('First child, show in bottom').width('90%').height('100%').backgroundColor(0xd2cab3).align(Alignment.Top) + Text('Second child, show in top').width('70%').height('60%').backgroundColor(0xc1cbac).align(Alignment.Top) + }.width('100%').height(60).margin({ top: 5 }) + .key('stack7') + + Stack({ alignContent: Alignment.TopEnd }) { + Text('First child, show in bottom').width('90%').height('100%').backgroundColor(0xd2cab3).align(Alignment.Top) + Text('Second child, show in top').width('70%').height('60%').backgroundColor(0xc1cbac).align(Alignment.Top) + }.width('100%').height(60).margin({ top: 5 }) + .key('stack8') + } + .key('flex') + .width('100%') + .height('100%') + + } +} + diff --git a/telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/pages/Text.ets b/telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/pages/Text.ets new file mode 100644 index 000000000..fbd1415dc --- /dev/null +++ b/telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/pages/Text.ets @@ -0,0 +1,237 @@ +/* + * 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. + */ + +// @ts-nocheck +import router from '@system.router' + +var paramInfo = router.getParams() +console.info("cd paramInfo" + JSON.stringify(paramInfo)) + +@Entry +@Component +struct text_textcase { + @State textAlign: TextAlign= TextAlign.End + @State lineHeight: string= '15fp' + @State overflow: TextOverflow = TextOverflow.Ellipsis + @State textOverflow: textOverflow<{ "overflow": TextOverflow }> = { "overflow": this.overflow } + @State maxLines: number = 2 + @State baselineOffset: number = 0 + @State textCase: TextCase= TextCase.Normal + @State decoration: decoration<{ + type: TextDecorationType, + color: Color + }> = { type: TextDecorationType.Underline, color: Color.Red } + @State color: Color = Color.Red + @State width: string= "200" + @State height: string= "100" + @State size: size = { width: 200, height: 100 } + @State marginBottom: string = "10px" + @State marginTop: string = "10px" + @State marginLeft: string = "10px" + @State marginRingt: string= "10px" + @State paddingBottom: string= "5" + @State paddingTop: string= "5" + @State paddingLeft: string= "5" + @State paddingRingt: string= "5" + @State constraintSize: constraintSize = { minWidth: 20, maxWidth: 200, minHeight: 0, maxHeight: 50 } + @State layoutPriority: string= "9px" + @State layoutWeight: string = "10px" + @State align: Alignment = Alignment.Center + @State direction: Direction = Direction.Auto + @State position: position<{ + x: string, + y: string + }> = { x: "50", y: "50" } + @State markAnchor: markAnchor<{ + x: string, + y: string + }> = { x: "50", y: "50" } + @State offset: offset<{ + x: string, + y: string + }> = { x: "50", y: "50" } + @State flexGrow: number = 5 + @State flexShrink: number = 2 + @State flexBasis: number = 0 + @State alignSelf: ItemAlign = ItemAlign.Auto + @State borderStyle: BorderStyle = BorderStyle.Dashed + @State borderRadius: number = 10 + @State borderWidth: string= "4px" + @State borderColor: Color= Color.Blue + @State backgroundColor: Color = Color.Pink + @State backgroundImageSize: ImageSize = ImageSize.Cover + @State backgroundImagePosition: Alignment= Alignment.Center + @State opacity: number= 1 + @State visibility: Visibility= Visibility.Visible + @State enabled: boolean = false + @State zIndex: number = 1 + @State fontStyle: FontStyle = FontStyle.Italic + @State fontSize: number = 15 + @State minFontSize: number = 15 + @State maxFontSize: number = 15 + @State letterSpacing: number= 10 + @State fontWeight: FontWeight= FontWeight.Bold + @State fontColor: Color= Color.Black + @State active: boolean = false + private content: string = "Text Page"; + + onPageShow() { + console.info('Text page show called'); + } + + onBuildDone() { + console.info('Text page build done called'); + } + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Text(`${this.content}`) + .fontSize(50) + .fontWeight(FontWeight.Bold) + Text('Text Anto test,Text Anto test,Text Anto test,Text Anto test,test,Text Anto test,Text Anto test,Text Anto test,Text Anto test,Text Anto test,Text Anto test') + .width(this.width) + .height(this.height) + .padding({ bottom: this.paddingBottom, top: this.paddingTop, right: this.paddingRingt, left: this.paddingLeft }) + .margin({ bottom: this.marginBottom, top: this.marginTop, right: this.marginRingt, left: this.marginLeft }) + .constraintSize(this.constraintSize) + .layoutWeight(this.layoutWeight) + .align(this.align) + .direction(this.direction) + .position(this.position) + .markAnchor(this.markAnchor) + .offset(this.offset) + .flexBasis(this.flexBasis) + .flexGrow(this.flexGrow) + .flexShrink(this.flexShrink) + .alignSelf(this.alignSelf) + .borderStyle(this.borderStyle) + .borderRadius(this.borderRadius) + .borderWidth(this.borderWidth) + .borderColor(this.borderColor) + .backgroundColor(this.backgroundColor) + .opacity(this.opacity) + .visibility(this.visibility) + .enabled(this.enabled) + .zIndex(this.zIndex) + .fontColor(this.fontColor) + .fontSize(this.fontSize) + .minFontSize(this.minFontSize) + .letterSpacing(this.letterSpacing) + .maxFontSize(this.maxFontSize) + .fontWeight(this.fontWeight) + .fontStyle(this.fontStyle) + .fontFamily("sans-serif") + .textAlign(this.textAlign) + .textOverflow(this.textOverflow) + .lineHeight(this.lineHeight) + .baselineOffset(this.baselineOffset) + .maxLines(2) + .textCase(this.textCase) + .decoration(this.decoration) + .aspectRatio(1) + .fontColor(Color.Black) + .key('Text') + Text('Text Anto test,Text Anto test,Text Anto test,Text Anto test,Text Anto test,Text Anto test,Text Anto test,Text Anto test') + .size({ width: 100, height: 50 }) + .padding({ bottom: 5, top: 5, right: 5, left: 10 }) + .margin({ bottom: 15, top: 10, right: 10, left: 10 }) + .fontSize('13') + .textAlign(TextAlign.Start) + .align(Alignment.Start) + .direction(Direction.Ltr) + .alignSelf(ItemAlign.Start) + .borderStyle(BorderStyle.Dotted) + .borderWidth(2) + .visibility(Visibility.Hidden) + .enabled(true) + .fontWeight(FontWeight.Normal) + .textAlign(TextAlign.Start) + .textOverflow(TextOverflow.Clip) + .maxLines(2) + .textCase(TextCase.LowerCase) + .decoration({ "type": TextDecorationType.LineThrough, "color": Color.Red }) + .fontColor(Color.White) + .key('Text1') + Text('Text Anto test,Text Anto test,Text Anto test,Text Anto test,Text Anto test,Text Anto test,Text Anto test,Text Anto test,Text Anto test') + .fontSize(13) + .width('100%') + .textAlign(TextAlign.Center) + .align(Alignment.TopEnd) + .direction(Direction.Rtl) + .alignSelf(ItemAlign.Center) + .borderStyle(BorderStyle.Solid) + .borderWidth(2) + .visibility(Visibility.None) + .fontWeight(FontWeight.Bolder) + .textAlign(TextAlign.Center) + .textOverflow(TextOverflow.None) + .textCase(TextCase.UpperCase) + .decoration({ "type": TextDecorationType.None, "color": Color.Red }) + .fontColor(Color.Blue) + .key('Text2') + Text('Text Anto test,Text Anto test,Text Anto test,Text Anto test') + .fontSize(13) + .align(Alignment.Top) + .alignSelf(ItemAlign.End) + .borderWidth(2) + .width('100%') + .fontWeight(FontWeight.Lighter) + .decoration({ type: TextDecorationType.Overline, color: Color.Red }) + .fontColor(Color.Gray) + .key('Text3') + Text('Text Anto test,Text Anto test') + .fontSize(13) + .align(Alignment.TopStart) + .alignSelf(ItemAlign.Baseline) + .borderWidth(2) + .width('100%') + .fontWeight(FontWeight.Medium) + .fontColor(Color.Brown) + .key('Text4') + Text('Text Anto test,Text Anto test,Text Anto test') + .fontSize(13) + .align(Alignment.End) + .alignSelf(ItemAlign.Stretch) + .borderWidth(2) + .width('100%') + .fontWeight(FontWeight.Regular) + .fontColor(Color.Grey) + .key('Text5') + Text('Text Anto test,Text Anto test,Text Anto test') + .fontSize(13) + .align(Alignment.BottomEnd) + .width('100%') + .fontColor(Color.Orange) + .key('Text6') + Text('Text Anto test,Text Anto test,Text Anto test') + .fontSize(13) + .align(Alignment.Bottom) + .width('100%') + .fontColor(Color.Yellow) + .key('Text7') + Text('Text Anto test,Text Anto test,Text Anto test') + .fontSize(13) + .align(Alignment.BottomStart) + .width('100%') + .key('Text8') + + } + .key('flex') + .width('100%') + .height('100%') + } +} + + diff --git a/telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/pages/index.ets b/telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/pages/index.ets new file mode 100644 index 000000000..10359134d --- /dev/null +++ b/telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/pages/index.ets @@ -0,0 +1,65 @@ +// @ts-nocheck +/** + * 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 file from '@system.file'; + +import {Core, ExpectExtend, InstrumentLog, ReportExtend} from "deccjsunit/index.ets"; +import testsuite from "../test/List.test.ets"; +import featureAbility from "@ohos.ability.featureAbility"; + +@Entry +@Component +struct MyComponent { + aboutToAppear() { + console.info("start run testcase!!!!") + featureAbility.getWant() + .then((Want) => { + const core = Core.getInstance(); + const expectExtend = new ExpectExtend({ + 'id': 'extend' + }); + core.addService('expect', expectExtend); + const reportExtend = new ReportExtend(file); + core.addService('report', reportExtend); + core.init(); + core.subscribeEvent('task', reportExtend); + const configService = core.getDefaultService('config'); + Want.parameters['timeout'] = 100000 + console.info('parameters---->' + JSON.stringify(Want.parameters)); + configService.setConfig(Want.parameters); + testsuite(); + core.execute(); + console.info('Operation successful. Data: ' + JSON.stringify(Want)); + }) + .catch((error) => { + console.error('Operation failed. Cause: ' + JSON.stringify(error)); + }) + } + + build() { + Flex({ + direction: FlexDirection.Column, + alignItems: ItemAlign.Center, + justifyContent: FlexAlign.Center + }) { + Text('ACE ETS TEST') + .fontSize(50) + .fontWeight(FontWeight.Bold) + } + .width('100%') + .height('100%') + } +} + diff --git a/telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/test/HttpJsunit.test.ets b/telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/test/HttpJsunit.test.ets new file mode 100644 index 000000000..04700bf74 --- /dev/null +++ b/telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/test/HttpJsunit.test.ets @@ -0,0 +1,36 @@ +/* + * 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 {describe, beforeAll, afterAll, it, expect, afterEach} from 'deccjsunit/index.ets'; +import http from '@ohos.net.http'; + +export default function httpJsunit() { + describe("httpJsunitTest", function () { + /** + * @tc.number Telephony_Http_Http_createHttp_0100 + * @tc.name createHttp + * @tc.desc Test Create HTTP authentication. + */ + it("Telephony_Http_Http_createHttp_0100", 0, async function (done) { + console.log("-----------------------http createHttp Test is starting-----------------------"); + var httpRequest = http.createHttp(); + expect(httpRequest != null).assertTrue(); + console.log("-----------------------http createHttp Test end-----------------------"); + done(); + }); + + }) + +}; + diff --git a/telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/test/HttpRequestJsunit.test.ets b/telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/test/HttpRequestJsunit.test.ets new file mode 100644 index 000000000..3dcab425b --- /dev/null +++ b/telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/test/HttpRequestJsunit.test.ets @@ -0,0 +1,280 @@ +/* + * 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 {describe, beforeAll, afterAll, it, expect, afterEach} from 'deccjsunit/index.ets'; +import http from '@ohos.net.http'; +import utils from './Utils.ets' + +export default function httpRequestJsunit() { + describe("HttpRequestJsunitTest", function () { + /** + * @tc.number Telephony_http_HttpRequest_request_0100 + * @tc.name httprequest::request + * @tc.desc Test Test httprequest property. + */ + it("Telephony_http_HttpRequest_request_0100", 0, async function (done) { + var casename = "Telephony_http_HttpRequest_0100" + console.log("-----------------------HttpRequest_request Test is starting-----------------------"); + try { + let httpRequestOptions = { + method: 'GET', + extraData: null, + header: "content-type': 'application/json", + readTimeout: 60, + connectTimeout: 60 + } + var httpRequest = http.createHttp(); + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + httpRequest.request("https://www.baidu.com/", httpRequestOptions, (err, data) => { + console.log(casename + JSON.stringify(err) + " data: " + JSON.stringify(data)); + expect(data.getResponseCode = 200).assertTrue(); + console.log("-----------------------HttpRequest_request Test end-----------------------"); + done(); + }); + } catch (error) { + console.log("Telephony_http_HttpRequest_request_0100 : error = " + error); + done(); + } + }); + + /** + * @tc.number Telephony_http_HttpRequest_request_0200 + * @tc.name httprequest::request + * @tc.desc Test Test httprequest property. + */ + it("Telephony_http_HttpRequest_request_0200", 0, async function (done) { + var casename = "Telephony_http_HttpRequest_0100" + console.log("-----------------------HttpRequest_request_01 Test is starting-----------------------"); + try { + var httpRequest = http.createHttp(); + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + httpRequest.request("https://www.baidu.com/", (err, data) => { + console.log(casename + JSON.stringify(err) + " data: " + JSON.stringify(data)); + expect(data.getResponseCode = 200).assertTrue(); + console.log("-----------------------HttpRequest_request_01 Test end-----------------------"); + done(); + }); + } catch (error) { + console.log("Telephony_http_HttpRequest_request_0200 : error = " + error); + done(); + } + }); + + /** + * @tc.number Telephony_http_HttpRequest_request_0300 + * @tc.name httprequest::request + * @tc.desc Test Test httprequest property. + */ + it("Telephony_http_HttpRequest_request_0300", 0, async function (done) { + var casename = "Telephony_http_HttpRequest_0100" + console.log("-----------------------HttpRequest_request_02 Test is starting-----------------------"); + try { + let httpRequestOptions = { + method: 'GET', + extraData: null, + header: "content-type': 'application/json", + readTimeout: 60, + connectTimeout: 60 + } + var httpRequest = http.createHttp(); + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + httpRequest.request("https://www.baidu.com/", httpRequestOptions).then(data => { + console.log(casename + JSON.stringify(data)); + expect(data.getResponseCode = 200).assertTrue(); + console.log("-----------------------HttpRequest_request_02 Test end-----------------------"); + done(); + }).catch(error => { + console.info('HttpRequest_request_0300 asyncCallback error : ' + JSON.stringify(error)); + done(); + }); + } catch (error) { + console.log("Telephony_http_HttpRequest_request_0300 : error = " + error); + done(); + } + }); + + + /** + * @tc.number Telephony_http_HttpRequest_destroy_0100 + * @tc.name httprequest::destroy + * @tc.desc Test Test httprequest property. + */ + + it("Telephony_http_HttpRequest_destroy_0100", 0, async function (done) { + var casename = "Telephony_http_HttpRequest_0200" + console.log("-----------------------HttpRequest_destroy Test is starting-----------------------"); + try { + let httpRequestOptions = { + method: 'GET', + extraData: null, + header: "content-type': 'application/json", + readTimeout: 60, + connectTimeout: 60 + } + var httpRequest = http.createHttp(); + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + httpRequest.request("https://www.baidu.com/", httpRequestOptions, (err, data) => { + console.log(casename + JSON.stringify(err) + " data: " + JSON.stringify(data)); + try{ + httpRequest.destroy(); + expect(true).assertTrue(); + console.log("-----------------------HttpRequest_destroy Test end-----------------------"); + done(); + }catch(error){ + expect().assertFail(); + done(); + } + }); + } catch (error) { + console.log("Telephony_http_HttpRequest_destroy_0100 : error = " + error); + done(); + } + }); + + /** + * @tc.number Telephony_http_HttpRequest_on_headerReceive_0100 + * @tc.name httprequest::on_headerReceive + * @tc.desc Test Test httprequest property. + */ + + it("Telephony_http_HttpRequest_on_headerReceive_0100", 0, async function (done) { + var casename = "Telephony_http_HttpRequest_0300" + console.log("-----------------------HttpRequest_on_headerReceive Test is starting-----------------------"); + try { + var httpRequest = http.createHttp(); + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + httpRequest.on_headerReceive((data) => { + console.log(casename + " data: " + JSON.stringify(data)); + expect(true).assertTrue(); + console.log("-----------------------HttpRequest_on_headerReceive Test end-----------------------"); + done(); + }); + + } catch (error) { + console.log("Telephony_http_HttpRequest_on_headerReceive_0100 : error = " + error); + done(); + } + }); + + /** + * @tc.number Telephony_http_HttpRequest_off_headerReceive_0100 + * @tc.name httprequest::off_headerReceive + * @tc.desc Test Test httprequest property. + */ + it("Telephony_http_HttpRequest_off_headerReceive_0100", 0, async function (done) { + var casename = "Telephony_http_HttpRequest_0400" + console.log("-----------------------HttpRequest_off_headerReceive Test is starting-----------------------"); + try { + var httpRequest = http.createHttp(); + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + httpRequest.off_headerReceive((data) => { + console.log(casename + " data: " + JSON.stringify(data)); + expect(true).assertTrue(); + console.log("-----------------------HttpRequest_off_headerReceive Test end-----------------------"); + done(); + }); + + } catch (error) { + console.log("Telephony_http_HttpRequest_off_headerReceive_0100 : error = " + error); + done(); + } + }); + + + /** + * @tc.number Telephony_http_HttpRequest_on_headersReceive_0100 + * @tc.name httprequest::on_headersReceive + * @tc.desc Test Test httprequest property. + */ + + it("Telephony_http_HttpRequest_on_headersReceive_0100", 0, function (done) { + var casename = "Telephony_http_HttpRequest_0500" + console.log("-----------------------HttpRequest_on_headersReceive Test is starting-----------------------"); + try { + var httpRequest = http.createHttp(); + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + httpRequest.on("headersReceive", (data) => { + console.log(casename + " data: " + JSON.stringify(data)); + expect(true).assertTrue(); + console.log("-----------------------HttpRequest_on_headersReceive Test end-----------------------"); + done(); + }); + + } catch (error) { + console.log("Telephony_http_HttpRequest_on_headersReceive_0100 : error = " + error); + done(); + } + }); + + /** + * @tc.number Telephony_http_HttpRequest_off_headersReceive_0100 + * @tc.name httprequest::off_headersReceive + * @tc.desc Test Test httprequest property. + */ + it("Telephony_http_HttpRequest_off_headersReceive_0100", 0, function (done) { + var casename = "Telephony_http_HttpRequest_0600" + console.log("-----------------------HttpRequest_off_headersReceive Test is starting-----------------------"); + try { + var httpRequest = http.createHttp(); + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + httpRequest.off("headersReceive", (data) => { + console.log(casename + " data: " + JSON.stringify(data)); + expect(true).assertTrue(); + console.log("-----------------------HttpRequest_off_headersReceive Test end-----------------------"); + done(); + }); + + } catch (error) { + console.log("Telephony_http_HttpRequest_off_headersReceive_0100 : error = " + error); + done(); + } + }); + + + }) + +}; + diff --git a/telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/test/HttpRequestOptionsJsunit.test.ets b/telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/test/HttpRequestOptionsJsunit.test.ets new file mode 100644 index 000000000..7d711790c --- /dev/null +++ b/telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/test/HttpRequestOptionsJsunit.test.ets @@ -0,0 +1,522 @@ +/* + * 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 {describe, beforeAll, afterAll, it, expect, afterEach} from 'deccjsunit/index.ets'; +import http from '@ohos.net.http'; +import utils from './Utils.ets' + + +export default function HttpRequestOptionsJsunit() { + describe("HttpRequestOptionsJsunitTest", function () { + + + /** + * @tc.number Telephony_Http_HttpRequestOptions_method_0100 + * @tc.name HttpRequestOptions::method + * @tc.desc Test Test HttpRequestOptions property. + */ + it("Telephony_http_HttpRequestOptions_method_0100", 0, async function (done) { + var casename = 'Telephony_Http_HttpRequestOptions_0100'; + console.log("-----------------------HttpRequestOptions_method Test is starting-----------------------"); + try { + let httpRequestOptions = { + method: 'GET', + extraData: null, + header: "content-type': 'application/json", + readTimeout: 60, + connectTimeout: 60 + } + var httpRequest = http.createHttp(); + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + httpRequest.request("https://www.baidu.com/", httpRequestOptions, (err, data) => { + console.log(casename + JSON.stringify(err) + " data: " + JSON.stringify(data)); + expect(data.getResponseCode = 200).assertTrue(); + console.log("-----------------------HttpRequestOptions_method Test end-----------------------"); + done(); + }); + } catch (error) { + console.log("Telephony_Http_HttpRequestOptions_method_0100 : error = " + error); + done(); + } + }); + + + + /** + * @tc.number Telephony_http_HttpRequestOptions_method_0200 + * @tc.name HttpRequestOptions::method + * @tc.desc Test Test HttpRequestOptions property. + */ + it("Telephony_http_HttpRequestOptions_method_0200", 0, async function (done) { + var casename = 'Telephony_Http_HttpRequestOptions_0100'; + console.log("-----------------------HttpRequestOptions_method_01 Test is starting-----------------------"); + try { + let httpRequestOptions = { + method: 'GET', + extraData: null, + header: "content-type': 'application/json", + readTimeout: 60, + connectTimeout: 60 + } + var httpRequest = http.createHttp(); + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + httpRequest.request("https://www.baidu.com/", httpRequestOptions).then(data => { + console.log(casename + JSON.stringify(data)); + expect(data.getResponseCode = 200).assertTrue(); + console.log("-----------------------HttpRequestOptions_method_01 Test end-----------------------"); + done(); + }).catch(error => { + console.info(casename+"errocode" + JSON.stringify(error)); + done(); + }); + } catch (error) { + console.log("Telephony_http_HttpRequestOptions_method_0200 : error = " + error); + done(); + } + }); + + + /** + * @tc.number Telephony_Http_HttpRequestOptions_extraData_0100 + * @tc.name HttpRequestOptions::extraData + * @tc.desc Test Test HttpRequestOptions property. + */ + it("Telephony_Http_HttpRequestOptions_extraData_0100", 0, async function (done) { + var casename = 'Telephony_Http_HttpRequestOptions_0200'; + console.log("-----------------------HttpRequestOptions_extraData Test is starting-----------------------"); + try { + let httpRequestOptions = { + method: 'GET', + extraData: { + //tn=albumsdetail&word=渐变风格插画&fr=albumslist&album_tab=设计素材&album_id=409&rn=30 + tn: "albumsdetail", + work: "渐变风格插画", + fr: "albumslist", + album_tab: "设计素材", + album_id: "409", + rn: "30" + }, + header: "content-type': 'application/json", + readTimeout: 60, + connectTimeout: 60 + } + var httpRequest = http.createHttp(); + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + httpRequest.request("https://image.baidu.com/search/albumsdetail/", httpRequestOptions, (err, data) => { + console.log(casename + JSON.stringify(err) + " data: " + JSON.stringify(data)); + expect(data.getResponseCode = 200).assertTrue(); + console.log("-----------------------HttpRequestOptions_extraData Test end-----------------------"); + done(); + }); + } catch (error) { + console.log("Telephony_Http_HttpRequestOptions_extraData_0100 : error = " + error); + done(); + } + }); + + + + /** + * @tc.number Telephony_Http_HttpRequestOptions_extraData_0200 + * @tc.name HttpRequestOptions::extraData + * @tc.desc Test Test HttpRequestOptions property. + */ + it("Telephony_Http_HttpRequestOptions_extraData_0200", 0, async function (done) { + var casename = 'Telephony_Http_HttpRequestOptions_0200'; + console.log("-----------------------HttpRequestOptions_extraData_01 Test is starting-----------------------"); + try { + let httpRequestOptions = { + method: 'GET', + extraData: { + //tn=albumsdetail&word=渐变风格插画&fr=albumslist&album_tab=设计素材&album_id=409&rn=30 + tn: "albumsdetail", + work: "渐变风格插画", + fr: "albumslist", + album_tab: "设计素材", + album_id: "409", + rn: "30" + }, + header: "content-type': 'application/json", + readTimeout: 60, + connectTimeout: 60 + } + var httpRequest = http.createHttp(); + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + httpRequest.request("https://image.baidu.com/search/albumsdetail/", httpRequestOptions).then(data => { + console.log(casename + JSON.stringify(data)); + expect(data.getResponseCode = 200).assertTrue(); + console.log("-----------------------HttpRequestOptions_extraData_01 Test end-----------------------"); + done(); + }).catch(error => { + console.info(casename+"errocode" + JSON.stringify(error)); + done(); + }); + } catch (error) { + console.log("Telephony_Http_HttpRequestOptions_extraData_0200 : error = " + error); + done(); + } + }); + + + /** + * @tc.number Telephony_Http_HttpRequestOptions_header_0100 + * @tc.name HttpRequestOptions::header + * @tc.desc Test Test HttpRequestOptions property. + */ + + it("Telephony_Http_HttpRequestOptions_header_0100", 0, async function (done) { + var casename = 'Telephony_Http_HttpRequestOptions_0300'; + console.log("-----------------------HttpRequestOptions_header Test is starting-----------------------"); + try { + let httpRequestOptions = { + method: 'GET', + extraData: null, + header: "content-type': 'application/json", + readTimeout: 60, + connectTimeout: 60 + } + var httpRequest = http.createHttp(); + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + httpRequest.request("https://www.baidu.com/", httpRequestOptions, (err, data) => { + console.log(casename + JSON.stringify(err) + " data: " + JSON.stringify(data)); + try { + var entity = JSON.parse(data.getResult()); + expect(true).assertTrue(); + console.log("-----------------------HttpRequestOptions_header Test end-----------------------"); + done(); + } catch (error) { + console.log("Telephony_Http_HttpRequestOptions_header_0100 : JSON parse error = " + error); + expect().assertFail(); + done(); + } + }); + } catch (error) { + console.log("Telephony_Http_HttpRequestOptions_header_0100 : error = " + error); + done(); + } + }); + + /** + * @tc.number Telephony_Http_HttpRequestOptions_header_0200 + * @tc.name HttpRequestOptions::header + * @tc.desc Test Test HttpRequestOptions property. + */ + + it("Telephony_Http_HttpRequestOptions_header_0200", 0, async function (done) { + var casename = 'Telephony_Http_HttpRequestOptions_0300'; + console.log("-----------------------HttpRequestOptions_header_01 Test is starting-----------------------"); + try { + let httpRequestOptions = { + method: 'GET', + extraData: null, + header: "content-type': 'application/json", + readTimeout: 60, + connectTimeout: 60 + } + var httpRequest = http.createHttp(); + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + httpRequest.request("https://www.baidu.com/", httpRequestOptions).then(data => { + console.log(casename + JSON.stringify(data)); + try { + var entity = JSON.parse(data.getResult()); + expect(true).assertTrue(); + console.log("-----------------------HttpRequestOptions_header_01 Test end-----------------------"); + done(); + } catch (error) { + console.log("Telephony_Http_HttpRequestOptions_header_0200 : JSON parse error = " + error); + expect().assertFail(); + done(); + } + + }).catch(error => { + console.info(casename+"errocode" + JSON.stringify(error)); + done(); + }); + } catch (error) { + console.log("Telephony_Http_HttpRequestOptions_header_0200 : error = " + error); + done(); + } + }); + + + + + /** + * @tc.number Telephony_Http_HttpRequestOptions_header_0300 + * @tc.name HttpRequestOptions::header + * @tc.desc Test Test HttpRequestOptions property. + */ + + it("Telephony_Http_HttpRequestOptions_header_0300", 0, async function (done) { + var casename = 'Telephony_Http_HttpRequestOptions_0300'; + console.log("-----------------------HttpRequestOptions_header_02 Test is starting-----------------------"); + try { + let httpRequestOptions = { + method: 'GET', + extraData: null, + header: "content-type': 'application/xml", + readTimeout: 60, + connectTimeout: 60 + } + var httpRequest = http.createHttp(); + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + httpRequest.request("https://www.baidu.com/", httpRequestOptions, (err, data) => { + console.log(casename + JSON.stringify(err) + " data: " + JSON.stringify(data)); + try { + var result = ''; + expect(data.getResult().contains(result)).assertTrue(); + console.log("-----------------------HttpRequestOptions_header_02 Test end-----------------------"); + done(); + } catch (error) { + console.log("Telephony_Http_HttpRequestOptions_header_0300 : JSON parse error = " + error); + expect().assertFail(); + done(); + } + }); + } catch (error) { + console.log("Telephony_Http_HttpRequestOptions_header_0300 : error = " + error); + done(); + } + }); + + /** + * @tc.number Telephony_Http_HttpRequestOptions_header_0400 + * @tc.name HttpRequestOptions::header + * @tc.desc Test Test HttpRequestOptions property. + */ + + it("Telephony_Http_HttpRequestOptions_header_0400", 0, async function (done) { + var casename = 'Telephony_Http_HttpRequestOptions_0300'; + console.log("-----------------------HttpRequestOptions_header_03 Test is starting-----------------------"); + try { + let httpRequestOptions = { + method: 'GET', + extraData: null, + header: "content-type': 'application/xml", + readTimeout: 60, + connectTimeout: 60 + } + var httpRequest = http.createHttp(); + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + httpRequest.request("https://www.baidu.com/", httpRequestOptions).then(data => { + console.log(casename + JSON.stringify(data)); + try { + var result = ''; + expect(data.getResult().contains(result)).assertTrue(); + console.log("-----------------------HttpRequestOptions_header_03 Test end-----------------------"); + done(); + } catch (error) { + console.log("Telephony_Http_HttpRequestOptions_header_0400 : JSON parse error = " + error); + expect().assertFail(); + done(); + } + + }).catch(error => { + console.info(casename+"errocode" + JSON.stringify(error)); + done(); + }); + } catch (error) { + console.log("Telephony_Http_HttpRequestOptions_header_0400 : error = " + error); + done(); + } + }); + + + + + + /** + * @tc.number Telephony_Http_HttpRequestOptions_readTimeout_0100 + * @tc.name HttpRequestOptions::readTimeout + * @tc.desc Test Test HttpRequestOptions property. + */ + + it("Telephony_Http_HttpRequestOptions_readTimeout_0100", 0, async function (done) { + var casename = 'Telephony_Http_HttpRequestOptions_0400'; + console.log("-----------------------HttpRequestOptions_readTimeout Test is starting-----------------------"); + try { + let httpRequestOptions = { + method: 'GET', + extraData: null, + header: "content-type': 'application/json", + readTimeout: 0.1, + connectTimeout: 60 + } + var httpRequest = http.createHttp(); + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + httpRequest.request("https://www.baidu.com/", httpRequestOptions, (err, data) => { + console.log(casename + JSON.stringify(err) + " data: " + JSON.stringify(data)); + expect(data.getResponseCode == 408).assertTrue(); + console.log("-----------------------HttpRequestOptions_readTimeout Test end-----------------------"); + done(); + }); + } catch (error) { + console.log("Telephony_Http_HttpRequestOptions_readTimeout_0100 : error = " + error); + done(); + } + }); + + /** + * @tc.number Telephony_Http_HttpRequestOptions_readTimeout_0200 + * @tc.name HttpRequestOptions::readTimeout + * @tc.desc Test Test HttpRequestOptions property. + */ + + it("Telephony_Http_HttpRequestOptions_readTimeout_0200", 0, async function (done) { + var casename = 'Telephony_Http_HttpRequestOptions_0400'; + console.log("-----------------------HttpRequestOptions_readTimeout_01 Test is starting-----------------------"); + try { + let httpRequestOptions = { + method: 'GET', + extraData: null, + header: "content-type': 'application/json", + readTimeout: 0.1, + connectTimeout: 60 + } + var httpRequest = http.createHttp(); + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + httpRequest.request("https://www.baidu.com/", httpRequestOptions).then(data => { + console.log(casename + JSON.stringify(data)); + expect(data.getResponseCode == 408).assertTrue(); + console.log("-----------------------HttpRequestOptions_readTimeout_01 Test end-----------------------"); + done(); + }).catch(error => { + console.info(casename+"errocode" + JSON.stringify(error)); + done(); + }); + } catch (error) { + console.log("Telephony_Http_HttpRequestOptions_readTimeout_0200 : error = " + error); + done(); + } + }); + + + /** + * @tc.number Telephony_Http_HttpRequestOptions_connectTimeout_0100 + * @tc.name HttpRequestOptions::connectTimeout + * @tc.desc Test Test HttpRequestOptions property. + */ + + it("Telephony_Http_HttpRequestOptions_connectTimeout_0100", 0, async function (done) { + var casename = 'Telephony_Http_HttpRequestOptions_0500'; + console.log("-----------------------HttpRequestOptions_connectTimeout Test is starting-----------------------"); + try { + let httpRequestOptions = { + method: 'GET', + extraData: null, + header: "content-type': 'application/json", + readTimeout: 60, + connectTimeout: 0.1 + } + var httpRequest = http.createHttp(); + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + httpRequest.request("https://www.baidu.com/", httpRequestOptions, (err, data) => { + console.log(casename + JSON.stringify(err) + " data: " + JSON.stringify(data)); + expect(data.getResponseCode == 504).assertTrue(); + console.log("-----------------------HttpRequestOptions_connectTimeout Test end-----------------------"); + done(); + }); + } catch (error) { + console.log("Telephony_Http_HttpRequestOptions_connectTimeout_0100 : error = " + error); + done(); + } + }); + + + /** + * @tc.number Telephony_Http_HttpRequestOptions_connectTimeout_0200 + * @tc.name HttpRequestOptions::connectTimeout + * @tc.desc Test Test HttpRequestOptions property. + */ + + it("Telephony_Http_HttpRequestOptions_connectTimeout_0200", 0, async function (done) { + var casename = 'Telephony_Http_HttpRequestOptions_0500'; + console.log("-----------------------HttpRequestOptions_connectTimeout_01 Test is starting-----------------------"); + try { + let httpRequestOptions = { + method: 'GET', + extraData: null, + header: "content-type': 'application/json", + readTimeout: 60, + connectTimeout: 0.1 + } + var httpRequest = http.createHttp(); + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + httpRequest.request("https://www.baidu.com/", httpRequestOptions).then(data => { + console.log(casename + JSON.stringify(data)); + expect(data.getResponseCode == 504).assertTrue(); + console.log("-----------------------HttpRequestOptions_connectTimeout_01 Test end-----------------------"); + done(); + }).catch(error => { + console.info(casename+"errocode" + JSON.stringify(error)); + done(); + }); + } catch (error) { + console.log("Telephony_Http_HttpRequestOptions_connectTimeout_0200 : error = " + error); + done(); + } + }); + + }) + +}; + diff --git a/telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/test/HttpResponseJsunit.test.ets b/telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/test/HttpResponseJsunit.test.ets new file mode 100644 index 000000000..215913b1f --- /dev/null +++ b/telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/test/HttpResponseJsunit.test.ets @@ -0,0 +1,449 @@ +/* + * 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 {describe, beforeAll, afterAll, it, expect, afterEach} from 'deccjsunit/index.ets'; +import http from '@ohos.net.http'; +import utils from './Utils.ets' + +export default function httpResponseJsunit() { + describe("HttpResponseJsunitTest", function () { + + /** + * @tc.number Telephony_Http_HttpResponse_result_0100 + * @tc.name HttpResponse::result + * @tc.desc Test Test HttpResponse property. + */ + + it("Telephony_Http_HttpResponse_result_0100", 0, async function (done) { + var casename = 'Telephony_Http_HttpResponse_0100'; + console.log("-----------------------HttpResponse result Test is starting-----------------------"); + try { + let httpRequestOptions = { + method: 'GET', + extraData: null, + header: "content-type': 'application/json", + readTimeout: 60, + connectTimeout: 60 + } + var httpRequest = http.createHttp(); + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + httpRequest.request("https://www.baidu.com/", httpRequestOptions, (err, data) => { + console.log(casename + JSON.stringify(err) + " data: " + JSON.stringify(data)); + expect(data.getResult() != null).assertTrue(); + console.log("-----------------------HttpResponse result Test end-----------------------"); + done(); + }); + } catch (error) { + console.log("Telephony_Http_HttpResponse_result_0100 : error = " + error); + done(); + } + }); + + + /** + * @tc.number Telephony_Http_HttpResponse_result_0200 + * @tc.name HttpResponse::result + * @tc.desc Test Test HttpResponse property. + */ + + it("Telephony_Http_HttpResponse_result_0200", 0, async function (done) { + var casename = 'Telephony_Http_HttpResponse_0100'; + console.log("-----------------------HttpResponse result_01 Test is starting-----------------------"); + try { + var httpRequest = http.createHttp(); + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + httpRequest.request("https://www.baidu.com/", (err, data) => { + console.log(casename + JSON.stringify(err) + " data: " + JSON.stringify(data)); + expect(data.getResult() != null).assertTrue(); + console.log("-----------------------HttpResponse result_01 Test end-----------------------"); + done(); + }); + } catch (error) { + console.log("Telephony_Http_HttpResponse_result_0200 : error = " + error); + done(); + } + }); + + + /** + * @tc.number Telephony_Http_HttpResponse_result_0300 + * @tc.name HttpResponse::result + * @tc.desc Test Test HttpResponse property. + */ + + it("Telephony_Http_HttpResponse_result_0300", 0, async function (done) { + var casename = 'Telephony_Http_HttpResponse_0100'; + console.log("-----------------------HttpResponse result_02 Test is starting-----------------------"); + try { + let httpRequestOptions = { + method: 'GET', + extraData: null, + header: "content-type': 'application/json", + readTimeout: 60, + connectTimeout: 60 + } + var httpRequest = http.createHttp(); + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + httpRequest.request("https://www.baidu.com/", httpRequestOptions).then(data => { + console.log(casename + JSON.stringify(data)); + expect(data.getResult() != null).assertTrue(); + console.log("-----------------------HttpResponse result_02 Test end-----------------------"); + done(); + }).catch(error => { + console.info(casename+"errocode" + JSON.stringify(error)); + done(); + }); + } catch (error) { + console.log("Telephony_Http_HttpResponse_result_0300 : error = " + error); + done(); + } + }); + + + /** + * @tc.number Telephony_Http_HttpResponse_responseCode_0100 + * @tc.name HttpResponse::responseCode + * @tc.desc Test Test HttpResponse property. + */ + + it("Telephony_Http_HttpResponse_responseCode_0100", 0, async function (done) { + var casename = 'Telephony_Http_HttpResponse_0200'; + console.log("-----------------------HttpResponse responseCode Test is starting-----------------------"); + try { + let httpRequestOptions = { + method: 'GET', + extraData: null, + header: "content-type': 'application/json", + readTimeout: 60, + connectTimeout: 60 + } + var httpRequest = http.createHttp(); + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + httpRequest.request("https://www.baidu.com/", httpRequestOptions, (err, data) => { + console.log(casename + JSON.stringify(err) + " data: " + JSON.stringify(data)); + expect(data.getResponseCode() != 0).assertTrue(); + console.log("-----------------------HttpResponse responseCode Test end-----------------------"); + done(); + }); + } catch (error) { + console.log("Telephony_Http_HttpResponse_responseCode_0100 : error = " + error); + done(); + } + }); + + + /** + * @tc.number Telephony_Http_HttpResponse_responseCode_0200 + * @tc.name HttpResponse::responseCode + * @tc.desc Test Test HttpResponse property. + */ + + it("Telephony_Http_HttpResponse_responseCode_0200", 0, async function (done) { + var casename = 'Telephony_Http_HttpResponse_0200'; + console.log("-----------------------HttpResponse responseCode_01 Test is starting-----------------------"); + try { + var httpRequest = http.createHttp(); + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + httpRequest.request("https://www.baidu.com/", (err, data) => { + console.log(casename + JSON.stringify(err) + " data: " + JSON.stringify(data)); + expect(data.getResponseCode() != 0).assertTrue(); + console.log("-----------------------HttpResponse responseCode_01 Test end-----------------------"); + done(); + }); + } catch (error) { + console.log("Telephony_Http_HttpResponse_responseCode_0200 : error = " + error); + done(); + } + }); + + + + /** + * @tc.number Telephony_Http_HttpResponse_responseCode_0300 + * @tc.name HttpResponse::responseCode + * @tc.desc Test Test HttpResponse property. + */ + + it("Telephony_Http_HttpResponse_responseCode_0300", 0, async function (done) { + var casename = 'Telephony_Http_HttpResponse_0200'; + console.log("-----------------------HttpResponse responseCode_02 Test is starting-----------------------"); + try { + let httpRequestOptions = { + method: 'GET', + extraData: null, + header: "content-type': 'application/json", + readTimeout: 60, + connectTimeout: 60 + } + var httpRequest = http.createHttp(); + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + httpRequest.request("https://www.baidu.com/", httpRequestOptions).then(data => { + console.log(casename + JSON.stringify(data)); + expect(data.getResponseCode() != 0).assertTrue(); + console.log("-----------------------HttpResponse responseCode_02 Test end-----------------------"); + done(); + }).catch(error => { + console.info(casename+"errocode" + JSON.stringify(error)); + done(); + }); + } catch (error) { + console.log("Telephony_Http_HttpResponse_responseCode_0300 : error = " + error); + done(); + } + }); + + /** + * @tc.number Telephony_Http_HttpResponse_header_0100 + * @tc.name HttpResponse::header + * @tc.desc Test Test HttpResponse property. + */ + + it("Telephony_Http_HttpResponse_header_0100", 0, async function (done) { + var casename = 'Telephony_Http_HttpResponse_0300'; + console.log("-----------------------HttpResponse header Test is starting-----------------------"); + try { + let httpRequestOptions = { + method: 'GET', + extraData: null, + header: "content-type': 'application/json", + readTimeout: 60, + connectTimeout: 60 + } + var httpRequest = http.createHttp(); + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + httpRequest.request("https://www.baidu.com/", httpRequestOptions, (err, data) => { + console.log(casename + JSON.stringify(err) + " data: " + JSON.stringify(data)); + expect(data.getHead() != null).assertTrue(); + console.log("-----------------------header result Test end-----------------------"); + done(); + }); + } catch (error) { + console.log("Telephony_Http_HttpResponse_header_0100 : error = " + error); + done(); + } + }); + + + /** + * @tc.number Telephony_Http_HttpResponse_header_0200 + * @tc.name HttpResponse::header + * @tc.desc Test Test HttpResponse property. + */ + + it("Telephony_Http_HttpResponse_header_0200", 0, async function (done) { + var casename = 'Telephony_Http_HttpResponse_0300'; + console.log("-----------------------HttpResponse header_01 Test is starting-----------------------"); + try { + var httpRequest = http.createHttp(); + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + httpRequest.request("https://www.baidu.com/", (err, data) => { + console.log(casename + JSON.stringify(err) + " data: " + JSON.stringify(data)); + expect(data.getHead() != null).assertTrue(); + console.log("-----------------------header header_01 Test end-----------------------"); + done(); + }); + } catch (error) { + console.log("Telephony_Http_HttpResponse_header_0200 : error = " + error); + done(); + } + }); + + + + /** + * @tc.number Telephony_Http_HttpResponse_header_0300 + * @tc.name HttpResponse::header + * @tc.desc Test Test HttpResponse property. + */ + + it("Telephony_Http_HttpResponse_header_0300", 0, async function (done) { + var casename = 'Telephony_Http_HttpResponse_0300'; + console.log("-----------------------HttpResponse header_02 Test is starting-----------------------"); + try { + let httpRequestOptions = { + method: 'GET', + extraData: null, + header: "content-type': 'application/json", + readTimeout: 60, + connectTimeout: 60 + } + var httpRequest = http.createHttp(); + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + httpRequest.request("https://www.baidu.com/", httpRequestOptions).then(data => { + console.log(casename + JSON.stringify(data)); + expect(data.getHead() != null).assertTrue(); + console.log("-----------------------HttpResponse header_02 Test end-----------------------"); + done(); + }).catch(error => { + console.info(casename+"errocode" + JSON.stringify(error)); + done(); + }); + } catch (error) { + console.log("Telephony_Http_HttpResponse_header_0300 : error = " + error); + done(); + } + }); + + + + + /** + * @tc.number Telephony_Http_HttpResponse_cookies_0100 + * @tc.name HttpResponse::cookies + * @tc.desc Test Test HttpResponse property. + */ + + + it("Telephony_Http_HttpResponse_cookies_0100", 0, async function (done) { + var casename = 'Telephony_Http_HttpResponse_0400'; + console.log("-----------------------HttpResponse cookies Test is starting-----------------------"); + try { + let httpRequestOptions = { + method: 'GET', + extraData: null, + header: "content-type': 'application/json", + readTimeout: 60, + connectTimeout: 60 + } + var httpRequest = http.createHttp(); + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + httpRequest.request("https://www.baidu.com/", httpRequestOptions, (err, data) => { + console.log(casename + JSON.stringify(err) + " data: " + JSON.stringify(data)); + expect(data.getCookies != null).assertTrue(); + console.log("-----------------------HttpResponse cookies Test end-----------------------"); + done(); + }); + } catch (error) { + console.log("Telephony_Http_HttpResponse_cookies_0100 : error = " + error); + done(); + } + }); + + + + /** + * @tc.number Telephony_Http_HttpResponse_cookies_0200 + * @tc.name HttpResponse::cookies + * @tc.desc Test Test HttpResponse property. + */ + + + it("Telephony_Http_HttpResponse_cookies_0200", 0, async function (done) { + var casename = 'Telephony_Http_HttpResponse_0400'; + console.log("-----------------------HttpResponse cookies_01 Test is starting-----------------------"); + try { + var httpRequest = http.createHttp(); + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + httpRequest.request("https://www.baidu.com/", (err, data) => { + console.log(casename + JSON.stringify(err) + " data: " + JSON.stringify(data)); + expect(data.getCookies != null).assertTrue(); + console.log("-----------------------HttpResponse cookies_01 Test end-----------------------"); + done(); + }); + } catch (error) { + console.log("Telephony_Http_HttpResponse_cookies_0200 : error = " + error); + done(); + } + }); + + + + + /** + * @tc.number Telephony_Http_HttpResponse_cookies_0300 + * @tc.name HttpResponse::cookies + * @tc.desc Test Test HttpResponse property. + */ + + + it("Telephony_Http_HttpResponse_cookies_0300", 0, async function (done) { + var casename = 'Telephony_Http_HttpResponse_0400'; + console.log("-----------------------HttpResponse cookies_02 Test is starting-----------------------"); + try { + let httpRequestOptions = { + method: 'GET', + extraData: null, + header: "content-type': 'application/json", + readTimeout: 60, + connectTimeout: 60 + } + var httpRequest = http.createHttp(); + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + httpRequest.request("https://www.baidu.com/", httpRequestOptions).then(data => { + console.log(casename + JSON.stringify(data)); + expect(data.getCookies() != null).assertTrue(); + console.log("-----------------------HttpResponse cookies_02 Test end-----------------------"); + done(); + }).catch(error => { + console.info(casename+"errocode" + JSON.stringify(error)); + done(); + }); + } catch (error) { + console.log("Telephony_Http_HttpResponse_cookies_0300 : error = " + error); + done(); + } + }); + + }) + +}; + diff --git a/telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/test/List.test.ets b/telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/test/List.test.ets new file mode 100644 index 000000000..34a0f9c29 --- /dev/null +++ b/telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/test/List.test.ets @@ -0,0 +1,32 @@ +/** + * 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. + */ + +//other import +import httpJsunit from './HttpJsunit.test.ets' +import responseCodeJsunit from './ResponseCodeJsunit.test.ets'; +import requestMethodJsunit from './RequestMethodJsunit.test.ets'; +import httpResponseJsunit from './HttpResponseJsunit.test.ets'; +import HttpRequestOptionsJsunit from './HttpRequestOptionsJsunit.test.ets'; +import httpRequestJsunit from './HttpRequestJsunit.test.ets'; + +export default function testsuite() { + //other + httpJsunit(); + responseCodeJsunit(); + requestMethodJsunit(); + httpResponseJsunit(); + HttpRequestOptionsJsunit(); + httpRequestJsunit(); +} \ No newline at end of file diff --git a/telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/test/RequestMethodJsunit.test.ets b/telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/test/RequestMethodJsunit.test.ets new file mode 100644 index 000000000..ebf9e7d17 --- /dev/null +++ b/telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/test/RequestMethodJsunit.test.ets @@ -0,0 +1,347 @@ +/* + * 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 {describe, beforeAll, afterAll, it, expect, afterEach} from 'deccjsunit/index.ets'; +import http from '@ohos.net.http'; +import utils from './Utils.ets' + +export default function requestMethodJsunit() { + describe("requestMethodJsunit", function () { + + /** + * @tc.number Telephony_http_HttpRequestMethod_options_0100 + * @tc.name HttpRequestMethod::options + * @tc.desc Test Test HttpRequestMethod property. + */ + + it("Telephony_http_HttpRequestMethod_options_0100", 0, async function (done) { + var casename = 'Telephony_http_HttpRequestMethod_0100'; + console.log("-----------------------HttpRequestMethod_options Test is starting-----------------------"); + try { + let httpRequestOptions = { + method: "OPTIONS", + extraData: null, + header: "content-type': 'application/json", + readTimeout: 60, + connectTimeout: 60 + } + var httpRequest = http.createHttp(); + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + httpRequest.request("https://www.baidu.com/", httpRequestOptions, (err, data) => { + console.log(casename + JSON.stringify(err) + " data: " + JSON.stringify(data)); + expect(data.getResponseCode = 200).assertTrue(); + console.log("-----------------------HttpRequestMethod_options Test end-----------------------"); + done(); + }); + } catch (error) { + console.log("Telephony_Http_HttpRequestMethod_options_0100 : error = " + error); + done(); + } + }); + + + + /** + * @tc.number Telephony_http_HttpRequestMethod_options_0200 + * @tc.name HttpRequestMethod::options + * @tc.desc Test Test HttpRequestMethod property. + */ + + it("Telephony_http_HttpRequestMethod_options_0200", 0, async function (done) { + var casename = 'Telephony_http_HttpRequestMethod_0100'; + console.log("-----------------------HttpRequestMethod_options_01 Test is starting-----------------------"); + try { + let httpRequestOptions = { + method: "OPTIONS", + extraData: null, + header: "content-type': 'application/json", + readTimeout: 60, + connectTimeout: 60 + } + var httpRequest = http.createHttp(); + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + httpRequest.request("https://www.baidu.com/", httpRequestOptions).then(data => { + console.log(casename + JSON.stringify(data)); + expect(data.getResponseCode = 200).assertTrue(); + console.log("-----------------------HttpRequestMethod_options_01 Test end-----------------------"); + done(); + }).catch(error => { + console.info(casename+"errocode" + JSON.stringify(error)); + done(); + }); + } catch (error) { + console.log("Telephony_http_HttpRequestMethod_options_0200 : error = " + error); + done(); + } + }); + + + + /** + * @tc.number Telephony_http_HttpRequestMethod_GET_0100 + * @tc.name HttpRequestMethod::GET + * @tc.desc Test Test HttpRequestMethod property. + */ + + it("Telephony_http_HttpRequestMethod_GET_0100", 0, async function (done) { + var casename = "Telephony_http_HttpRequestMethod_0200" + console.log("-----------------------HttpRequestMethod_GET Test is starting-----------------------"); + try { + let httpRequestOptions = { + method: "GET", + extraData: null, + header: "content-type': 'application/json", + readTimeout: 60, + connectTimeout: 60 + } + var httpRequest = http.createHttp(); + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + httpRequest.request("https://www.baidu.com/", httpRequestOptions, (err, data) => { + console.log(casename + JSON.stringify(err) + " data: " + JSON.stringify(data)); + expect(data.getResponseCode = 200).assertTrue(); + console.log("-----------------------HttpRequestMethod_GET Test end-----------------------"); + done(); + }); + } catch (error) { + console.log("Telephony_Http_HttpRequestMethod_GET_0100 : error = " + error); + done(); + } + }); + + + + /** + * @tc.number Telephony_http_HttpRequestMethod_GET_0200 + * @tc.name HttpRequestMethod::GET + * @tc.desc Test Test HttpRequestMethod property. + */ + + it("Telephony_http_HttpRequestMethod_GET_0200", 0, async function (done) { + var casename = "Telephony_http_HttpRequestMethod_0200" + console.log("-----------------------HttpRequestMethod_GET_01 Test is starting-----------------------"); + try { + let httpRequestOptions = { + method: "GET", + extraData: null, + header: "content-type': 'application/json", + readTimeout: 60, + connectTimeout: 60 + } + var httpRequest = http.createHttp(); + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + httpRequest.request("https://www.baidu.com/", httpRequestOptions).then(data => { + console.log(casename + JSON.stringify(data)); + expect(data.getResponseCode = 200).assertTrue(); + console.log("-----------------------HttpRequestMethod_GET_01 Test end-----------------------"); + done(); + }).catch(error => { + console.info(casename+"errocode" + JSON.stringify(error)); + done(); + }); + } catch (error) { + console.log("Telephony_http_HttpRequestMethod_GET_0200 : error = " + error); + done(); + } + }); + + + + /** + * @tc.number Telephony_http_HttpRequestMethod_POST_0100 + * @tc.name HttpRequestMethod::POST + * @tc.desc Test Test HttpRequestMethod property. + */ + + it("Telephony_http_HttpRequestMethod_POST_0100", 0, async function (done) { + var casename = "Telephony_http_HttpRequestMethod_0300" + console.log("-----------------------HttpRequestMethod_POST Test is starting-----------------------"); + try { + let httpRequestOptions = { + method: "POST", + extraData: { + //tn=albumsdetail&word=渐变风格插画&fr=albumslist&album_tab=设计素材&album_id=409&rn=30 + tn: "albumsdetail", + work: "渐变风格插画", + fr: "albumslist", + album_tab: "设计素材", + album_id: "409", + rn: "30" + }, + header: "content-type': 'application/json", + readTimeout: 60, + connectTimeout: 60 + } + var httpRequest = http.createHttp(); + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + httpRequest.request("https://image.baidu.com/search/albumsdetail/", httpRequestOptions, (err, data) => { + console.log(casename + JSON.stringify(err) + " data: " + JSON.stringify(data)); + expect(data.getResponseCode = 200).assertTrue(); + console.log("-----------------------HttpRequestMethod_POST Test end-----------------------"); + done(); + }); + } catch (error) { + console.log("Telephony_Http_HttpRequestMethod_POST_0100 : error = " + error); + done(); + } + }); + + + + /** + * @tc.number Telephony_http_HttpRequestMethod_POST_0100 + * @tc.name HttpRequestMethod::POST + * @tc.desc Test Test HttpRequestMethod property. + */ + + it("Telephony_http_HttpRequestMethod_POST_0200", 0, async function (done) { + var casename = "Telephony_http_HttpRequestMethod_0300" + console.log("-----------------------HttpRequestMethod_POST_01 Test is starting-----------------------"); + try { + let httpRequestOptions = { + method: "POST", + extraData: { + //tn=albumsdetail&word=渐变风格插画&fr=albumslist&album_tab=设计素材&album_id=409&rn=30 + tn: "albumsdetail", + work: "渐变风格插画", + fr: "albumslist", + album_tab: "设计素材", + album_id: "409", + rn: "30" + }, + header: "content-type': 'application/json", + readTimeout: 60, + connectTimeout: 60 + } + var httpRequest = http.createHttp(); + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + httpRequest.request("https://image.baidu.com/search/albumsdetail/", httpRequestOptions).then(data => { + console.log(casename + JSON.stringify(data)); + expect(data.getResponseCode = 200).assertTrue(); + console.log("-----------------------HttpRequestMethod_POST_01 Test end-----------------------"); + done(); + }).catch(error => { + console.info(casename+"errocode" + JSON.stringify(error)); + done(); + }); + } catch (error) { + console.log("Telephony_http_HttpRequestMethod_POST_0200 : error = " + error); + done(); + } + }); + + + + /** + * @tc.number Telephony_http_HttpRequestMethod_TRACE_0100 + * @tc.name HttpRequestMethod::TRACE + * @tc.desc Test Test HttpRequestMethod property. + */ + + it("Telephony_http_HttpRequestMethod_TRACE_0100", 0, async function (done) { + var casename = "Telephony_http_HttpRequestMethod_0400" + console.log("-----------------------HttpRequestMethod_TRACE Test is starting-----------------------"); + try { + let httpRequestOptions = { + method: "TRACE", + extraData: null, + header: "content-type': 'application/json", + readTimeout: 60, + connectTimeout: 60 + } + var httpRequest = http.createHttp(); + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + httpRequest.request("https://www.baidu.com/", httpRequestOptions, (err, data) => { + console.log(casename + JSON.stringify(err) + " data: " + JSON.stringify(data)); + expect(data.getResponseCode = 200).assertTrue(); + console.log("-----------------------HttpRequestMethod_TRACE Test end-----------------------"); + done(); + }); + } catch (error) { + console.log("Telephony_Http_HttpRequestMethod_TRACE_0100 : error = " + error); + done(); + } + }); + + + /** + * @tc.number Telephony_http_HttpRequestMethod_TRACE_0200 + * @tc.name HttpRequestMethod::TRACE + * @tc.desc Test Test HttpRequestMethod property. + */ + + it("Telephony_http_HttpRequestMethod_TRACE_0200", 0, async function (done) { + var casename = "Telephony_http_HttpRequestMethod_0400" + console.log("-----------------------HttpRequestMethod_TRACE_01 Test is starting-----------------------"); + try { + let httpRequestOptions = { + method: "TRACE", + extraData: null, + header: "content-type': 'application/json", + readTimeout: 60, + connectTimeout: 60 + } + var httpRequest = http.createHttp(); + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + httpRequest.request("https://www.baidu.com/", httpRequestOptions).then(data => { + console.log(casename + JSON.stringify(data)); + expect(data.getResponseCode = 200).assertTrue(); + console.log("-----------------------HttpRequestMethod_TRACE_01 Test end-----------------------"); + done(); + }).catch(error => { + console.info(casename+"errocode" + JSON.stringify(error)); + done(); + }); + } catch (error) { + console.log("Telephony_http_HttpRequestMethod_TRACE_0200 : error = " + error); + done(); + } + }); + + + }) + +}; + diff --git a/telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/test/ResponseCodeJsunit.test.ets b/telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/test/ResponseCodeJsunit.test.ets new file mode 100644 index 000000000..3f36dea14 --- /dev/null +++ b/telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/test/ResponseCodeJsunit.test.ets @@ -0,0 +1,456 @@ +/* + * 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 {describe, beforeAll, afterAll, it, expect, afterEach} from 'deccjsunit/index.ets'; +import http from '@ohos.net.http'; + +export default function responseCodeJsunit() { + describe("responseCodeJsunitTest", function () { + + /** + * @tc.number Telephony_Http_ResponseCode_ACCEPTED_0100 + * @tc.name ResponseCode::ACCEPTED + * @tc.desc Test Test ResponseCode property. + */ + + it("Telephony_Http_ResponseCode_ACCEPTED_0100", 0, async function (done) { + console.log("-----------------------ResponseCode_ACCEPTED Test is starting-----------------------"); + try { + expect(202).assertEqual(http.ResponseCode.ACCEPTED); + console.log("-----------------------ResponseCode ACCEPTED Test end-----------------------"); + done(); + } catch (error) { + console.log("Telephony_Http_ResponseCode_ACCEPTED_0100 : error = " + error); + done(); + } + }); + + /** + * @tc.number Telephony_Http_ResponseCode_NOT_AUTHORITATIVE_0100 + * @tc.name ResponseCode::NOT_AUTHORITATIVE + * @tc.desc Test Test ResponseCode property. + */ + + it("Telephony_Http_ResponseCode_NOT_AUTHORITATIVE_0100", 0, async function (done) { + console.log("-----------------------ResponseCode NOT_AUTHORITATIVE Test is starting-----------------------"); + try { + expect(203).assertEqual(http.ResponseCode.NOT_AUTHORITATIVE); + console.log("-----------------------ResponseCode NOT_AUTHORITATIVE Test end-----------------------"); + done(); + } catch (error) { + console.log("Telephony_Http_ResponseCode_NOT_AUTHORITATIVE_0100 : error = " + error); + done(); + } + }); + + /** + * @tc.number Telephony_Http_ResponseCode_NO_CONTENT_0100 + * @tc.name ResponseCode::NO_CONTENT + * @tc.desc Test Test ResponseCode property. + */ + + it("Telephony_Http_ResponseCode_NO_CONTENT_0100", 0, async function (done) { + console.log("-----------------------ResponseCode NO_CONTENT Test is starting-----------------------"); + try { + expect(204).assertEqual(http.ResponseCode.NO_CONTENT); + console.log("-----------------------ResponseCode NO_CONTENT Test end-----------------------"); + done(); + } catch (error) { + console.log("Telephony_Http_ResponseCode_NO_CONTENT_0100 : error = " + error); + done(); + } + }); + + /** + * @tc.number Telephony_Http_ResponseCode_MULT_CHOICE_0100 + * @tc.name ResponseCode::MULT_CHOICE + * @tc.desc Test Test ResponseCode property. + */ + it("Telephony_Http_ResponseCode_MULT_CHOICE_0100", 0, async function (done) { + console.log("-----------------------ResponseCode MULT_CHOICE Test is starting-----------------------"); + try { + expect(300).assertEqual(http.ResponseCode.MULT_CHOICE); + console.log("-----------------------ResponseCode MULT_CHOICE Test end-----------------------"); + done(); + } catch (error) { + console.log("Telephony_Http_ResponseCode_MULT_CHOICE_0100 : error = " + error); + done(); + } + }); + + /** + * @tc.number Telephony_Http_ResponseCode_MOVED_PERM_0100 + * @tc.name ResponseCode::MOVED_PERM + * @tc.desc Test Test ResponseCode property. + */ + + it("Telephony_Http_ResponseCode_MOVED_PERM_0100", 0, async function (done) { + console.log("-----------------------ResponseCode MOVED_PERM Test is starting-----------------------"); + try { + expect(301).assertEqual(http.ResponseCode.MOVED_PERM); + console.log("-----------------------ResponseCode MOVED_PERM Test end-----------------------"); + done(); + } catch (error) { + console.log("Telephony_Http_ResponseCode_MOVED_PERM_0100 : error = " + error); + done(); + } + }); + + /** + * @tc.number Telephony_Http_ResponseCode_SEE_OTHER_0100 + * @tc.name ResponseCode::SEE_OTHER + * @tc.desc Test Test ResponseCode property. + */ + + it("Telephony_Http_ResponseCode_SEE_OTHER_0100", 0, async function (done) { + console.log("-----------------------ResponseCode SEE_OTHER Test is starting-----------------------"); + try { + expect(303).assertEqual(http.ResponseCode.SEE_OTHER); + console.log("-----------------------ResponseCode SEE_OTHER Test end-----------------------"); + done(); + } catch (error) { + console.log("Telephony_Http_ResponseCode_SEE_OTHER_0100 : error = " + error); + done(); + } + }); + + /** + * @tc.number Telephony_Http_ResponseCode_NOT_MODIFIED_0100 + * @tc.name ResponseCode::NOT_MODIFIED + * @tc.desc Test Test ResponseCode property. + */ + + it("Telephony_Http_ResponseCode_NOT_MODIFIED_0100", 0, async function (done) { + console.log("-----------------------ResponseCode NOT_MODIFIED Test is starting-----------------------"); + try { + expect(304).assertEqual(http.ResponseCode.NOT_MODIFIED); + console.log("-----------------------ResponseCode NOT_MODIFIED Test end-----------------------"); + done(); + } catch (error) { + console.log("Telephony_Http_ResponseCode_NOT_MODIFIED_0100 : error = " + error); + done(); + } + }); + + /** + * @tc.number Telephony_Http_ResponseCode_USE_PROXY_0100 + * @tc.name ResponseCode::USE_PROXY + * @tc.desc Test Test ResponseCode property. + */ + it("Telephony_Http_ResponseCode_USE_PROXY_0100", 0, async function (done) { + console.log("-----------------------ResponseCode USE_PROXY Test is starting-----------------------"); + try { + expect(305).assertEqual(http.ResponseCode.USE_PROXY); + console.log("-----------------------ResponseCode USE_PROXY Test end-----------------------"); + done(); + } catch (error) { + console.log("Telephony_Http_ResponseCode_USE_PROXY_0100 : error = " + error); + done(); + } + }); + + /** + * @tc.number Telephony_Http_ResponseCode_BAD_REQUEST_0100 + * @tc.name ResponseCode::BAD_REQUEST + * @tc.desc Test Test ResponseCode property. + */ + + it("Telephony_Http_ResponseCode_BAD_REQUEST_0100", 0, async function (done) { + console.log("-----------------------ResponseCode BAD_REQUEST Test is starting-----------------------"); + try { + expect(400).assertEqual(http.ResponseCode.BAD_REQUEST); + console.log("-----------------------ResponseCode BAD_REQUEST Test end-----------------------"); + done(); + } catch (error) { + console.log("Telephony_Http_ResponseCode_BAD_REQUEST_0100 : error = " + error); + done(); + } + }); + + /** + * @tc.number Telephony_Http_ResponseCode_UNAUTHORIZED_0100 + * @tc.name ResponseCode::ResponseCode_UNAUTHORIZED + * @tc.desc Test Test ResponseCode property. + */ + + it("Telephony_Http_ResponseCode_UNAUTHORIZED_0100", 0, async function (done) { + console.log("-----------------------ResponseCode UNAUTHORIZED Test is starting-----------------------"); + try { + expect(401).assertEqual(http.ResponseCode.UNAUTHORIZED); + console.log("-----------------------ResponseCode UNAUTHORIZED Test end-----------------------"); + done(); + } catch (error) { + console.log("Telephony_Http_ResponseCode_UNAUTHORIZED_0100 : error = " + error); + done(); + } + }); + + /** + * @tc.number Telephony_Http_ResponseCode_PAYMENT_REQUIRED_0100 + * @tc.name ResponseCode::PAYMENT_REQUIRED + * @tc.desc Test Test ResponseCode property. + */ + + it("Telephony_Http_ResponseCode_PAYMENT_REQUIRED_0100", 0, async function (done) { + console.log("-----------------------ResponseCode PAYMENT_REQUIRED Test is starting-----------------------"); + try { + expect(402).assertEqual(http.ResponseCode.PAYMENT_REQUIRED); + console.log("-----------------------ResponseCode PAYMENT_REQUIRED Test end-----------------------"); + done(); + } catch (error) { + console.log("Telephony_Http_ResponseCode_PAYMENT_REQUIRED_0100 : error = " + error); + done(); + } + }); + + /** + * @tc.number Telephony_Http_ResponseCode_BAD_METHOD_0100 + * @tc.name ResponseCode::BAD_METHOD + * @tc.desc Test Test ResponseCode property. + */ + + it("Telephony_Http_ResponseCode_BAD_METHOD_0100", 0, async function (done) { + console.log("-----------------------ResponseCode BAD_METHOD Test is starting-----------------------"); + try { + expect(405).assertEqual(http.ResponseCode.BAD_METHOD); + console.log("-----------------------ResponseCode BAD_METHOD Test end-----------------------"); + done(); + } catch (error) { + console.log("Telephony_Http_ResponseCode_BAD_METHOD_0100 : error = " + error); + done(); + } + }); + + /** + * @tc.number Telephony_Http_ResponseCode_NOT_ACCEPTABLE_0100 + * @tc.name ResponseCode::NOT_ACCEPTABLE + * @tc.desc Test Test ResponseCode property. + */ + + it("Telephony_Http_ResponseCode_NOT_ACCEPTABLE_0100", 0, async function (done) { + console.log("-----------------------ResponseCode NOT_ACCEPTABLE Test is starting-----------------------"); + try { + expect(406).assertEqual(http.ResponseCode.NOT_ACCEPTABLE); + console.log("-----------------------ResponseCode NOT_ACCEPTABLE Test end-----------------------"); + done(); + } catch (error) { + console.log("Telephony_Http_ResponseCode_NOT_ACCEPTABLED_0100 : error = " + error); + done(); + } + }); + + /** + * @tc.number Telephony_Http_ResponseCode_PROXY_AUTH_0100 + * @tc.name ResponseCode::PROXY_AUTH + * @tc.desc Test Test ResponseCode property. + */ + + it("Telephony_Http_ResponseCode_PROXY_AUTH_0100", 0, async function (done) { + console.log("-----------------------ResponseCode PROXY_AUTH Test is starting-----------------------"); + try { + expect(407).assertEqual(http.ResponseCode.PROXY_AUTH); + console.log("-----------------------ResponseCode PROXY_AUTH Test end-----------------------"); + done(); + } catch (error) { + console.log("Telephony_Http_ResponseCode_PROXY_AUTH_0100 : error = " + error); + done(); + } + }); + + /** + * @tc.number Telephony_Http_ResponseCode_CLIENT_TIMEOUT_0100 + * @tc.name ResponseCode::CLIENT_TIMEOUT + * @tc.desc Test Test ResponseCode property. + */ + + it("Telephony_Http_ResponseCode_CLIENT_TIMEOUT_0100", 0, async function (done) { + console.log("-----------------------ResponseCode CLIENT_TIMEOUT Test is starting-----------------------"); + try { + expect(408).assertEqual(http.ResponseCode.CLIENT_TIMEOUT); + console.log("-----------------------ResponseCode CLIENT_TIMEOUT Test end-----------------------"); + done(); + } catch (error) { + console.log("Telephony_Http_ResponseCode_CLIENT_TIMEOUT_0100 : error = " + error); + done(); + } + }); + + /** + * @tc.number Telephony_Http_ResponseCode_LENGTH_REQUIRED_0100 + * @tc.name ResponseCode::LENGTH_REQUIRED + * @tc.desc Test Test ResponseCode property. + */ + + it("Telephony_Http_ResponseCode_LENGTH_REQUIRED_0100", 0, async function (done) { + console.log("-----------------------ResponseCode LENGTH_REQUIRED Test is starting-----------------------"); + try { + expect(411).assertEqual(http.ResponseCode.LENGTH_REQUIRED); + console.log("-----------------------ResponseCode LENGTH_REQUIRED Test end-----------------------"); + done(); + } catch (error) { + console.log("Telephony_Http_ResponseCode_LENGTH_REQUIRED_0100 : error = " + error); + done(); + } + }); + + /** + * @tc.number Telephony_Http_ResponseCode_PRECON_FAILED_0100 + * @tc.name ResponseCode::PRECON_FAILED + * @tc.desc Test Test ResponseCode property. + */ + + it("Telephony_Http_ResponseCode_PRECON_FAILED_0100", 0, async function (done) { + console.log("-----------------------ResponseCode PRECON_FAILED Test is starting-----------------------"); + try { + expect(412).assertEqual(http.ResponseCode.PRECON_FAILED); + console.log("-----------------------ResponseCode PRECON_FAILED Test end-----------------------"); + done(); + } catch (error) { + console.log("Telephony_Http_ResponseCode_PRECON_FAILED_0100 : error = " + error); + done(); + } + }); + + /** + * @tc.number Telephony_Http_ResponseCode_ENTITY_TOO_LARGE_0100 + * @tc.name ResponseCode::ENTITY_TOO_LARGE + * @tc.desc Test Test ResponseCode property. + */ + + it("Telephony_Http_ResponseCode_ENTITY_TOO_LARGE_0100", 0, async function (done) { + console.log("-----------------------ResponseCode ENTITY_TOO_LARGE Test is starting-----------------------"); + try { + expect(413).assertEqual(http.ResponseCode.ENTITY_TOO_LARGE); + console.log("-----------------------ResponseCode ENTITY_TOO_LARGE Test end-----------------------"); + done(); + } catch (error) { + console.log("Telephony_Http_ResponseCode_ENTITY_TOO_LARGE_0100 : error = " + error); + done(); + } + }); + + /** + * @tc.number Telephony_Http_ResponseCode_REQ_TOO_LONG_0100 + * @tc.name ResponseCode::REQ_TOO_LONG + * @tc.desc Test Test ResponseCode property. + */ + + + it("Telephony_Http_ResponseCode_REQ_TOO_LONG_0100", 0, async function (done) { + console.log("-----------------------ResponseCode REQ_TOO_LONG Test is starting-----------------------"); + try { + expect(414).assertEqual(http.ResponseCode.REQ_TOO_LONG); + console.log("-----------------------ResponseCode REQ_TOO_LONG Test end-----------------------"); + done(); + } catch (error) { + console.log("Telephony_Http_ResponseCode_REQ_TOO_LONG_0100 : error = " + error); + done(); + } + }); + + /** + * @tc.number Telephony_Http_ResponseCode_UNSUPPORTED_TYPE_0100 + * @tc.name ResponseCode::UNSUPPORTED_TYPE + * @tc.desc Test Test ResponseCode property. + */ + + + it("Telephony_Http_ResponseCode_UNSUPPORTED_TYPE_0100", 0, async function (done) { + console.log("-----------------------ResponseCode UNSUPPORTED_TYPE Test is starting-----------------------"); + try { + expect(415).assertEqual(http.ResponseCode.UNSUPPORTED_TYPE); + console.log("-----------------------ResponseCode UNSUPPORTED_TYPE Test end-----------------------"); + done(); + } catch (error) { + console.log("Telephony_Http_ResponseCode_UNSUPPORTED_TYPE_0100 : error = " + error); + done(); + } + }); + + /** + * @tc.number Telephony_Http_ResponseCode_INTERNAL_ERROR_0100 + * @tc.name ResponseCode::INTERNAL_ERROR + * @tc.desc Test Test ResponseCode property. + */ + it("Telephony_Http_ResponseCode_INTERNAL_ERROR_0100", 0, async function (done) { + console.log("-----------------------ResponseCode INTERNAL_ERROR Test is starting-----------------------"); + try { + expect(500).assertEqual(http.ResponseCode.INTERNAL_ERROR); + console.log("-----------------------ResponseCode INTERNAL_ERROR Test end-----------------------"); + done(); + } catch (error) { + console.log("Telephony_Http_ResponseCode_INTERNAL_ERROR_0100 : error = " + error); + done(); + } + }); + + /** + * @tc.number Telephony_Http_ResponseCode_NOT_IMPLEMENTED_0100 + * @tc.name ResponseCode::NOT_IMPLEMENTED + * @tc.desc Test Test ResponseCode property. + */ + + it("Telephony_Http_ResponseCode_NOT_IMPLEMENTED_0100", 0, async function (done) { + console.log("-----------------------ResponseCode NOT_IMPLEMENTED Test is starting-----------------------"); + try { + expect(501).assertEqual(http.ResponseCode.NOT_IMPLEMENTED); + console.log("-----------------------ResponseCode NOT_IMPLEMENTED Test end-----------------------"); + done(); + } catch (error) { + console.log("Telephony_Http_ResponseCode_NOT_IMPLEMENTED_0100 : error = " + error); + done(); + } + }); + + /** + * @tc.number Telephony_Http_ResponseCode_BAD_GATEWAY_0100 + * @tc.name ResponseCode::BAD_GATEWAY + * @tc.desc Test Test ResponseCode property. + */ + + it("Telephony_Http_ResponseCode_BAD_GATEWAY_0100", 0, async function (done) { + console.log("-----------------------ResponseCode BAD_GATEWAY Test is starting-----------------------"); + try { + expect(502).assertEqual(http.ResponseCode.BAD_GATEWAY); + console.log("-----------------------ResponseCode BAD_GATEWAY Test end-----------------------"); + done(); + } catch (error) { + console.log("Telephony_Http_ResponseCode_BAD_GATEWAY_0100 : error = " + error); + done(); + } + }); + + /** + * @tc.number Telephony_Http_ResponseCode_GATEWAY_TIMEOUT_0100 + * @tc.name ResponseCode::GATEWAY_TIMEOUT + * @tc.desc Test Test ResponseCode property. + */ + + it("Telephony_Http_ResponseCode_GATEWAY_TIMEOUT_0100", 0, async function (done) { + console.log("-----------------------ResponseCode GATEWAY_TIMEOUT Test is starting-----------------------"); + try { + expect(504).assertEqual(http.ResponseCode.GATEWAY_TIMEOUT); + console.log("-----------------------ResponseCode GATEWAY_TIMEOUT Test end-----------------------"); + done(); + } catch (error) { + console.log("Telephony_Http_ResponseCode_GATEWAY_TIMEOUT_0100 : error = " + error); + done(); + } + }); + + + }) + +}; + diff --git a/telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/test/Utils.ets b/telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/test/Utils.ets new file mode 100644 index 000000000..65f70088d --- /dev/null +++ b/telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/test/Utils.ets @@ -0,0 +1,119 @@ +// @ts-nocheck +/** + * 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 class Utils { + static rect_left; + static rect_top; + static rect_right; + static rect_bottom; + static rect_value; + static notCheck = true; + + static sleep(time) { + return new Promise((resolve, reject) => { + setTimeout(() => { + resolve() + }, time) + }).then(() => { + console.info(`sleep ${time} over...`) + }) + } + + static getComponentRect(key) { + let strJson = getInspectorByKey(key); + let obj = JSON.parse(strJson); + console.info("[getInspectorByKey] current component obj is: " + JSON.stringify(obj)); + let rectInfo = JSON.parse('[' + obj.$rect + ']') + console.info("[getInspectorByKey] rectInfo is: " + rectInfo); + this.rect_left = JSON.parse('[' + rectInfo[0] + ']')[0] + this.rect_top = JSON.parse('[' + rectInfo[0] + ']')[1] + this.rect_right = JSON.parse('[' + rectInfo[1] + ']')[0] + this.rect_bottom = JSON.parse('[' + rectInfo[1] + ']')[1] + return this.rect_value = { + "left": this.rect_left, "top": this.rect_top, "right": this.rect_right, "bottom": this.rect_bottom + } + } + + static async swipe(downX, downY, upX, upY, steps) { + console.info('start to swipe') + this.drags(downX, downY, upX, upY, steps, false) + } + + static async drag(downX, downY, upX, upY, steps) { + console.info('start to drag') + this.drags(downX, downY, upX, upY, steps, true) + } + + static async drags(downX, downY, upX, upY, steps, drag) { + var xStep; + var yStep; + var swipeSteps; + var ret; + xStep = 0; + yStep = 0; + ret = false; + swipeSteps = steps; + if (swipeSteps == 0) { + swipeSteps = 1; + } + xStep = (upX - downX) / swipeSteps; + yStep = (upY - downY) / swipeSteps; + console.info('move step is: ' + 'xStep: ' + xStep + ' yStep: ' + yStep) + var downPonit: TouchObject = { + id: 1, + x: downX, + y: downY, + type: TouchType.Down, + } + console.info('down touch started: ' + JSON.stringify(downPonit)) + sendTouchEvent(downPonit); + console.info('start to move') + if (drag) { + await this.sleep(500) + } + for (var i = 1;i <= swipeSteps; i++) { + var movePoint: TouchObject = { + id: 1, + x: downX + (xStep * i), + y: downY + (yStep * i), + type: TouchType.Move + } + console.info('move touch started: ' + JSON.stringify(movePoint)) + ret = sendTouchEvent(movePoint) + if (ret == false) { + break; + } + await this.sleep(5) + } + console.info('start to up') + if (drag) { + await this.sleep(100) + } + var upPoint: TouchObject = { + id: 1, + x: upX, + y: upY, + type: TouchType.Up, + } + console.info('up touch started: ' + JSON.stringify(upPoint)) + sendTouchEvent(upPoint) + await this.sleep(500) + } +} + + + + diff --git a/telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/test/lib/Const.js b/telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/test/lib/Const.js new file mode 100644 index 000000000..f9263cd46 --- /dev/null +++ b/telephony/telephonyjstest/netmanager_http/entry/src/main/ets/MainAbility/test/lib/Const.js @@ -0,0 +1,36 @@ +/** + * 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. + */ + +// sim slot id +export const DEFAULT_SLOTID = 0; +export const SLOTID3 = 3; +export const SLOTID2 = 2; +export const SLOTID_MINUS1 = -1; + +// sim correct password +export const CORRECT_PIN = '1234'; +export const CORRECT_PIN2 = '18099014'; + +// sim incorrect password +export const INCORRECT_PIN = '134679'; +export const INCORRECT_PIN_LEN3 = '123'; +export const INCORRECT_PUK = '134679'; +export const INCORRECT_PIN2 = '134679'; +export const INCORRECT_PIN2_LEN3 = '123'; +export const INCORRECT_PIN2_LEN9 = '123456789'; +export const INCORRECT_PUK2 = '134679'; + +// lock status response +export const LOCK_RESULT = { SUCCESS: 0, FAILURE: -1, EXCEPTION: -2 }; \ No newline at end of file diff --git a/telephony/telephonyjstest/netmanager_http/entry/src/main/resources/base/element/string.json b/telephony/telephonyjstest/netmanager_http/entry/src/main/resources/base/element/string.json new file mode 100644 index 000000000..03b8532c5 --- /dev/null +++ b/telephony/telephonyjstest/netmanager_http/entry/src/main/resources/base/element/string.json @@ -0,0 +1,12 @@ +{ + "string": [ + { + "name": "entry_MainAbility", + "value": "entry_MainAbility" + }, + { + "name": "description_mainability", + "value": "ETS_Empty Ability" + } + ] +} \ No newline at end of file diff --git a/telephony/telephonyjstest/netmanager_http/entry/src/main/resources/base/media/icon.png b/telephony/telephonyjstest/netmanager_http/entry/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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BUUcL1NbwI<93~JLelR!T{8ny!2;GlTZ0>^ml(^+R|_~_~ni`Q?nE>&S;CQV>t6lK;O%Wu7Z9iVioo2e;2N-6Q>12y&KznfGiYm5kKXj%s&4C#DoOaz{#a9g>V#}`+uu3TK`_GLGEAH6-}!7+gP8V$ z7a!V3qrpV33gMMuno|cXUM@6Qcx-aT?t@4ED0$2S@#?)rC7Fh3j(i;L&54!|0FMe3x*bXtFnlJzLL3aH zpi;lr6%&X;C%SVM=P%MJ6(}KH>m0w_WKuWy{X2p4!2Pqrwm;>=<2o}Dhu*bisL!?5 z)6?@AU&4YWUN)^*jr!Ozt&JdTDOw)?fw~F17S(d{|7GG(G(KeJZ0N2`FVv?5 NG*q?mAC)bG{|A+36q*14 literal 0 HcmV?d00001 diff --git a/telephony/telephonyjstest/netmanager_http/entry/src/main/resources/rawfile/star-1-2.png b/telephony/telephonyjstest/netmanager_http/entry/src/main/resources/rawfile/star-1-2.png new file mode 100644 index 0000000000000000000000000000000000000000..450c3dd3ca68bf601bd08e5f41797d376e20d00d GIT binary patch literal 8295 zcma)iby!qi)GiDI3@ITfJq#cs(xo6VIK9g0Is58cut9YYAhAky89NJ&c$4N6Nm zw8Wj?_uaqmbN@K!?C070th3LGz1Mo*9j&FIL_x|(iid|s0au1;Ejqu(x%6MX}UcP^pVq^MKx?9Z3<6HZSZ(YTWwl+ z4})r2h&L?_5Z3xL9JTpl$1We;HwOfV*U2Dd;4VathABE2mL~&90=s!A z17A=j029Bxgn&sP{lPFWGr*0ABr?l!nhT^H>H*JtEAfpTOhQ8`F<+vJ8@ZDt_v2l} zOF0@&=65xE>0mI)Bv(k<5_x1Wr}DE!>r#HG91U6(z}Lz^i4RY3X&Tfw3&nM%1C5a) z%(ySExg?jj0C8QEq$g*CpQ*Xk7yhNiNn@bzJnMOrz${d^ZW9+zK}FP6Wt)@*prd*F z(rz`Qjq{pA&L7Hx1K?P`{_=|>e3O_&^n>(;eRI>{gq^xXjKN& z@MCLic)gQH^`1Je&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_%rB=a%o>I z!2c6lHyKQN)VjiFwa!eE^p8jc$sy$vB+8i25lI~6KPFFh$!o$avA~rj#L6xvR|Z83 z*WD6T9e+5Pyy=F+)pNTf{ny3cy>7Rkd3o*TS?TZJ`NS^NF2%HMkyS{?uJ$`!P4_L^ z1`NFDUbNyg_qREifgktnp1_v{Jbb`7m}2PTyUdOmtJj~m z9bB=ecw4_^rw1IW=of+>nrW5=d3k`3qHCxsIN_F{T1A545};;+fsyC&qChi+YV zr~M63H8ZLCPYmsjY>ls9cL%I)F|JIW-#+48$+lD4k*(P*kDM%zx_fvu4u5ZYUnI}5 zdrycFq>xFU)&X3p@pP2u%$o}}YcRn(MhJ&B2o?KS@cIVz>Ye%o^xV?CB{_Qhu z;}_q1bvO^g{8<3!gYbo4Di{8qzV+(9 zdlmksohQmRTs@qB;(Wo?dER_ux6XQb@q$tQPW?CMu6GVQd;R=iR;-S{Kr%Zks7>b1 zNs{|-+jhObYE}NR&`TGGr^h^4bjh%c>R#@=8nM&Md>_a+zVulsl;){flFekV1t9ob z+SqfV_Pv3$2f)bQ8%Ul2>fdYR^1zs0BQF~olsOj5AodC&Q_7SMFzsz2 z9newxE&jodk~tNHwl%LBMMDbrk=(^b literal 0 HcmV?d00001 diff --git a/telephony/telephonyjstest/netmanager_socket/BUILD.gn b/telephony/telephonyjstest/netmanager_socket/BUILD.gn new file mode 100644 index 000000000..60f5120fd --- /dev/null +++ b/telephony/telephonyjstest/netmanager_socket/BUILD.gn @@ -0,0 +1,32 @@ +# 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("ActsNetManagerSocketEtsTest") { + hap_profile = "./entry/src/main/config.json" + deps = [ + ":ace_demo_ets_assets", + ":ace_demo_ets_resources", + ] + ets2abc = true + certificate_profile = "./signature/openharmony_sx.p7b" + hap_name = "ActsNetManagerSocketEtsTest" +} +ohos_js_assets("ace_demo_ets_assets") { + source_dir = "./entry/src/main/ets/MainAbility" +} +ohos_resources("ace_demo_ets_resources") { + sources = [ "./entry/src/main/resources" ] + hap_profile = "./entry/src/main/config.json" +} diff --git a/telephony/telephonyjstest/netmanager_socket/Test.json b/telephony/telephonyjstest/netmanager_socket/Test.json new file mode 100644 index 000000000..4131329b2 --- /dev/null +++ b/telephony/telephonyjstest/netmanager_socket/Test.json @@ -0,0 +1,18 @@ +{ + "description": "Configuration for hjunit demo Tests", + "driver": { + "type": "JSUnitTest", + "test-timeout": "1800000", + "package": "com.ohos.netmanagersocket", + "shell-timeout": "60000" + }, + "kits": [ + { + "test-file-name": [ + "ActsNetManagerSocketEtsTest.hap" + ], + "type": "AppInstallKit", + "cleanup-apps": true + } + ] +} diff --git a/telephony/telephonyjstest/netmanager_socket/entry/src/main/config.json b/telephony/telephonyjstest/netmanager_socket/entry/src/main/config.json new file mode 100644 index 000000000..e881b685b --- /dev/null +++ b/telephony/telephonyjstest/netmanager_socket/entry/src/main/config.json @@ -0,0 +1,93 @@ +{ + "app": { + "bundleName": "com.ohos.netmanagersocket", + "vendor": "open", + "version": { + "code": 1000000, + "name": "1.0.0" + }, + "apiVersion": { + "compatible": 7, + "releaseType": "Release", + "target": 7 + } + }, + "deviceConfig": {}, + "module": { + "package": "com.ohos.netmanagersocket", + "name": ".MyApplication", + "mainAbility": ".MainAbility", + "srcPath": "MainAbility", + "deviceType": [ + "phone" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "entry", + "moduleType": "entry", + "installationFree": false + }, + "abilities": [ + { + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ], + "orientation": "unspecified", + "visible": true, + "srcPath": "MainAbility", + "name": ".MainAbility", + "srcLanguage": "ets", + "icon": "$media:icon", + "description": "$string:description_mainability", + "formsEnabled": false, + "label": "$string:entry_MainAbility", + "type": "page", + "launchType": "standard" + } + ], + "js": [ + { + "mode": { + "syntax": "ets", + "type": "pageAbility" + }, + "pages": [ + "pages/index", + "pages/Button", + "pages/Blank", + "pages/DataPanel", + "pages/Divider", + "pages/Text", + "pages/RowSplit", + "pages/Scroll", + "pages/Stack", + "pages/Image", + "pages/Progress", + "pages/Qrcode", + "pages/Rating", + "pages/Span", + "pages/Slider", + "pages/Badge", + "pages/Column", + "pages/ColumnSplit", + "pages/Counter", + "pages/Flex", + "pages/GridContainer" + + ], + "name": ".MainAbility", + "window": { + "designWidth": 720, + "autoDesignWidth": false + } + } + ] + } +} \ No newline at end of file diff --git a/telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/MainAbility/app.ets b/telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/MainAbility/app.ets new file mode 100644 index 000000000..261fadca2 --- /dev/null +++ b/telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/MainAbility/app.ets @@ -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('Application onCreate') + }, + onDestroy() { + console.info('Application onDestroy') + }, +} \ No newline at end of file diff --git a/telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/MainAbility/pages/Badge.ets b/telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/MainAbility/pages/Badge.ets new file mode 100644 index 000000000..66de6f8e3 --- /dev/null +++ b/telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/MainAbility/pages/Badge.ets @@ -0,0 +1,95 @@ +/* + * 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. + */ + +@Entry +@Component +struct badge { + @State counts: number = 33 + @State message: string = 'new' + @State active: boolean = false + private content: string = "badge Page"; + + onPageShow() { + console.info('badge page show called'); + } + + onBuildDone() { + console.info('badge page build done called'); + } + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Scroll() { + Column() { + Text(`${this.content}`) + .fontSize(50) + .fontWeight(FontWeight.Bold) + Badge({ + count: this.counts, + position: BadgePosition.Right, + maxCount: 99, + style: { color: 0xFFFFFF, fontSize: 16, badgeSize: 20, badgeColor: Color.Red } + }) { + Button('message') + .onClick(() => { + this.counts++ + }) + .width(100).height(50).backgroundColor(0x317aff) + } + .width(100) + .height(50) + .key('badge') + + Text("BadgePosition.RightTop").fontSize(16) + Badge({ + count: this.counts, + position: BadgePosition.RightTop, + maxCount: 99, + style: { color: 0xFFFFFF, fontSize: '16', badgeSize: '20', badgeColor: Color.Red } + }) { + Button('message') + .onClick(() => { + this.counts++ + }) + .width(100).height(50).backgroundColor(0x317aff) + } + .width(100) + .height(50) + .key('badge1') + + Text("BadgePosition.Left").fontSize(16) + Badge({ + count: this.counts, + position: BadgePosition.Left, + maxCount: 99, + style: { color: Color.Pink, fontSize: 16, badgeSize: 20, badgeColor: Color.Red } + }) { + Button('message') + .onClick(() => { + this.counts++ + }) + .width(100).height(50).backgroundColor(0x317aff) + } + .width(100) + .height(50) + .key('badge2') + } + } + } + .key('flex') + .width('100%') + .height('100%') + } +} diff --git a/telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/MainAbility/pages/Blank.ets b/telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/MainAbility/pages/Blank.ets new file mode 100644 index 000000000..a50fc719e --- /dev/null +++ b/telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/MainAbility/pages/Blank.ets @@ -0,0 +1,47 @@ +/* + * 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. + */ + +@Entry +@Component +struct blank_testcase { + @State Color: Color = Color.Pink + @State active: boolean = false + private content: string = "Blank Page" + + onPageShow() { + console.info('Blank page show called'); + } + + onBuildDone() { + console.info('Blank page build done called'); + } + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Text(`${this.content}`) + .fontSize(50) + .fontWeight(FontWeight.Bold) + Blank(100) + .color(this.Color) + .key('blank') + Text('on/off').fontSize(18).height(60) + } + .key('flex') + .width('100%') + .height('100%') + + + } +} diff --git a/telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/MainAbility/pages/Button.ets b/telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/MainAbility/pages/Button.ets new file mode 100644 index 000000000..ac2271ea3 --- /dev/null +++ b/telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/MainAbility/pages/Button.ets @@ -0,0 +1,70 @@ +/* + * 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 router from '@system.router' + +@Entry +@Component +struct button_testcase { + @State stateEffect: boolean = true + @State ButtonType: ButtonType = ButtonType.Circle + private content: string = "Button Page"; + + onPageShow() { + console.info('Button page show called'); + } + + onBuildDone() { + console.info('Button page build done called'); + } + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Text(`${this.content}`) + .fontSize(50) + .fontWeight(FontWeight.Bold) + Button('1.value', { type: ButtonType.Circle, stateEffect: this.stateEffect }) + .fontSize(12) + .fontWeight(FontWeight.Bold) + .fontColor(0xCCCCCC) + .height(40) + .width(40) + .key('button') + .backgroundColor('#0D9FFB') + .onClick(() => { + router.back() + }) + .padding(10) + Button() { + Text("2.Capsule") + } + .type(ButtonType.Capsule) + .stateEffect(false) + .backgroundColor('#0D9FFB') + .padding(10) + .key('button1') + + Button() { + Text("3.Normal") + }.type(ButtonType.Normal) + .backgroundColor('#0D9FFB') + .key('button2') + + }.key('flex') + .width('100%') + .height('100%') + } +} + diff --git a/telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/MainAbility/pages/Column.ets b/telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/MainAbility/pages/Column.ets new file mode 100644 index 000000000..b9e5c84e2 --- /dev/null +++ b/telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/MainAbility/pages/Column.ets @@ -0,0 +1,51 @@ +/* + * 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. + */ + +@Entry +@Component +struct column { + @State active: boolean = false + private content: string = "Column Page" + + onPageShow() { + console.info('Column page show called'); + } + + onBuildDone() { + console.info('Column page build done called'); + } + + build() { + Column({ space: 5 }) { + Text('alignItems(Center)').fontSize(9).fontColor(0xCCCCCC).width('90%') + Column() { + Column().width('50%').height(50).backgroundColor(0xAFEEEE) + Column().width('50%').height(50).backgroundColor(0x00FFFF) + }.alignItems(HorizontalAlign.Center).width('90%').border({ width: 1 }).key('column') + + Text('alignItems(Start)').fontSize(9).fontColor(0xCCCCCC).width('90%') + Column({ space: '5' }) { + Column().width('50%').height(50).backgroundColor(0xAFEEEE) + Column().width('50%').height(50).backgroundColor(0x00FFFF) + }.alignItems(HorizontalAlign.Start).width('90%').border({ width: 1 }).key('column1') + + Text('alignItems(End)').fontSize(9).fontColor(0xCCCCCC).width('90%') + Column() { + Column().width('50%').height(50).backgroundColor(0xAFEEEE) + Column().width('50%').height(50).backgroundColor(0x00FFFF) + }.alignItems(HorizontalAlign.End).width('90%').border({ width: 1 }).key('column2') + }.width('100%').padding({ top: 5 }) + } +} diff --git a/telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/MainAbility/pages/ColumnSplit.ets b/telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/MainAbility/pages/ColumnSplit.ets new file mode 100644 index 000000000..cb0597310 --- /dev/null +++ b/telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/MainAbility/pages/ColumnSplit.ets @@ -0,0 +1,70 @@ +/* + * 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. + */ + +@Entry +@Component +struct columnSplit { + private content: string = "ColumnSplit Page" + + onPageShow() { + console.info('ColumnSplit page show called'); + } + + onBuildDone() { + console.info('ColumnSplit page build done called'); + } + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Scroll() { + Column() { + Text(`${this.content}`) + .fontSize(50) + .fontWeight(FontWeight.Bold) + Column() { + Text('ColumnSplit').fontSize(9).fontColor(0xCCCCCC).width('90%') + ColumnSplit() { + Text('1').width('100%').height(50).backgroundColor(0xF5DEB3).textAlign(TextAlign.Center) + Text('2').width('100%').height(50).backgroundColor(0xD2B48C).textAlign(TextAlign.Center) + Text('3').width('100%').height(50).backgroundColor(0xF5DEB3).textAlign(TextAlign.Center) + Text('4').width('100%').height(50).backgroundColor(0xD2B48C).textAlign(TextAlign.Center) + Text('5').width('100%').height(50).backgroundColor(0xF5DEB3).textAlign(TextAlign.Center) + }.key('columnSplit') + .resizeable(true) + .width('90%').height('60%') + + }.width("100%") + + Column() { + Text('ColumnSplit1').fontSize(9).fontColor(0xCCCCCC).width('90%') + ColumnSplit() { + Text('1').width('100%').height(50).backgroundColor(0xF5DEB3).textAlign(TextAlign.Center) + Text('2').width('100%').height(50).backgroundColor(0xD2B48C).textAlign(TextAlign.Center) + Text('3').width('100%').height(50).backgroundColor(0xF5DEB3).textAlign(TextAlign.Center) + Text('4').width('100%').height(50).backgroundColor(0xD2B48C).textAlign(TextAlign.Center) + Text('5').width('100%').height(50).backgroundColor(0xF5DEB3).textAlign(TextAlign.Center) + }.key('columnSplit1') + .resizeable(false) + .width('90%').height('60%') + + }.width("100%") + } + } + } + .key('flex') + .width('100%') + .height('100%') + } +} diff --git a/telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/MainAbility/pages/Counter.ets b/telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/MainAbility/pages/Counter.ets new file mode 100644 index 000000000..ecdbfaf10 --- /dev/null +++ b/telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/MainAbility/pages/Counter.ets @@ -0,0 +1,51 @@ +/* + * 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. + */ + +@Entry +@Component +struct counter { + @State value: number = 0 + @State active: boolean = false + private content: string = "Counter Page" + + onPageShow() { + console.info('Counter page show called'); + } + + onBuildDone() { + console.info('Counter page build done called'); + } + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Text(`${this.content}`) + .fontSize(50) + .fontWeight(FontWeight.Bold) + Counter() { + Text(this.value.toString()) + }.margin(100) + .key('counter') + .onInc(() => { + this.value++ + }) + .onDec(() => { + this.value-- + }) + }.width("100%") + .key('flex') + .width('100%') + .height('100%') + } +} diff --git a/telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/MainAbility/pages/DataPanel.ets b/telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/MainAbility/pages/DataPanel.ets new file mode 100644 index 000000000..3c6248484 --- /dev/null +++ b/telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/MainAbility/pages/DataPanel.ets @@ -0,0 +1,69 @@ +/* + * 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 router from '@system.router' + +@Entry +@Component +struct dataPanel_testcase { + @State width: string= "200" + @State height: string= "100" + @State active: boolean = false + private content: string = "DataPanel Page" + + onPageShow() { + console.info('Blank page show called'); + } + + onBuildDone() { + console.info('Blank page build done called'); + } + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Text(`${this.content}`) + .fontSize(50) + DataPanel({ values: [20, 40, 20], max: 100, type: DataPanelType.Line }) + .width(this.width) + .height(this.height) + .key('DataPanel') + .onClick(() => { + router.back() + }) + .closeEffect(false) + + DataPanel({ values: [20, 40, 20], max: 100, type: DataPanelType.Circle}) + .width(this.width) + .height(this.height) + .key('DataPanel2') + .onClick(() => { + router.back() + }) + .closeEffect(true) + DataPanel({ values: [20, 40, 20], max: 100}) + .width(this.width) + .height(this.height) + .key('DataPanel3') + .onClick(() => { + router.back() + }) + .closeEffect(false) + } + .key('flex') + .width('100%') + .height('100%') + + } +} diff --git a/telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/MainAbility/pages/Divider.ets b/telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/MainAbility/pages/Divider.ets new file mode 100644 index 000000000..02bf60779 --- /dev/null +++ b/telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/MainAbility/pages/Divider.ets @@ -0,0 +1,71 @@ +/* + * 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 router from '@system.router' + +@Entry +@Component +struct divider_textcase { + @State vertical: boolean = true + @State color: Color = Color.Red + @State strokeWidth: number = 7 + @State lineCap: LineCapStyle = LineCapStyle.Butt + @State active: boolean = false + private content: string = "Divider Page"; + + onPageShow() { + console.info('Button page show called'); + } + + onBuildDone() { + console.info('Button page build done called'); + } + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Text(`${this.content}`) + .fontSize(50) + Divider() + .lineCap(LineCapStyle.Butt) + .strokeWidth(this.strokeWidth) + .color(this.color) + .vertical(this.vertical) + .height(150) + .key('divider') + .onClick(() => { + router.back() + }) + Divider() + .lineCap(LineCapStyle.Round) + .vertical(false) + .color(Color.Green) + .strokeWidth(10) + .height(150) + .key('divider1') + Divider() + .lineCap(LineCapStyle.Square) + .color(Color.Green) + .vertical(true) + .strokeWidth(10) + .height(150) + .key('divider2') + } + .key('flex') + .width('100%') + .height('100%') + } +} + + diff --git a/telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/MainAbility/pages/Flex.ets b/telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/MainAbility/pages/Flex.ets new file mode 100644 index 000000000..a0e21251e --- /dev/null +++ b/telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/MainAbility/pages/Flex.ets @@ -0,0 +1,135 @@ +/* + * 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. + */ + +@Entry +@Component +struct flex { + private content: string = "Flex Page" + + onPageShow() { + console.info('Flex page show called'); + } + + onBuildDone() { + console.info('Flex page build done called'); + } + + build() { + Column() { + Column({ space : 2 }) { + Text('direction:Column').fontSize(9).fontColor(0xCCCCCC).width('90%') + Flex({ + direction: FlexDirection.Column, + wrap: FlexWrap.NoWrap, + justifyContent: FlexAlign.Center, + alignItems:ItemAlign.Start, + alignContent: FlexAlign.Start, + }) { + Text('1').width('100%').height(20).backgroundColor(0xF5DEB3) + Text('2').width('100%').height(20).backgroundColor(0xD2B48C) + Text('3').width('100%').height(20).backgroundColor(0xF5DEB3) + } + .key('flex') + .height(70) + .width('90%') + .padding(10) + .backgroundColor(0xAFEEEE) + + Text('direction:Row').fontSize(9).fontColor(0xCCCCCC).width('90%') + Flex({ + direction: FlexDirection.Row, + wrap: FlexWrap.Wrap, + justifyContent: FlexAlign.Start, + alignItems:ItemAlign.Start, + alignContent: FlexAlign.Center, + }) { + Text('1').width('20%').height(20).backgroundColor(0xF5DEB3) + Text('2').width('20%').height(20).backgroundColor(0xD2B48C) + Text('3').width('20%').height(20).backgroundColor(0xF5DEB3) + } + .key('flex1') + .height(70) + .width('90%') + .padding(10) + .backgroundColor(0xAFEEEE) + + Text('direction:RowReverse').fontSize(9).fontColor(0xCCCCCC).width('90%') + Flex({ + direction: FlexDirection.RowReverse, + wrap: FlexWrap.Wrap, + justifyContent: FlexAlign.End, + alignItems:ItemAlign.End, + alignContent: FlexAlign.End, + }) { + Text('1').width('50%').height(20).backgroundColor(0xF5DEB3) + Text('2').width('50%').height(20).backgroundColor(0xD2B48C) + Text('3').width('50%').height(20).backgroundColor(0xF5DEB3) + } + .key('flex2') + .height(90) + .width('90%') + .padding(10) + .backgroundColor(0xAFEEEE) + + Text('justifyContent:SpaceBetween').fontSize(9).fontColor(0xCCCCCC).width('90%') + Flex({ + justifyContent: FlexAlign.SpaceBetween, + wrap: FlexWrap.Wrap, + }) { + Text('1').width('100%').height(20).backgroundColor(0xF5DEB3) + Text('2').width('100%').height(20).backgroundColor(0xD2B48C) + Text('3').width('100%').height(20).backgroundColor(0xF5DEB3) + } + .key('flex3') + .height(100) + .width('90%') + .padding(10) + .backgroundColor(0xAFEEEE) + + Text('justifyContent AND alignContent').fontSize(9).fontColor(0xCCCCCC).width('90%') + Flex({ + justifyContent: FlexAlign.SpaceEvenly, + alignContent: FlexAlign.SpaceEvenly, + wrap: FlexWrap.Wrap, + }) { + Text('1').width('50%').height(20).backgroundColor(0xF5DEB3) + Text('2').width('50%').height(20).backgroundColor(0xD2B48C) + Text('3').width('50%').height(20).backgroundColor(0xF5DEB3) + } + .key('flex4') + .height(90) + .width('90%') + .padding(10) + .backgroundColor(0xAFEEEE) + + Text('justifyContent AND alignContent').fontSize(9).fontColor(0xCCCCCC).width('90%') + Flex({ + justifyContent: FlexAlign.SpaceAround, + alignContent: FlexAlign.SpaceAround, + wrap: FlexWrap.Wrap, + }) { + Text('1').width('50%').height(20).backgroundColor(0xF5DEB3) + Text('2').width('50%').height(20).backgroundColor(0xD2B48C) + Text('3').width('50%').height(20).backgroundColor(0xF5DEB3) + } + .key('flex5') + .height(90) + .width('90%') + .padding(10) + .backgroundColor(0xAFEEEE) + }.width('100%').margin({ top: 5 }) + }.width('100%') + } +} diff --git a/telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/MainAbility/pages/GridContainer.ets b/telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/MainAbility/pages/GridContainer.ets new file mode 100644 index 000000000..573581104 --- /dev/null +++ b/telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/MainAbility/pages/GridContainer.ets @@ -0,0 +1,170 @@ +/* + * 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. + */ + +@Entry +@Component +struct gridContainer { + @State sizeType: SizeType = SizeType.XS + @State active: boolean = false + private content: string = "GridContainer Page" + + onPageShow() { + console.info('GridContainer page show called'); + } + + onBuildDone() { + console.info('GridContainer page build done called'); + } + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Text(`${this.content}`) + .fontSize(50) + .fontWeight(FontWeight.Bold) + Scroll() { + Column({ space: 5 }) { + GridContainer({ columns: 12, sizeType: this.sizeType, gutter: 10, margin: 20 }) { + Row() { + Text('1') + .useSizeType({ + xs: { span: 6, offset: 0 }, + sm: { span: 2, offset: 0 }, + md: { span: 2, offset: 0 }, + lg: { span: 2, offset: 0 } + }) + .height(50).backgroundColor(0x4682B4).textAlign(TextAlign.Center) + Text('2').gridSpan(2) + + .height(50).backgroundColor(0x00BFFF).textAlign(TextAlign.Center) + Text('3').gridOffset(3) + + .height(50).backgroundColor(0x4682B4).textAlign(TextAlign.Center) + } + }.key('gridContainer') + .width('90%') + .alignItems(HorizontalAlign.Start) + + Text('Click Simulate to change the device width').fontSize(9).width('90%').fontColor(0xCCCCCC) + Row() { + Button('XS') + .onClick(() => { + this.sizeType = SizeType.XS + }).backgroundColor(0x317aff) + Button('SM') + .onClick(() => { + this.sizeType = SizeType.SM + }).backgroundColor(0x317aff) + Button('MD') + .onClick(() => { + this.sizeType = SizeType.MD + }).backgroundColor(0x317aff) + Button('LG') + .onClick(() => { + this.sizeType = SizeType.LG + }).backgroundColor(0x317aff) + } + + GridContainer({ columns: "auto", sizeType: SizeType.MD, gutter: '10', margin: '20' }) { + Row() { + Text('1') + .useSizeType({ + xs: { span: 6, offset: 0 }, + sm: { span: 2, offset: 0 }, + md: { span: 2, offset: 0 }, + lg: { span: 2, offset: 0 } + }) + .height(50).backgroundColor(0x4682B4).textAlign(TextAlign.Center) + Text('2').gridSpan(2) + + .height(50).backgroundColor(0x00BFFF).textAlign(TextAlign.Center) + Text('3').gridOffset(3) + + .height(50).backgroundColor(0x4682B4).textAlign(TextAlign.Center) + } + }.key('gridContainer1') + .width('90%') + .alignItems(HorizontalAlign.Center) + + GridContainer({ columns: 12, sizeType: SizeType.SM, gutter: 10, margin: 20 }) { + Row() { + Text('1') + .useSizeType({ + xs: { span: 6, offset: 0 }, + sm: { span: 2, offset: 0 }, + md: { span: 2, offset: 0 }, + lg: { span: 2, offset: 0 } + }) + .height(50).backgroundColor(0x4682B4).textAlign(TextAlign.Center) + Text('2').gridSpan(2) + + .height(50).backgroundColor(0x00BFFF).textAlign(TextAlign.Center) + Text('3').gridOffset(3) + + .height(50).backgroundColor(0x4682B4).textAlign(TextAlign.Center) + } + }.key('gridContainer2') + .width('90%') + .alignItems(HorizontalAlign.End) + + GridContainer({ columns: 12, sizeType: SizeType.LG, gutter: 10, margin: 20 }) { + Row() { + Text('1') + .useSizeType({ + xs: { span: 6, offset: 0 }, + sm: { span: 2, offset: 0 }, + md: { span: 2, offset: 0 }, + lg: { span: 2, offset: 0 } + }) + .height(50).backgroundColor(0x4682B4).textAlign(TextAlign.Center) + Text('2').gridSpan(2) + + .height(50).backgroundColor(0x00BFFF).textAlign(TextAlign.Center) + Text('3').gridOffset(3) + + .height(50).backgroundColor(0x4682B4).textAlign(TextAlign.Center) + } + }.key('gridContainer3') + .width('90%') + .alignItems(HorizontalAlign.End) + + GridContainer({ columns: 12, sizeType: SizeType.Auto, gutter: 10, margin: 20 }) { + Row() { + Text('1') + .useSizeType({ + xs: { span: 6, offset: 0 }, + sm: { span: 2, offset: 0 }, + md: { span: 2, offset: 0 }, + lg: { span: 2, offset: 0 } + }) + .height(50).backgroundColor(0x4682B4).textAlign(TextAlign.Center) + Text('2').gridSpan(2) + + .height(50).backgroundColor(0x00BFFF).textAlign(TextAlign.Center) + Text('3').gridOffset(3) + + .height(50).backgroundColor(0x4682B4).textAlign(TextAlign.Center) + } + }.key('gridContainer4') + .width('90%') + .alignItems(HorizontalAlign.End) + + }.width('100%').margin({ top: 5 }) + } + } + .key('flex') + .width('100%') + .height('100%') + } +} diff --git a/telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/MainAbility/pages/Image.ets b/telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/MainAbility/pages/Image.ets new file mode 100644 index 000000000..5cc583e93 --- /dev/null +++ b/telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/MainAbility/pages/Image.ets @@ -0,0 +1,90 @@ +/* + * 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. + */ + +@Entry +@Component +struct image_textcase { + @State Width: number = 0 + @State height: number = 0 + + onPageShow() { + console.info('Image page show called'); + } + + onBuildDone() { + console.info('Image page build done called'); + } + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Column() { + Text(`Image page`) + .fontSize(50) + .fontWeight(FontWeight.Bold) + Image("/resources/rawfile/hand.png") + .matchTextDirection(false) + .fitOriginalSize(false) + .fillColor(0xCCCCCC) + .objectFit(ImageFit.Cover) + .objectRepeat(ImageRepeat.NoRepeat) + .interpolation(ImageInterpolation.None) + .renderMode(ImageRenderMode.Original) + .autoResize(false) + .syncLoad(false) + .sourceSize({ width: 200, height: 100 }) + .alt("/resources/rawfile/person.png") + .key('image1') + Image("/resources/rawfile/hand.png") + .objectFit(ImageFit.Contain) + .objectRepeat(ImageRepeat.X) + .interpolation(ImageInterpolation.High) + .renderMode(ImageRenderMode.Template) + .key('image2') + .height(180) + .width(180) + .onComplete((msg: { + width: number, + height: number + }) => { + this.Width = msg.width + this.height = msg.height + console.info('Width ----' + this.Width) + console.info('height ----' + this.height) + }) + .onError(() => { + console.info('load image fail') + }) + Image("/resources/rawfile/hand.png") + .objectFit(ImageFit.Fill) + .objectRepeat(ImageRepeat.Y) + .interpolation(ImageInterpolation.Low) + .key('image3') + Image("/resources/rawfile/hand.png") + .objectFit(ImageFit.None) + .objectRepeat(ImageRepeat.XY) + .interpolation(ImageInterpolation.Medium) + .key('image4') + Image("/resources/rawfile/hand.png") + .objectFit(ImageFit.ScaleDown) + .key('image5') + }.width(300) + .height(300) + .borderColor(Color.Pink) + .borderWidth(4) + } + } +} + + diff --git a/telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/MainAbility/pages/Navigator.ets b/telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/MainAbility/pages/Navigator.ets new file mode 100644 index 000000000..6c50769cf --- /dev/null +++ b/telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/MainAbility/pages/Navigator.ets @@ -0,0 +1,60 @@ +/* + * 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. + */ + +@Entry +@Component +struct navigator_testcase { + @State active: boolean = false + @State params: Object = { text: 'news' } + + onPageShow() { + console.info('Navigator page show called'); + } + + onBuildDone() { + console.info('Navigator page build done called'); + } + + build() { + Column() { + Navigator({ target: "pages/index", type: NavigationType.Back }) { + Text('Navigator test in Navigator,back') + }.active(this.active) + .key('navigator') + .params({ + data: 24 + }) + + Navigator({ target: "pages/index", type: NavigationType.Push }) { + Text('Navigator test in Navigator,push') + }.active(this.active) + .key('navigator2') + .params({ + data: 24 + }) + + Navigator({ target: "pages/index", type: NavigationType.Replace }) { + Text('Navigator test in Navigator,replace') + }.active(this.active) + .key('navigator3') + .params({ + data: 24 + }) + }.width(300) + .height(300) + .borderColor(Color.Pink) + .borderWidth(2) + } +} diff --git a/telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/MainAbility/pages/Panel.ets b/telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/MainAbility/pages/Panel.ets new file mode 100644 index 000000000..32ddabbd1 --- /dev/null +++ b/telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/MainAbility/pages/Panel.ets @@ -0,0 +1,96 @@ +/* + * 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. + */ + +@Entry +@Component +struct PanelExample { + @State show: boolean = true + + onPageShow() { + console.info('Panel page show called'); + } + + onBuildDone() { + console.info('Panel page build done called'); + } + + build() { + Column() { + Text('2021-09-30 Today Calendar: 1.afternoon......Click for details') + .width('90%') + .height(50) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + .padding({ left: 20 }) + .onClick(() => { + this.show = !this.show + }) + Panel(this.show) { + Column() { + Text('Today Calendar') + Divider() + Text('1. afternoon 4:00 The project meeting') + } + } + .key('panel') + .type(PanelType.Foldable) + .mode(PanelMode.Half) + .dragBar(true) + .fullHeight(500) + .halfHeight(250) + .miniHeight(100) + .onChange((value: any) => { + console.info(`width:${value.width},height:${value.height},mode:${value.mode}`) + }) + + Panel(this.show) { + Column() { + Text('Today Calendar') + Divider() + Text('1. afternoon 4:00 The project meeting') + } + } + .key('panel2') + .type(PanelType.Minibar) + .mode(PanelMode.Mini) + .dragBar(true) + .fullHeight(500) + .halfHeight(250) + .miniHeight(100) + .onChange((value: any) => { + console.info(`width:${value.width},height:${value.height},mode:${value.mode}`) + }) + + Panel(false) { + Column() { + Text('Today Calendar') + Divider() + Text('1. afternoon 4:00 The project meeting') + } + } + .key('panel3') + .type(PanelType.Temporary) + .mode(PanelMode.Full) + .dragBar(true) + .fullHeight(500) + .halfHeight(250) + .miniHeight(100) + .onChange((value: any) => { + console.info(`width:${value.width},height:${value.height},mode:${value.mode}`) + }) + + }.width('100%').height('50%').backgroundColor(0xDCDCDC).padding({ top: 5 }) + } +} \ No newline at end of file diff --git a/telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/MainAbility/pages/Progress.ets b/telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/MainAbility/pages/Progress.ets new file mode 100644 index 000000000..c8608089f --- /dev/null +++ b/telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/MainAbility/pages/Progress.ets @@ -0,0 +1,76 @@ +/* + * 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. + */ + +@Entry +@Component +struct progress_testcase { + onPageShow() { + console.info('Progress page show called'); + } + + onBuildDone() { + console.info('Progress page build done called'); + } + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Column() { + Text(`Progress page`) + .fontSize(50) + .fontWeight(FontWeight.Bold) + Progress({ value: 20, total: 40, style: ProgressStyle.Linear }) + .value(3) + .color(Color.Blue) + .width(50) + .height(70) + .key('progress') + + Progress({ value: 20, total: 40, style: ProgressStyle.Eclipse }) + .value(3) + .color(Color.Blue) + .width(50) + .height(70) + .key('progress2') + + Progress({ value: 20, total: 40, style: ProgressStyle.Ring }) + .value(3) + .color(Color.Blue) + .width(50) + .height(70) + .key('progress3') + + Progress({ value: 20, total: 40, style: ProgressStyle.ScaleRing }) + .value(3) + .color(Color.Blue) + .width(50) + .height(70) + .key('progress4') + + Progress({ value: 20, total: 40, style: ProgressStyle.Capsule }) + .value(3) + .color(Color.Blue) + .width(50) + .height(70) + .key('progress5') + + } + .width(400) + .height(400) + .borderColor(Color.Pink) + .borderWidth(2) + } + } +} + diff --git a/telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/MainAbility/pages/Qrcode.ets b/telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/MainAbility/pages/Qrcode.ets new file mode 100644 index 000000000..5c0dd84ef --- /dev/null +++ b/telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/MainAbility/pages/Qrcode.ets @@ -0,0 +1,44 @@ +/* + * 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. + */ + +@Entry +@Component +struct qrcode_textcase { + @State Color: Color = Color.Pink + + onPageShow() { + console.info('Qrcode page show called'); + } + + onBuildDone() { + console.info('Qrcode page build done called'); + } + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Text(`Qrcode page`) + .fontSize(50) + .fontWeight(FontWeight.Bold) + QRCode('hello world') + .color("#FFFFC0CB") + .backgroundColor(this.Color) + .width("200") + .height("100") + .key('qrcode') + } + } +} + + diff --git a/telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/MainAbility/pages/Rating.ets b/telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/MainAbility/pages/Rating.ets new file mode 100644 index 000000000..b29e26a39 --- /dev/null +++ b/telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/MainAbility/pages/Rating.ets @@ -0,0 +1,63 @@ +/* + * 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. + */ + +@Entry +@Component +struct rating_testcase { + @State rating: number = 2 + + onPageShow() { + console.info('Rating page show called'); + } + + onBuildDone() { + console.info('Rating page build done called'); + } + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Column() { + Text(`Rating page`) + .fontSize(50) + .fontWeight(FontWeight.Bold) + Rating({ rating: 2, indicator: false }) + .stepSize(0.5) + .stars(5) + .starStyle({ + backgroundUri: '/resources/rawfile/star-1-1.png', + foregroundUri: '/resources/rawfile/star-1-3.png', + secondaryUri: '/resources/rawfile/star-1-2.png' + }) + .onChange((value: number) => { + this.rating = value + }) + .key('rating1') + Rating({ rating: 2, indicator: true }) + .stepSize(0.5) + .stars(5) + .starStyle({ + backgroundUri: '/resources/rawfile/star-1-1.png', + foregroundUri: '/resources/rawfile/star-1-3.png', + secondaryUri: '/resources/rawfile/star-1-2.png' + }) + .key('rating2') + }.width(300) + .height(300) + .borderColor(Color.Pink) + .borderWidth(2) + } + } +} + diff --git a/telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/MainAbility/pages/RowSplit.ets b/telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/MainAbility/pages/RowSplit.ets new file mode 100644 index 000000000..0f4f397b1 --- /dev/null +++ b/telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/MainAbility/pages/RowSplit.ets @@ -0,0 +1,78 @@ +/* + * 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 router from '@system.router' + +@Entry +@Component +struct rowSplit_testcase { + @State resizeable: boolean = false + private content: string = "rowSplit Page"; + + onPageShow() { + console.info('RowSplit page show called'); + } + + onBuildDone() { + console.info('RowSplit page build done called'); + } + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Text(`${this.content}`) + .fontSize(50) + .fontWeight(FontWeight.Bold) + RowSplit() { + Column() { + Text('Demo1.RowSplit') + .fontSize(15) + .fontWeight(FontWeight.Bold) + } + + Column() { + Text('Demo2.RowSplit') + .fontSize(15) + .fontWeight(FontWeight.Bold) + } + } + .height(100) + .key('rowSplit') + .resizeable(this.resizeable) + .onClick(() => { + router.back() + }) + + RowSplit() { + Column() { + Text('Demo3.RowSplit') + .fontSize(15) + .fontWeight(FontWeight.Bold) + } + + Column() { + Text('Demo4.RowSplit') + .fontSize(15) + .fontWeight(FontWeight.Bold) + } + }.height(100) + .key('rowSplit1') + .resizeable(true) + } + .key('flex') + .width('100%') + .height('100%') + } +} + diff --git a/telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/MainAbility/pages/Scroll.ets b/telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/MainAbility/pages/Scroll.ets new file mode 100644 index 000000000..363089d22 --- /dev/null +++ b/telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/MainAbility/pages/Scroll.ets @@ -0,0 +1,200 @@ +/* + * 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. + */ + +@Entry +@Component +struct scroll_testcase { + @State scrollBarWidth: number = 20 + @State scrollable: ScrollDirection = ScrollDirection.None + @State scrollBarColor: Color = Color.Pink + @State scrollBar: BarState= BarState.On + private value1: Array = [1, 2, 3, 4, 5, 6, 7, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30] + @State edge: Edge= Edge.Top + private content: string = "Scroll Page"; + scroller: Scroller = new Scroller(); + + onPageShow() { + console.info('Button page show called'); + } + + onBuildDone() { + console.info('Button page build done called'); + } + + build() { + + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Text(`${this.content}`) + .fontSize(50) + .fontWeight(FontWeight.Bold) + Scroll(this.scroller) { + Column() { + ForEach( + this.value1, + item => { + Text(`${item}`) + .fontSize(15) + .width(400) + .margin(10) + .height(70) + .backgroundColor(0xfff5deb3) + }, + item => item + ) + } + } + .scrollable(ScrollDirection.Vertical) + .scrollBar(this.scrollBar) + .scrollBarColor(this.scrollBarColor) + .scrollBarWidth(this.scrollBarWidth) + .key('scroll') + .width(400) + .height(200) + .onScroll((xOffset: number, yOffset: number) => { + console.info(` current offset is ${xOffset} ${yOffset}`) + }) + .onScrollEnd(() => { + console.info(` now on scroll end`) + }) + .onScrollEdge((side: Edge) => { + console.info(`To the edge`) + }) + Scroll() { + Row() { + Text('scroll uppppp') + .width(60) + .height(100) + .backgroundColor(Color.Yellow) + .margin({ + right: 5, + left: 5 + }) + .key('text') + + Text('scroll to') + .width(60) + .height(100) + .backgroundColor(Color.Green) + .margin({ + right: 5, + left: 5 + }) + .onClick(() => { + this.scroller.scrollTo({ + xOffset: 100, + yOffset: 100, + }) + }) + Text('scroll page') + .width(60) + .height(100) + .backgroundColor(Color.Blue) + .margin({ + right: 5, + left: 5 + }) + .onClick(() => { + this.scroller.scrollPage({ + next: true + }) + }) + Text('scroll Edge') + .width(60) + .height(100) + .backgroundColor(Color.Blue) + .margin({ + right: 5, + left: 5 + }) + .onClick(() => { + this.scroller.scrollEdge(Edge.Top) + }) + Text('scroll Edge') + .width(60) + .height(100) + .backgroundColor(Color.Blue) + .margin({ + right: 5, + left: 5 + }) + .onClick(() => { + this.scroller.currentOffset() + }) + Text('scroll to index') + .width(60) + .height(100) + .backgroundColor(Color.Blue) + .margin({ + right: 5, + left: 5 + }) + .onClick(() => { + this.scroller.scrollToIndex(0) + console.info(` now on scroll end`) + }) + } + } + .key('scroll1') + .height(100) + .scrollable(ScrollDirection.Horizontal) + + Scroll() { + Column() { + Text("start").fontSize(30) + Text("scrollable1") + Text("scrollable2") + Text("scrollable3") + Text("scrollable4") + Text("scrollable1") + Text("scrollable2") + Text("scrollable3") + Text("scrollable4") + } + } + .padding(10) + .scrollable(ScrollDirection.None) + .scrollBar(BarState.Off) + .scrollBarColor(Color.Red) + .scrollBarWidth(5) + .width(300) + .height(200) + .key('scroll2') + + Scroll() { + Column() { + Text("start").fontSize(30) + Text("scrollable1") + Text("scrollable2") + Text("scrollable3") + Text("scrollable4") + Text("scrollable1") + Text("scrollable2") + Text("scrollable3") + Text("scrollable4") + } + } + .padding(10) + .scrollable(ScrollDirection.Free) + .scrollBar(BarState.Off) + .scrollBarColor(Color.Red) + .scrollBarWidth(5) + .width(300) + .height(200) + .key('scroll3') + } + .key('flex') + + } +} diff --git a/telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/MainAbility/pages/Slider.ets b/telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/MainAbility/pages/Slider.ets new file mode 100644 index 000000000..625cd0287 --- /dev/null +++ b/telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/MainAbility/pages/Slider.ets @@ -0,0 +1,82 @@ +/* + * 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. + */ + +@Entry +@Component +struct slider { + @State inSetValue: number= 40 + @State outSetValue: number= 40 + @State direction: Axis= Axis.Horizontal + @State Begin: number = SliderChangeMode.Begin + + onPageShow() { + console.info('Slider page show called'); + } + + onBuildDone() { + console.info('Slider page build done called'); + } + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Column() { + Text(`Slider page`) + .fontSize(50) + .fontWeight(FontWeight.Bold) + Slider({ + value: this.outSetValue, + min: 0, + max: 100, + step: 1, + direction: Axis.Horizontal, + reverse: false, + style: SliderStyle.OutSet + }) + .blockColor('#FFFF0000') + .selectedColor('#FF0000FF') + .trackColor('#FF808080') + .minLabel('10') + .maxLabel('10') + .showTips(false) + .showSteps(false) + .onChange((value: number, mode: SliderChangeMode) => { + this.outSetValue = value + this.Begin = mode + console.info('value: ' + value + '---mode: ' + mode) + }) + .width("100") + .height("100") + .key('slider1') + Slider({ + value: 40, + min: 0, + max: 100, + step: 1, + style: SliderStyle.InSet + }) + .blockColor(Color.Red) + .selectedColor(Color.Blue) + .trackColor(Color.Gray) + .showTips(true) + .showSteps(true) + .key('slider2') + }.width(300) + .height(300) + .borderColor(Color.Pink) + .borderWidth(2) + } + } +} + diff --git a/telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/MainAbility/pages/Span.ets b/telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/MainAbility/pages/Span.ets new file mode 100644 index 000000000..df5a71043 --- /dev/null +++ b/telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/MainAbility/pages/Span.ets @@ -0,0 +1,64 @@ +/* + * 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. + */ + +@Entry +@Component +struct span_textcase { + + onPageShow() { + console.info('Span page show called'); + } + + onBuildDone() { + console.info('Span page build done called'); + } + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Column() { + Text() { + Span('Test Span demo') + .decoration({ type: TextDecorationType.LineThrough, "color": Color.Red }) + .textCase(TextCase.UpperCase) + .fontColor(Color.Blue) + .fontSize("20fp") + .letterSpacing(5) + .fontFamily("sans-serif") + .fontWeight(FontWeight.Bold) + .fontStyle(FontStyle.Italic) + .key('span1') + Span('The second test Span demo') + .textCase(TextCase.LowerCase) + .fontColor(Color.Black) + .letterSpacing('5') + .fontSize(30) + .key('span2') + Span('The third test Span demo') + .textCase(TextCase.Normal) + .fontColor(Color.Yellow) + .fontSize("30fp") + .key('span3') + } + } + .width(300) + .height(300) + .borderColor(Color.Pink) + .borderWidth(4) + } + } +} + + + diff --git a/telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/MainAbility/pages/Stack.ets b/telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/MainAbility/pages/Stack.ets new file mode 100644 index 000000000..2a694889f --- /dev/null +++ b/telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/MainAbility/pages/Stack.ets @@ -0,0 +1,103 @@ +/* + * 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 router from '@system.router' + +@Entry +@Component +struct stack_testcase { + @State alignContent: Alignment = Alignment.Bottom + private content: string = "Stack Page"; + + onPageShow() { + console.info('Stack page show called'); + } + + onBuildDone() { + console.info('Stack page build done called'); + } + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Text(`${this.content}`) + .fontSize(50) + .fontWeight(FontWeight.Bold) + Stack({ alignContent: this.alignContent }) { + Text('First child, show in bottom').width('90%').height('100%').backgroundColor(0xd2cab3).align(Alignment.Top) + Text('Second child, show in top').width('70%').height('60%').backgroundColor(0xc1cbac).align(Alignment.Top) + } + .width('100%') + .height(80) + .margin({ top: 5 }) + .key('stack') + .onClick(() => { + router.back() + }) + + Stack({ alignContent: Alignment.BottomStart }) { + Text('First child, show in bottom').width('90%').height('100%').backgroundColor(0xd2cab3).align(Alignment.Top) + Text('Second child, show in top').width('70%').height('60%').backgroundColor(0xc1cbac).align(Alignment.Top) + }.width('100%').height(80).margin({ top: 5 }) + .key('stack1') + + Stack({ alignContent: Alignment.BottomEnd }) { + Text('First child, show in bottom').width('90%').height('100%').backgroundColor(0xd2cab3).align(Alignment.Top) + Text('Second child, show in top').width('70%').height('60%').backgroundColor(0xc1cbac).align(Alignment.Top) + }.width('100%').height(80).margin({ top: 5 }) + .key('stack2') + + Stack({ alignContent: Alignment.Start }) { + Text('First child, show in bottom').width('90%').height('100%').backgroundColor(0xd2cab3).align(Alignment.Top) + Text('Second child, show in top').width('70%').height('60%').backgroundColor(0xc1cbac).align(Alignment.Top) + }.width('100%').height(80).margin({ top: 5 }) + .key('stack3') + + Stack({ alignContent: Alignment.Center }) { + Text('First child, show in bottom').width('90%').height('100%').backgroundColor(0xd2cab3).align(Alignment.Top) + Text('Second child, show in top').width('70%').height('60%').backgroundColor(0xc1cbac).align(Alignment.Top) + }.width('100%').height(80).margin({ top: 5 }) + .key('stack4') + + Stack({ alignContent: Alignment.End }) { + Text('First child, show in bottom').width('90%').height('100%').backgroundColor(0xd2cab3).align(Alignment.Top) + Text('Second child, show in top').width('70%').height('60%').backgroundColor(0xc1cbac).align(Alignment.Top) + }.width('100%').height(80).margin({ top: 5 }) + .key('stack5') + + Stack({ alignContent: Alignment.Top }) { + Text('First child, show in bottom').width('90%').height('100%').backgroundColor(0xd2cab3).align(Alignment.Top) + Text('Second child, show in top').width('70%').height('60%').backgroundColor(0xc1cbac).align(Alignment.Top) + }.width('100%').height(60).margin({ top: 5 }) + .key('stack6') + + Stack({ alignContent: Alignment.TopStart }) { + Text('First child, show in bottom').width('90%').height('100%').backgroundColor(0xd2cab3).align(Alignment.Top) + Text('Second child, show in top').width('70%').height('60%').backgroundColor(0xc1cbac).align(Alignment.Top) + }.width('100%').height(60).margin({ top: 5 }) + .key('stack7') + + Stack({ alignContent: Alignment.TopEnd }) { + Text('First child, show in bottom').width('90%').height('100%').backgroundColor(0xd2cab3).align(Alignment.Top) + Text('Second child, show in top').width('70%').height('60%').backgroundColor(0xc1cbac).align(Alignment.Top) + }.width('100%').height(60).margin({ top: 5 }) + .key('stack8') + } + .key('flex') + .width('100%') + .height('100%') + + } +} + diff --git a/telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/MainAbility/pages/Text.ets b/telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/MainAbility/pages/Text.ets new file mode 100644 index 000000000..fbd1415dc --- /dev/null +++ b/telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/MainAbility/pages/Text.ets @@ -0,0 +1,237 @@ +/* + * 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. + */ + +// @ts-nocheck +import router from '@system.router' + +var paramInfo = router.getParams() +console.info("cd paramInfo" + JSON.stringify(paramInfo)) + +@Entry +@Component +struct text_textcase { + @State textAlign: TextAlign= TextAlign.End + @State lineHeight: string= '15fp' + @State overflow: TextOverflow = TextOverflow.Ellipsis + @State textOverflow: textOverflow<{ "overflow": TextOverflow }> = { "overflow": this.overflow } + @State maxLines: number = 2 + @State baselineOffset: number = 0 + @State textCase: TextCase= TextCase.Normal + @State decoration: decoration<{ + type: TextDecorationType, + color: Color + }> = { type: TextDecorationType.Underline, color: Color.Red } + @State color: Color = Color.Red + @State width: string= "200" + @State height: string= "100" + @State size: size = { width: 200, height: 100 } + @State marginBottom: string = "10px" + @State marginTop: string = "10px" + @State marginLeft: string = "10px" + @State marginRingt: string= "10px" + @State paddingBottom: string= "5" + @State paddingTop: string= "5" + @State paddingLeft: string= "5" + @State paddingRingt: string= "5" + @State constraintSize: constraintSize = { minWidth: 20, maxWidth: 200, minHeight: 0, maxHeight: 50 } + @State layoutPriority: string= "9px" + @State layoutWeight: string = "10px" + @State align: Alignment = Alignment.Center + @State direction: Direction = Direction.Auto + @State position: position<{ + x: string, + y: string + }> = { x: "50", y: "50" } + @State markAnchor: markAnchor<{ + x: string, + y: string + }> = { x: "50", y: "50" } + @State offset: offset<{ + x: string, + y: string + }> = { x: "50", y: "50" } + @State flexGrow: number = 5 + @State flexShrink: number = 2 + @State flexBasis: number = 0 + @State alignSelf: ItemAlign = ItemAlign.Auto + @State borderStyle: BorderStyle = BorderStyle.Dashed + @State borderRadius: number = 10 + @State borderWidth: string= "4px" + @State borderColor: Color= Color.Blue + @State backgroundColor: Color = Color.Pink + @State backgroundImageSize: ImageSize = ImageSize.Cover + @State backgroundImagePosition: Alignment= Alignment.Center + @State opacity: number= 1 + @State visibility: Visibility= Visibility.Visible + @State enabled: boolean = false + @State zIndex: number = 1 + @State fontStyle: FontStyle = FontStyle.Italic + @State fontSize: number = 15 + @State minFontSize: number = 15 + @State maxFontSize: number = 15 + @State letterSpacing: number= 10 + @State fontWeight: FontWeight= FontWeight.Bold + @State fontColor: Color= Color.Black + @State active: boolean = false + private content: string = "Text Page"; + + onPageShow() { + console.info('Text page show called'); + } + + onBuildDone() { + console.info('Text page build done called'); + } + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Text(`${this.content}`) + .fontSize(50) + .fontWeight(FontWeight.Bold) + Text('Text Anto test,Text Anto test,Text Anto test,Text Anto test,test,Text Anto test,Text Anto test,Text Anto test,Text Anto test,Text Anto test,Text Anto test') + .width(this.width) + .height(this.height) + .padding({ bottom: this.paddingBottom, top: this.paddingTop, right: this.paddingRingt, left: this.paddingLeft }) + .margin({ bottom: this.marginBottom, top: this.marginTop, right: this.marginRingt, left: this.marginLeft }) + .constraintSize(this.constraintSize) + .layoutWeight(this.layoutWeight) + .align(this.align) + .direction(this.direction) + .position(this.position) + .markAnchor(this.markAnchor) + .offset(this.offset) + .flexBasis(this.flexBasis) + .flexGrow(this.flexGrow) + .flexShrink(this.flexShrink) + .alignSelf(this.alignSelf) + .borderStyle(this.borderStyle) + .borderRadius(this.borderRadius) + .borderWidth(this.borderWidth) + .borderColor(this.borderColor) + .backgroundColor(this.backgroundColor) + .opacity(this.opacity) + .visibility(this.visibility) + .enabled(this.enabled) + .zIndex(this.zIndex) + .fontColor(this.fontColor) + .fontSize(this.fontSize) + .minFontSize(this.minFontSize) + .letterSpacing(this.letterSpacing) + .maxFontSize(this.maxFontSize) + .fontWeight(this.fontWeight) + .fontStyle(this.fontStyle) + .fontFamily("sans-serif") + .textAlign(this.textAlign) + .textOverflow(this.textOverflow) + .lineHeight(this.lineHeight) + .baselineOffset(this.baselineOffset) + .maxLines(2) + .textCase(this.textCase) + .decoration(this.decoration) + .aspectRatio(1) + .fontColor(Color.Black) + .key('Text') + Text('Text Anto test,Text Anto test,Text Anto test,Text Anto test,Text Anto test,Text Anto test,Text Anto test,Text Anto test') + .size({ width: 100, height: 50 }) + .padding({ bottom: 5, top: 5, right: 5, left: 10 }) + .margin({ bottom: 15, top: 10, right: 10, left: 10 }) + .fontSize('13') + .textAlign(TextAlign.Start) + .align(Alignment.Start) + .direction(Direction.Ltr) + .alignSelf(ItemAlign.Start) + .borderStyle(BorderStyle.Dotted) + .borderWidth(2) + .visibility(Visibility.Hidden) + .enabled(true) + .fontWeight(FontWeight.Normal) + .textAlign(TextAlign.Start) + .textOverflow(TextOverflow.Clip) + .maxLines(2) + .textCase(TextCase.LowerCase) + .decoration({ "type": TextDecorationType.LineThrough, "color": Color.Red }) + .fontColor(Color.White) + .key('Text1') + Text('Text Anto test,Text Anto test,Text Anto test,Text Anto test,Text Anto test,Text Anto test,Text Anto test,Text Anto test,Text Anto test') + .fontSize(13) + .width('100%') + .textAlign(TextAlign.Center) + .align(Alignment.TopEnd) + .direction(Direction.Rtl) + .alignSelf(ItemAlign.Center) + .borderStyle(BorderStyle.Solid) + .borderWidth(2) + .visibility(Visibility.None) + .fontWeight(FontWeight.Bolder) + .textAlign(TextAlign.Center) + .textOverflow(TextOverflow.None) + .textCase(TextCase.UpperCase) + .decoration({ "type": TextDecorationType.None, "color": Color.Red }) + .fontColor(Color.Blue) + .key('Text2') + Text('Text Anto test,Text Anto test,Text Anto test,Text Anto test') + .fontSize(13) + .align(Alignment.Top) + .alignSelf(ItemAlign.End) + .borderWidth(2) + .width('100%') + .fontWeight(FontWeight.Lighter) + .decoration({ type: TextDecorationType.Overline, color: Color.Red }) + .fontColor(Color.Gray) + .key('Text3') + Text('Text Anto test,Text Anto test') + .fontSize(13) + .align(Alignment.TopStart) + .alignSelf(ItemAlign.Baseline) + .borderWidth(2) + .width('100%') + .fontWeight(FontWeight.Medium) + .fontColor(Color.Brown) + .key('Text4') + Text('Text Anto test,Text Anto test,Text Anto test') + .fontSize(13) + .align(Alignment.End) + .alignSelf(ItemAlign.Stretch) + .borderWidth(2) + .width('100%') + .fontWeight(FontWeight.Regular) + .fontColor(Color.Grey) + .key('Text5') + Text('Text Anto test,Text Anto test,Text Anto test') + .fontSize(13) + .align(Alignment.BottomEnd) + .width('100%') + .fontColor(Color.Orange) + .key('Text6') + Text('Text Anto test,Text Anto test,Text Anto test') + .fontSize(13) + .align(Alignment.Bottom) + .width('100%') + .fontColor(Color.Yellow) + .key('Text7') + Text('Text Anto test,Text Anto test,Text Anto test') + .fontSize(13) + .align(Alignment.BottomStart) + .width('100%') + .key('Text8') + + } + .key('flex') + .width('100%') + .height('100%') + } +} + + diff --git a/telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/MainAbility/pages/index.ets b/telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/MainAbility/pages/index.ets new file mode 100644 index 000000000..10359134d --- /dev/null +++ b/telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/MainAbility/pages/index.ets @@ -0,0 +1,65 @@ +// @ts-nocheck +/** + * 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 file from '@system.file'; + +import {Core, ExpectExtend, InstrumentLog, ReportExtend} from "deccjsunit/index.ets"; +import testsuite from "../test/List.test.ets"; +import featureAbility from "@ohos.ability.featureAbility"; + +@Entry +@Component +struct MyComponent { + aboutToAppear() { + console.info("start run testcase!!!!") + featureAbility.getWant() + .then((Want) => { + const core = Core.getInstance(); + const expectExtend = new ExpectExtend({ + 'id': 'extend' + }); + core.addService('expect', expectExtend); + const reportExtend = new ReportExtend(file); + core.addService('report', reportExtend); + core.init(); + core.subscribeEvent('task', reportExtend); + const configService = core.getDefaultService('config'); + Want.parameters['timeout'] = 100000 + console.info('parameters---->' + JSON.stringify(Want.parameters)); + configService.setConfig(Want.parameters); + testsuite(); + core.execute(); + console.info('Operation successful. Data: ' + JSON.stringify(Want)); + }) + .catch((error) => { + console.error('Operation failed. Cause: ' + JSON.stringify(error)); + }) + } + + build() { + Flex({ + direction: FlexDirection.Column, + alignItems: ItemAlign.Center, + justifyContent: FlexAlign.Center + }) { + Text('ACE ETS TEST') + .fontSize(50) + .fontWeight(FontWeight.Bold) + } + .width('100%') + .height('100%') + } +} + diff --git a/telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/MainAbility/test/ConnectionJsunit.test.ets b/telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/MainAbility/test/ConnectionJsunit.test.ets new file mode 100644 index 000000000..b538fa17b --- /dev/null +++ b/telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/MainAbility/test/ConnectionJsunit.test.ets @@ -0,0 +1,1002 @@ +// @ts-nocheck +/** + * 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 {describe, it, expect} from "deccjsunit/index.ets"; +import connection from '@ohos.net.connection' +import utils from './Utils.ets' + +export default function connectionJsunit() { + describe('connectionTest', function () { + const TIMEOUT = 100; + const NETID_IVVALID = 99; + const NETID_IVVALID2 = 0; + console.log("************* connection Test start*************"); + + /* + * @tc.number : Telephony_Connection_Connection_createNetConnection_0100 + * @tc.name : createNetConnection + * @tc.desc : Create a network connection with optional netSpefifier and timeout. + */ + it('Telephony_Connection_Connection_createNetConnection_0100', 0, async function (done) { + console.log("************* Telephony_Connection_Connection_createNetConnection_0100 Test start*************"); + try { + connection.createNetConnection(5000); + expect(true).assertTrue(); + } catch (error) { + expect().assertFail(); + } + console.log("************* Telephony_Connection_Connection_createNetConnection_0100 Test end*************"); + done(); + }); + + /* + * @tc.number : Telephony_Connection_Connection_createNetConnection_0200 + * @tc.name : createNetConnection + * @tc.desc : Create a network connection with optional netSpefifier and timeout. + */ + it('Telephony_Connection_Connection_createNetConnection_0200', 0, async function (done) { + console.log("************* Telephony_Connection_Connection_createNetConnection_0200 Test start*************"); + try { + connection.createNetConnection(3000); + expect(true).assertTrue(); + } catch (error) { + expect().assertFail(); + } + console.log("************* Telephony_Connection_Connection_createNetConnection_0200 Test end*************"); + done(); + }); + + /* + * @tc.number : Telephony_Connection_Connection_createNetConnection_0300 + * @tc.name : createNetConnection + * @tc.desc : Create a network connection with optional netSpefifier and timeout. + */ + it('Telephony_Connection_Connection_createNetConnection_0300', 0, async function (done) { + console.log("************* Telephony_Connection_Connection_createNetConnection_0300 Test start*************"); + try { + connection.createNetConnection(8000); + expect(true).assertTrue(); + } catch (error) { + expect().assertFail(); + } + console.log("************* Telephony_Connection_Connection_createNetConnection_0300 Test end*************"); + done(); + }); + + /* + * @tc.number : Telephony_Connection_Connection_createNetConnection_0400 + * @tc.name : createNetConnection + * @tc.desc : Create a network connection with optional netSpefifier and timeout. + */ + it('Telephony_Connection_Connection_createNetConnection_0400', 0, async function (done) { + console.log("************* Telephony_Connection_Connection_createNetConnection_0400 Test start*************"); + try { + let netSpecifier = { + netCapabilities: { + linkUpBandwidthKbps: 1000, + linkDownBandwidthKbps: 2000, + bearerTypes: [1], + networkCap: [0], + }, bearerPrivateIdentifier: '123' + } + connection.createNetConnection(netSpecifier, 5000); + expect(true).assertTrue(); + } catch (error) { + expect().assertFail(); + } + console.log("************* Telephony_Connection_Connection_createNetConnection_0400 Test end*************"); + done(); + }); + + /* + * @tc.number : Telephony_Connection_Connection_createNetConnection_0500 + * @tc.name : createNetConnection + * @tc.desc : Create a network connection with optional netSpefifier and timeout. + */ + it('Telephony_Connection_Connection_createNetConnection_0500', 0, async function (done) { + console.log("************* Telephony_Connection_Connection_createNetConnection_0500 Test start*************"); + try { + let netSpecifier = { + netCapabilities: { + linkUpBandwidthKbps: 0, + linkDownBandwidthKbps: 0, + bearerTypes: [0], + networkCap: [0], + }, bearerPrivateIdentifier: '123' + } + connection.createNetConnection(netSpecifier, 5000); + expect(true).assertTrue(); + } catch (error) { + expect().assertFail(); + } + console.log("************* Telephony_Connection_Connection_createNetConnection_0500 Test end*************"); + done(); + }); + + /* + * @tc.number : Telephony_Connection_Connection_getDefaultNet_0100 + * @tc.name : getDefaultNet + * @tc.desc : Obtains the data network that is activated by default. + */ + it('Telephony_Connection_Connection_getDefaultNet_0100', 0, async function (done) { + console.log("************* Telephony_Connection_Connection_getDefaultNet_0100 Test start*************"); + connection.getDefaultNet((error, data) => { + expect().assertFail(); + done(); + }); + expect(true).assertTrue(); + console.log("************* Telephony_Connection_Connection_getDefaultNet_0100 Test end*************"); + done(); + }); + + /* + * @tc.number : Telephony_Connection_Connection_getDefaultNet_0200 + * @tc.name : getDefaultNet + * @tc.desc : Obtains the data network that is activated by default. + */ + it('Telephony_Connection_Connection_getDefaultNet_0200', 0, async function (done) { + console.log("************* Telephony_Connection_Connection_getDefaultNet_0200 Test start*************"); + connection.getDefaultNet().then(data => { + console.log("Telephony_Connection_Connection_getDefaultNet_0200 getDefaultNet success, case fail"); + expect().assertFail(); + }).catch(err => { + console.log("Telephony_Connection_Connection_getDefaultNet_0200 getDefaultNet error, case success"); + expect(true).assertTrue(); + }); + console.log("************* Telephony_Connection_Connection_getDefaultNet_0200 Test end*************"); + done(); + }); + + /* + * @tc.number : Telephony_Connection_Connection_getAllNets_0100 + * @tc.name : getAllNets + * @tc.desc : Obtains the list of data networks that are activated. + */ + it('Telephony_Connection_Connection_getAllNets_0100', 0, async function (done) { + console.log("************* Telephony_Connection_Connection_getAllNets_0100 Test start*************"); + connection.getAllNets((error, data) => { + if (error) { + expect(true).assertTrue(); + return; + } + expect().assertFail(); + }); + done(); + console.log("************* Telephony_Connection_Connection_getAllNets_0100 Test end*************"); + }); + + /* + * @tc.number : Telephony_Connection_Connection_getAllNets_0200 + * @tc.name : getAllNets + * @tc.desc : Obtains the list of data networks that are activated. + */ + it('Telephony_Connection_Connection_getAllNets_0200', 0, async function (done) { + console.log("************* Telephony_Connection_Connection_getAllNets_0200 Test start*************"); + connection.getAllNets().then(data => { + expect(true).assertTrue(); + }).catch(err => { + console.log("Telephony_Connection_Connection_getAllNets_0200 getAllNets error "); + expect().assertFail(); + }); + done(); + console.log("************* Telephony_Connection_Connection_getAllNets_0200 Test end*************"); + }); + + /* + * @tc.number : Telephony_Connection_Connection_getConnectionProperties_0100 + * @tc.name : getConnectionProperties + * @tc.desc : Queries the connection properties of a network. + */ + it('Telephony_Connection_Connection_getConnectionProperties_0100', 0, async function (done) { + console.log("************* Telephony_Connection_Connection_getConnectionProperties_0100 Test start*************"); + connection.getConnectionProperties((error, data) => { + expect().assertFail(); + done(); + }); + expect(true).assertTrue(); + console.log("************* Telephony_Connection_Connection_getConnectionProperties_0100 Test end*************"); + done(); + }); + + /* + * @tc.number : Telephony_Connection_Connection_getConnectionProperties_0200 + * @tc.name : getConnectionProperties + * @tc.desc : Queries the connection properties of a network. + */ + it('Telephony_Connection_Connection_getConnectionProperties_0200', 0, async function (done) { + console.log("************* Telephony_Connection_Connection_getConnectionProperties_0200 Test start*************"); + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + connection.getConnectionProperties().then(data => { + expect().assertFail(); + }).catch(err => { + expect(true).assertTrue(); + }); + expect(true).assertTrue(); + console.log("************* Telephony_Connection_Connection_getConnectionProperties_0200 Test end*************"); + done(); + }); + + /* + * @tc.number : Telephony_Connection_Connection_getConnectionProperties_0300 + * @tc.name : getConnectionProperties + * @tc.desc : Queries the connection properties of a network. + */ + it('Telephony_Connection_Connection_getConnectionProperties_0300', 0, async function (done) { + console.log("************* Telephony_Connection_Connection_getConnectionProperties_0300 Test start*************"); + var handle = new connection.NetHandle(NETID_IVVALID); + connection.getConnectionProperties(handle, (error, data) => { + if (error) { + expect(true).assertTrue(); + } + }); + console.log("************* Telephony_Connection_Connection_getConnectionProperties_0300 Test end*************"); + done(); + }); + + /* + * @tc.number : Telephony_Connection_Connection_getConnectionProperties_0400 + * @tc.name : getConnectionProperties + * @tc.desc : Queries the connection properties of a network. + */ + it('Telephony_Connection_Connection_getConnectionProperties_0400', 0, async function (done) { + console.log("************* Telephony_Connection_Connection_getConnectionProperties_0400 Test start*************"); + connection.getAllNets((error, value) => { + if (error) { + expect().assertFail(); + done(); + return; + } else { + connection.getConnectionProperties(value[0], (error, value_2) => { + if (!error) { + console.log(`Telephony_Connection_Connection_getConnectionProperties_0400 get value success: ${JSON.stringify(value_2)}`); + } + }); + } + }); + expect(true).assertTrue(); + done(); + console.log("************* Telephony_Connection_Connection_getConnectionProperties_0400 Test end*************"); + }); + + /* + * @tc.number : Telephony_Connection_Connection_getNetCapabilities_0100 + * @tc.name : getNetCapabilities + * @tc.desc : Obtains {@link NetCapabilities} of a {@link NetHandle} object. + */ + it('Telephony_Connection_Connection_getNetCapabilities_0100', 0, async function (done) { + console.log("************* Telephony_Connection_Connection_getNetCapabilities_0100 Test start*************"); + connection.getNetCapabilities((error, data) => { + expect().assertFail(); + done(); + }); + expect(true).assertTrue(); + console.log("************* Telephony_Connection_Connection_getNetCapabilities_0100 Test end*************"); + done(); + }); + + /* + * @tc.number : Telephony_Connection_Connection_getNetCapabilities_0200 + * @tc.name : getNetCapabilities + * @tc.desc : Obtains {@link NetCapabilities} of a {@link NetHandle} object. + */ + it('Telephony_Connection_Connection_getNetCapabilities_0200', 0, async function (done) { + console.log("************* Telephony_Connection_Connection_getNetCapabilities_0200 Test start*************"); + var handle = new connection.NetHandle(NETID_IVVALID); + connection.getNetCapabilities(handle, (error, data) => { + if (!error) { + expect().assertFail(); + done(); + return; + } + }); + expect(true).assertTrue(); + console.log("************* Telephony_Connection_Connection_getNetCapabilities_0200 Test end*************"); + done(); + }); + + /* + * @tc.number : Telephony_Connection_Connection_getNetCapabilities_0300 + * @tc.name : getNetCapabilities + * @tc.desc : Obtains {@link NetCapabilities} of a {@link NetHandle} object. + */ + it('Telephony_Connection_Connection_getNetCapabilities_0300', 0, async function (done) { + console.log("************* Telephony_Connection_Connection_getNetCapabilities_0300 Test start*************"); + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + connection.getNetCapabilities().then(data => { + expect().assertFail(); + }).catch(err => { + expect(true).assertTrue(); + }); + console.log("************* Telephony_Connection_Connection_getNetCapabilities_0300 Test end*************"); + done(); + }); + + /* + * @tc.number : Telephony_Connection_Connection_getNetCapabilities_0400 + * @tc.name : getNetCapabilities + * @tc.desc : Obtains {@link NetCapabilities} of a {@link NetHandle} object. + */ + it('Telephony_Connection_Connection_getNetCapabilities_0400', 0, async function (done) { + console.log("************* Telephony_Connection_Connection_getNetCapabilities_0400 Test start*************"); + let caseName = 'Telephony_Connection_Connection_getNetCapabilities_0400'; + connection.getAllNets((error, value) => { + if (error) { + console.log(`${caseName} get data fail: ${error}`); + expect().assertFail(); + done(); + return; + } else { + console.log(`getAllNets netID value : ${JSON.stringify(value[0].netId)}`); + connection.getNetCapabilities(value[0], (error, data) => { + if (error) { + console.log(`${caseName} get ID fail: ${error}`); + expect().assertFail(); + done(); + } else { + console.log(`${caseName} get value success: ${JSON.stringify(data)}`); + console.log(`${caseName} get value success123456: ${JSON.stringify(data.netCaps_)}`); + console.log(`${caseName} get value success122222: ${JSON.stringify(data.netCaps_[0].netCap)}`); + expect(data.netCaps_[0].netCap != "").assertTrue(); + done(); + } + }); + } + }); + console.log("************* Telephony_Connection_Connection_getNetCapabilities_0400 Test end*************"); + done(); + }); + + /* + * @tc.number : Telephony_Connection_Connection_hasDefaultNet_0100 + * @tc.name : hasDefaultNet + * @tc.desc : Checks whether the default data network is activated. + */ + it('Telephony_Connection_Connection_hasDefaultNet_0100', 0, async function (done) { + console.log("************* Telephony_Connection_Connection_hasDefaultNet_0100 Test start*************"); + connection.hasDefaultNet((error, data) => { + if (error) { + expect(true).assertTrue(); + done(); + return; + } + expect().assertFail(); + done(); + }); + console.log("************* Telephony_Connection_Connection_hasDefaultNet_0100 Test end*************"); + done(); + }); + + /* + * @tc.number : Telephony_Connection_Connection_hasDefaultNet_0200 + * @tc.name : hasDefaultNet + * @tc.desc : Checks whether the default data network is activated. + */ + it('Telephony_Connection_Connection_hasDefaultNet_0200', 0, async function (done) { + console.log("************* Telephony_Connection_Connection_hasDefaultNet_0200 Test start*************"); + connection.hasDefaultNet().then(activated => { + expect().assertFail(); + }).catch(error => { + console.log(`Telephony_Connection_Connection_hasDefaultNet_0200 hasDefaultNet error,case success,error:${ + toString(error)}`); + expect(true).assertTrue(); + }) + console.log("************* Telephony_Connection_Connection_hasDefaultNet_0200 Test end*************"); + done(); + }); + + + /* + * @tc.number : Telephony_Connection_Connection_enableAirplaneMode_0100 + * @tc.name : enableAirplaneMode + * @tc.desc : Enables the airplane mode for a device. + */ + it('Telephony_Connection_Connection_enableAirplaneMode_0100', 0, async function (done) { + console.log("************* Telephony_Connection_Connection_enableAirplaneMode_0100 Test start*************"); + connection.enableAirplaneMode((error, data) => { + if (error) { + expect(true).assertTrue(); + done(); + return; + } + expect().assertFail(); + done(); + }); + console.log("************* Telephony_Connection_Connection_enableAirplaneMode_0100 Test end*************"); + done(); + }); + + /* + * @tc.number : Telephony_Connection_Connection_enableAirplaneMode_0200 + * @tc.name : enableAirplaneMode + * @tc.desc : Enables the airplane mode for a device. + */ + it('Telephony_Connection_Connection_enableAirplaneMode_0200', 0, async function (done) { + console.log("************* Telephony_Connection_Connection_enableAirplaneMode_0200 Test start*************"); + connection.enableAirplaneMode().then(data => { + expect(true).assertTrue(); + }).catch(err => { + expect().assertFail(); + }); + console.log("************* Telephony_Connection_Connection_enableAirplaneMode_0200 Test end*************"); + done(); + }); + + /* + * @tc.number : Telephony_Connection_Connection_disableAirplaneMode_0100 + * @tc.name : disableAirplaneMode + * @tc.desc : Disables the airplane mode for a device. + */ + it('Telephony_Connection_Connection_disableAirplaneMode_0100', 0, async function (done) { + console.log("************* Telephony_Connection_Connection_disableAirplaneMode_0100 Test start*************"); + connection.disableAirplaneMode((error, data) => { + if (error) { + expect(true).assertTrue(); + done(); + return; + } + expect().assertFail(); + done(); + }); + console.log("************* Telephony_Connection_Connection_disableAirplaneMode_0100 Test end*************"); + done(); + }); + + /* + * @tc.number : Telephony_Connection_Connection_disableAirplaneMode_0200 + * @tc.name : disableAirplaneMode + * @tc.desc : Disables the airplane mode for a device. + */ + it('Telephony_Connection_Connection_disableAirplaneMode_0200', 0, async function (done) { + console.log("************* Telephony_Connection_Connection_reportNetConnected_0200 Test start*************"); + connection.disableAirplaneMode().then(data => { + expect(true).assertTrue(); + }).catch(err => { + expect().assertFail(); + }); + console.log("************* Telephony_Connection_Connection_disableAirplaneMode_0200 Test end*************"); + done(); + }); + + + /* + * @tc.number : Telephony_Connection_Connection_reportNetConnected_0100 + * @tc.name : reportNetConnected + * @tc.desc : Reports the network state is connected. + */ + it('Telephony_Connection_Connection_reportNetConnected_0100', 0, async function (done) { + console.log("************* Telephony_Connection_Connection_reportNetConnected_0100 Test start*************"); + connection.reportNetConnected((error, data) => { + if (error) { + expect(true).assertTrue(); + done(); + return; + } + expect().assertFail(); + done(); + }); + expect(true).assertTrue(); + console.log("************* Telephony_Connection_Connection_reportNetConnected_0100 Test end*************"); + done(); + }); + + /* + * @tc.number : Telephony_Connection_Connection_reportNetConnected_0200 + * @tc.name : reportNetConnected + * @tc.desc : Reports the network state is connected. + */ + it('Telephony_Connection_Connection_reportNetConnected_0200', 0, async function (done) { + console.log("************* Telephony_Connection_Connection_reportNetConnected_0200 Test start*************"); + var handle = new connection.NetHandle(NETID_IVVALID); + connection.reportNetConnected(handle, (error, data) => { + if (error) { + expect(true).assertTrue(); + done(); + return; + } + expect().assertFail(); + done(); + }); + expect(true).assertTrue(); + console.log("************* Telephony_Connection_Connection_reportNetConnected_0200 Test end*************"); + done(); + }); + + /* + * @tc.number : Telephony_Connection_Connection_reportNetConnected_0300 + * @tc.name : reportNetConnected + * @tc.desc : Reports the network state is connected. + */ + it('Telephony_Connection_Connection_reportNetConnected_0300', 0, async function (done) { + console.log("************* Telephony_Connection_Connection_reportNetConnected_0300 Test start*************"); + var handle = new connection.NetHandle(NETID_IVVALID2); + connection.reportNetConnected(handle).then(() => { + expect().assertFail(); + }).catch(err => { + expect(true).assertTrue(); + }); + expect(true).assertTrue(); + console.log("************* Telephony_Connection_Connection_reportNetConnected_0300 Test end*************"); + done(); + }); + + /* + * @tc.number : Telephony_Connection_Connection_reportNetConnected_0400 + * @tc.name : reportNetConnected + * @tc.desc : Reports the network state is connected. + */ + it('Telephony_Connection_Connection_reportNetConnected_0400', 0, async function (done) { + console.log("************* Telephony_Connection_Connection_reportNetConnected_0400 Test start*************"); + var handle = new connection.NetHandle(NETID_IVVALID); + connection.reportNetConnected(handle).then(() => { + expect().assertFail(); + }).catch(err => { + expect(true).assertTrue(); + }); + expect(true).assertTrue(); + console.log("************* Telephony_Connection_Connection_reportNetConnected_0400 Test end*************"); + done(); + }); + + /* + * @tc.number : Telephony_Connection_Connection_reportNetDisconnected_0100 + * @tc.name : reportNetDisconnected + * @tc.desc : Reports the network state is disconnected. + */ + it('Telephony_Connection_Connection_reportNetDisconnected_0100', 0, async function (done) { + console.log("************* Telephony_Connection_Connection_reportNetDisconnected_0100 Test start*************"); + connection.reportNetDisconnected((error, data) => { + if (error) { + expect(true).assertTrue(); + done(); + return; + } + expect().assertFail(); + done(); + }); + expect(true).assertTrue(); + console.log("************* Telephony_Connection_Connection_reportNetDisconnected_0100 Test end*************"); + done(); + }); + + /* + * @tc.number : Telephony_Connection_Connection_reportNetDisconnected_0200 + * @tc.name : reportNetDisconnected + * @tc.desc : Reports the network state is disconnected. + */ + it('Telephony_Connection_Connection_reportNetDisconnected_0200', 0, async function (done) { + console.log("************* Telephony_Connection_Connection_reportNetDisconnected_0200 Test start*************"); + var handle = new connection.NetHandle(NETID_IVVALID); + connection.reportNetDisconnected(handle, (error, data) => { + if (error) { + expect(true).assertTrue(); + done(); + return; + } + expect().assertFail(); + done(); + }); + expect(true).assertTrue(); + console.log("************* Telephony_Connection_Connection_reportNetDisconnected_0200 Test end*************"); + done(); + }); + + /* + * @tc.number : Telephony_Connection_Connection_reportNetDisconnected_0300 + * @tc.name : reportNetDisconnected + * @tc.desc : Reports the network state is disconnected. + */ + it('Telephony_Connection_Connection_reportNetDisconnected_0300', 0, async function (done) { + console.log("************* Telephony_Connection_Connection_reportNetDisconnected_0300 Test start*************"); + var handle = new connection.NetHandle(NETID_IVVALID2); + connection.reportNetDisconnected(handle).then(() => { + expect().assertFail(); + }).catch(err => { + expect(true).assertTrue(); + }); + expect(true).assertTrue(); + console.log("************* Telephony_Connection_Connection_reportNetDisconnected_0300 Test end*************"); + done(); + }); + + /* + * @tc.number : Telephony_Connection_Connection_reportNetDisconnected_0400 + * @tc.name : reportNetDisconnected + * @tc.desc : Reports the network state is disconnected. + */ + it('Telephony_Connection_Connection_reportNetDisconnected_0400', 0, async function (done) { + console.log("************* Telephony_Connection_Connection_reportNetDisconnected_0400 Test start*************"); + var handle = new connection.NetHandle(NETID_IVVALID); + connection.reportNetDisconnected(handle).then(() => { + expect().assertFail(); + }).catch(err => { + expect(true).assertTrue(); + }); + expect(true).assertTrue(); + console.log("************* Telephony_Connection_Connection_reportNetDisconnected_0400 Test end*************"); + done(); + }); + + /* + * @tc.number : Telephony_Connection_Connection_getAddressesByName_0100 + * @tc.name : getAddressesByName + * @tc.desc : Resolves the host name to obtain all IP addresses based on the default data network. + */ + it('Telephony_Connection_Connection_getAddressesByName_0100', 0, async function (done) { + console.log("************* Telephony_Connection_Connection_getAddressesByName_0100 Test start*************"); + connection.getAddressesByName('www.test.com', (error, data) => { + if (error) { + expect(true).assertTrue(); + done(); + return; + } + expect().assertFail(); + done(); + }); + expect(true).assertTrue(); + console.log("************* Telephony_Connection_Connection_getAddressesByName_0100 Test end*************"); + done(); + }); + + /* + * @tc.number : Telephony_Connection_Connection_getAddressesByName_0200 + * @tc.name : getAddressesByName + * @tc.desc : Resolves the host name to obtain all IP addresses based on the default data network. + */ + it('Telephony_Connection_Connection_getAddressesByName_0200', 0, async function (done) { + console.log("************* Telephony_Connection_Connection_getAddressesByName_0200 Test start*************"); + connection.getAddressesByName('www.test.com').then(data => { + expect().assertFail(); + done(); + return; + }).catch(error => { + console.log(`Telephony_Connection_Connection_getAddressesByName_0200 getAddressesByName error,case success,error:${ + toString(error)}`); + expect(true).assertTrue(); + }) + console.log("************* Telephony_Connection_Connection_getAddressesByName_0200 Test end*************"); + done(); + }); + + /** + * @tc.number Telephony_Connection_Connection_netAvailable_0100 + * @tc.name netAvailable + * @tc.desc Function test + */ + it('Telephony_Connection_Connection_netAvailable_0100', 0, async function (done) { + console.log("************* Telephony_Connection_Connection_netAvailable_0100 Test start*************"); + try { + let netConn = connection.createNetConnection(); + netConn.on('netAvailable', (error, value) => { + if (error) { + console.log(`netAvailable error: ${error}`); + } + }); + } catch (error) { + expect().assertFail(); + } + expect(true).assertTrue(); + done(); + console.log("************* Telephony_Connection_Connection_netAvailable_0100 Test end*************"); + }) + + /** + * @tc.number Telephony_Connection_Connection_netBlockStatusChange_0100 + * @tc.name netBlockStatusChange + * @tc.desc Function test + */ + it('Telephony_Connection_Connection_netBlockStatusChange_0100', 0, async function (done) { + console.log("************* Telephony_Connection_Connection_netBlockStatusChange_0100 Test start*************"); + try { + let netConn = connection.createNetConnection(); + netConn.on('netBlockStatusChange', (error, value) => { + if (error) { + console.log(`netBlockStatusChange error: ${error}`); + } + }); + } catch (error) { + expect().assertFail(); + } + expect(true).assertTrue(); + done(); + console.log("************* Telephony_Connection_Connection_netBlockStatusChange_0100 Test end*************"); + }) + + /** + * @tc.number Telephony_Connection_Connection_netCapabilitiesChange_0100 + * @tc.name netCapabilitiesChange + * @tc.desc Function test + */ + it('Telephony_Connection_Connection_netCapabilitiesChange_0100', 0, async function (done) { + console.log("************* Telephony_Connection_Connection_netCapabilitiesChange_0100 Test start*************"); + try { + let netConn = connection.createNetConnection(); + netConn.on('netCapabilitiesChange', (error, value) => { + if (error) { + console.log(`netCapabilitiesChange error: ${error}`); + } + }); + } catch (error) { + expect().assertFail(); + } + expect(true).assertTrue(); + done(); + console.log("************* Telephony_Connection_Connection_netCapabilitiesChange_0100 Test end*************"); + }) + + /** + * @tc.number Telephony_Connection_Connection_netConnectionPropertiesChange_0100 + * @tc.name netConnectionPropertiesChange + * @tc.desc Function test + */ + it('Telephony_Connection_Connection_netConnectionPropertiesChange_0100', 0, async function (done) { + console.log("************* Telephony_Connection_Connection_netConnectionPropertiesChange_0100 Test start*************"); + try { + let netConn = connection.createNetConnection(); + netConn.on('netConnectionPropertiesChange', (error, value) => { + if (error) { + console.log(`netConnectionPropertiesChange error: ${error}`); + } + }); + } catch (error) { + expect().assertFail(); + } + expect(true).assertTrue(); + done(); + console.log("************* Telephony_Connection_Connection_netConnectionPropertiesChange_0100 Test end*************"); + }) + + /** + * @tc.number Telephony_Connection_Connection_netLost_0100 + * @tc.name netLost + * @tc.desc Function test + */ + it('Telephony_Connection_Connection_netLost_0100', 0, async function (done) { + console.log("************* Telephony_Connection_Connection_netLost_0100 Test start*************"); + try { + let netConn = connection.createNetConnection(); + netConn.on('netLost', (error, value) => { + if (error) { + console.log(`netLost error: ${error}`); + } + }); + } catch (error) { + expect().assertFail(); + } + expect(true).assertTrue(); + done(); + console.log("************* Telephony_Connection_Connection_netLost_0100 Test end*************"); + }) + + /** + * @tc.number Telephony_Connection_Connection_netUnavailable_0100 + * @tc.name netUnavailable + * @tc.desc Function test + */ + it('Telephony_Connection_Connection_netUnavailable_0100', 0, async function (done) { + console.log("************* Telephony_Connection_Connection_netUnavailable_0100 Test start*************"); + try { + let netConn = connection.createNetConnection(); + netConn.on('netUnavailable', (error, value) => { + if (error) { + console.log(`netUnavailable error: ${error}`); + } + }); + } catch (error) { + expect().assertFail(); + } + expect(true).assertTrue(); + done(); + console.log("************* Telephony_Connection_Connection_netUnavailable_0100 Test end*************"); + }) + + /** + * @tc.number Telephony_Connection_Connection_NetSpecifier_0100 + * @tc.name NetSpecifier + * @tc.desc netCapabilities bearerPrivateIdentifier test + */ + it('Telephony_Connection_Connection_NetSpecifier_0100', 0, async function (done) { + console.log("************* Telephony_Connection_Connection_NetSpecifier_0100 Test start*************"); + try { + let netSpecifier = { + netCapabilities: { + linkUpBandwidthKbps: 1, + linkDownBandwidthKbps: 2, + bearerTypes: [0], + networkCap: [11], + }, bearerPrivateIdentifier: '123' + } + connection.createNetConnection(netSpecifier, TIMEOUT); + } catch (error) { + expect().assertFail(); + } + expect(true).assertTrue(); + done(); + console.log("************* Telephony_Connection_Connection_NetSpecifier_0100 Test end*************"); + }) + + /** + * @tc.number Telephony_Connection_Connection_bindSocket_0100 + * @tc.name bindSocket + * @tc.desc Function test + */ + it('Telephony_Connection_Connection_bindSocket_0100', 0, async function (done) { + console.log("************* Telephony_Connection_Connection_bindSocket_0100 Test start*************"); + connection.getDefaultNet().then((handle) => { + handle.bindSocket(1, (error, value) => { + if (error) { + expect().assertFail(); + done(); + } + }); + }).catch((error) => { + expect(true).assertTrue(); + }); + done(); + console.log("************* Telephony_Connection_Connection_bindSocket_0100 Test end*************"); + }) + + /** + * @tc.number Telephony_Connection_Connection_NetHandle_getAddressesByName_0100 + * @tc.name getAddressesByName + * @tc.desc Function test + */ + it('Telephony_Connection_Connection_NetHandle_getAddressesByName_0100', 0, async function (done) { + console.log("************* Telephony_Connection_Connection_NetHandle_getAddressesByName_0100 Test start*************"); + connection.getDefaultNet().then((handle) => { + handle.getAddressesByName(addressBaidu, (error, value) => { + if (error) { + expect().assertFail(); + done(); + } + }); + }).catch((error) => { + expect(true).assertTrue(); + }); + done(); + console.log("************* Telephony_Connection_Connection_NetHandle_getAddressesByName_0100 Test end*************"); + }) + + /** + * @tc.number Telephony_Connection_Connection_getAddressByName_0100 + * @tc.name getAddressByName + * @tc.desc Function test + */ + it('Telephony_Connection_Connection_getAddressByName_0100', 0, async function (done) { + console.log("************* Telephony_Connection_Connection_getAddressByName_0100 Test start*************"); + connection.getDefaultNet().then((handle) => { + handle.getAddressByName(addressBaidu, (error, value) => { + if (error) { + expect().assertFail(); + } + done(); + }); + }).catch((error) => { + expect(true).assertTrue(); + }); + done(); + console.log("************* Telephony_Connection_Connection_getAddressByName_0100 Test end*************"); + }) + + /** + * @tc.number Telephony_Connection_Connection_linkUpBandwidthKbps_0100 + * @tc.name linkUpBandwidthKbps + * @tc.desc linkUpBandwidthKbps test + */ + it('Telephony_Connection_Connection_linkUpBandwidthKbps_0100', 0, async function (done) { + console.log("************* Telephony_Connection_Connection_linkUpBandwidthKbps_0100 Test start*************"); + try { + let netSpecifier = { + netCapabilities: { + linkUpBandwidthKbps: 10, + linkDownBandwidthKbps: 22, + bearerTypes: [0], + networkCap: [11], + }, bearerPrivateIdentifier: '456' + } + connection.createNetConnection(netSpecifier, TIMEOUT); + } catch (error) { + expect().assertFail(); + } + expect(true).assertTrue(); + done(); + console.log("************* Telephony_Connection_Connection_linkUpBandwidthKbps_0100 Test end*************"); + }) + + /** + * @tc.number Telephony_Connection_Connection_linkDownBandwidthKbps_0100 + * @tc.name linkDownBandwidthKbps + * @tc.desc nlinkDownBandwidthKbps test + */ + it('Telephony_Connection_Connection_linkDownBandwidthKbps_0100', 0, async function (done) { + console.log("************* Telephony_Connection_Connection_linkDownBandwidthKbps_0100 Test start*************"); + try { + let netSpecifier = { + netCapabilities: { + linkUpBandwidthKbps: 44, + linkDownBandwidthKbps: 55, + bearerTypes: [1], + networkCap: [12], + }, bearerPrivateIdentifier: '789' + } + connection.createNetConnection(netSpecifier, TIMEOUT); + } catch (error) { + expect().assertFail(); + } + expect(true).assertTrue(); + done(); + console.log("************* Telephony_Connection_Connection_linkDownBandwidthKbps_0100 Test end*************"); + }) + + /** + * @tc.number Telephony_Connection_Connection_networkCap_0100 + * @tc.name networkCap + * @tc.desc networkCap test + */ + it('Telephony_Connection_Connection_networkCap_0100', 0, async function (done) { + console.log("************* Telephony_Connection_Connection_networkCap_0100 Test start*************"); + try { + let netSpecifier = { + netCapabilities: { + linkUpBandwidthKbps: 18, + linkDownBandwidthKbps: 29, + bearerTypes: [3], + networkCap: [5], + }, bearerPrivateIdentifier: '321' + } + connection.createNetConnection(netSpecifier, TIMEOUT); + } catch (error) { + expect().assertFail(); + } + expect(true).assertTrue(); + done(); + console.log("************* Telephony_Connection_Connection_networkCap_0100 Test end*************"); + }) + + /** + * @tc.number Telephony_Connection_Connection_bearerTypes_0100 + * @tc.name bearerTypes + * @tc.desc bearerTypes test + */ + it('Telephony_Connection_Connection_bearerTypes_0100', 0, async function (done) { + console.log("************* Telephony_Connection_Connection_bearerTypes_0100 Test start*************"); + try { + let netSpecifier = { + netCapabilities: { + linkUpBandwidthKbps: 41, + linkDownBandwidthKbps: 62, + bearerTypes: [1], + networkCap: [9], + }, bearerPrivateIdentifier: '876' + } + connection.createNetConnection(netSpecifier, TIMEOUT); + } catch (error) { + expect().assertFail(); + } + expect(true).assertTrue(); + done(); + console.log("************* Telephony_Connection_Connection_bearerTypes_0100 Test end*************"); + }) + + console.log("************* connection Test end*************"); + }) +} diff --git a/telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/MainAbility/test/ConnectionSecondJsUnit.test.ets b/telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/MainAbility/test/ConnectionSecondJsUnit.test.ets new file mode 100644 index 000000000..5c621bb8c --- /dev/null +++ b/telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/MainAbility/test/ConnectionSecondJsUnit.test.ets @@ -0,0 +1,431 @@ +// @ts-nocheck +/* + * 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 connection from '@ohos.net.connection'; +import {describe, it, expect} from 'deccjsunit/index'; +import utils from './Utils.ets' + +export default function connectionSecondJsUnit() { + describe("connectionSecondJsunit", function () { + /** + * @tc.name: Telephony_connection_ConnectionProperties_0100 + * @tc.desc: ConnectionProperties Properties detection + * @tc.author: kangyuntao + */ + it("Telephony_connection_ConnectionProperties_0100", 0, function (done) { + console.log("-----------------------Telephony ConnectionProperties Test is starting-----------------------"); + let caseName = 'Telephony_connection_ConnectionProperties_0100'; + try { + let resultLinkAddresses = { + linkAddresses: [{ + address: { + address: "192.168.1.2" + } + }] + }; + let resultDnses = { + dnses: [{ + address: "192.168.1.3" + }] + }; + let resultRoutes = { + routes: [{ + gateway: { + address: "192.168.1.1" + } + }] + }; + let resultName = { + interfaceName: '123' + }; + let resultMtu = { + mtu: 123 + }; + console.log(caseName + ` resultLinkAddresses.linkAddresses.length: ` + resultLinkAddresses.linkAddresses.length); + console.log(caseName + ` resultDnses.dnses.length: ` + resultDnses.dnses.length); + console.log(caseName + ` resultRoutes.routes.length: ` + resultRoutes.routes.length); + expect(resultLinkAddresses.linkAddresses.length > 0).assertTrue(); + expect(resultDnses.dnses.length > 0).assertTrue(); + expect(resultRoutes.routes.length > 0).assertTrue(); + expect("123").assertEqual(resultName.interfaceName); + expect(123).assertEqual(resultMtu.mtu); + console.log("-----------------------Telephony ConnectionProperties Test end-----------------------"); + done(); + } catch (err) { + console.log(`Telephony_ConnectionProperties_0100 err ` + err); + } + }) + + /** + * @tc.name: 'Telephony_connection_getConnectionProperties_Async_0200 + * @tc.desc: getConnectionProperties detection + * @tc.author: kangyuntao + */ + it('Telephony_connection_getConnectionProperties_Async_0200', 0, async function (done) { + console.log("-----------------------Telephony getConnectionProperties Test is starting-----------------------"); + if(utils.notCheck){ + expect(true).assertTrue(); + done(); + return; + } + let caseName = 'Telephony_connection_getConnectionProperties_Async_0200'; + connection.getAllNets((error, value) => { + if (error) { + console.log(`${caseName} get data fail: ${error}`); + expect().assertFail(); + done(); + return; + } else { + console.log(`${caseName} get netID value : ${JSON.stringify(value[0])}`); + connection.getConnectionProperties(value[0], (error, value) => { + if (error) { + console.log(`${caseName} get ID fail: ${error}`); + expect().assertFail(); + done(); + } else { + console.log(`${caseName} get value success: ${JSON.stringify(value)}`); + console.log(caseName + " ifaceName: " + value.ifaceName); + console.log(caseName + " mtu: " + value.mtu); + console.log(caseName + " netAddrList.length: " + value.netAddrList.length); + expect(value.ifaceName == "").assertTrue(); + expect(value.domain == "").assertTrue(); + expect(value.mtu == 0).assertTrue(); + expect(value.netAddrList.length == 0).assertTrue(); + expect(value.dnsList.length == 0).assertTrue(); + expect(value.routeList.length == 0).assertTrue(); + done(); + } + }); + } + }); + console.log("-----------------------Telephony getConnectionProperties Test end-----------------------"); + }); + + /** + * @tc.name: Telephony_connection_RouteInfo_0300 + * @tc.desc: RouteInfo Properties detection + * @tc.author: kangyuntao + */ + it("Telephony_connection_RouteInfo_0300", 0, async function (done) { + console.log("----------------------RouteInfo Properties Test is starting-----------------------"); + try { + let resultDefaultRoute = { + isDefaultRoute: true + }; + let resultHasGateway = { + hasGateway: true + }; + expect(true).assertEqual(resultDefaultRoute.isDefaultRoute); + expect(true).assertEqual(resultHasGateway.hasGateway); + console.log("-----------------------RouteInfo Properties Test end-----------------------"); + done(); + } catch (err) { + console.log(`Telephony_connection_RouteInfo_0300 err ` + err); + } + }) + + /** + * @tc.name: 'Telephony_connection_getRouteInfo_Async_0400 + * @tc.desc: getRouteInfo Properties detection + * @tc.author: kangyuntao + */ + it('Telephony_connection_getRouteInfo_Async_0400', 0, async function (done) { + console.log("-----------------------Telephony getRouteInfo Test is starting-----------------------"); + let caseName = 'Telephony_connection_getRouteInfo_Async_0400'; + connection.getAllNets((error, value) => { + if (error) { + console.log(`${caseName} get data fail: ${error}`); + expect().assertFail(); + done(); + return; + } else { + console.log(`${caseName} get netID value : ${JSON.stringify(value[0])}`); + connection.getConnectionProperties(value[0], (error, value) => { + if (error) { + console.log(`${caseName} get ID fail: ${error}`); + expect().assertFail(); + done(); + } else { + console.log(`${caseName} get value success: ${JSON.stringify(value)}`); + console.log(caseName + " value.routeList.length: " + value.routeList.length); + if (value.routeList.length > 0) { + expect(value.routeList[0].hasGateway).assertTrue(); + expect(value.routeList[0].isDefaultRoute).assertTrue(); + } + done(); + } + }); + } + }); + console.log("----------------------Telephony getRouteInfo Test end-----------------------"); + }); + + + /** + * @tc.name: Telephony_connection_LinkAddress_0500 + * @tc.desc: LinkAddress Properties detection + * @tc.author: kangyuntao + */ + it("Telephony_connection_LinkAddress_0500", 0, async function (done) { + console.log("----------------------LinkAddress Properties Test is starting-----------------------"); + try { + let resultPrefixLength = { + prefixLength: 10 + }; + expect(10).assertEqual(resultPrefixLength.prefixLength); + console.log("-----------------------LinkAddress Properties Test end-----------------------"); + done(); + } catch (err) { + console.log(`Telephony_connection_LinkAddress_0500 err ` + err); + } + }) + + /** + * @tc.name: Telephony_connection_getLinkAddress_Async_0600 + * @tc.desc: getLinkAddress Properties detection + * @tc.author: kangyuntao + */ + it('Telephony_connection_getLinkAddress_Async_0600', 0, async function (done) { + console.log("-----------------------Telephony getLinkAddress Test is starting-----------------------"); + let caseName = 'Telephony_connection_getLinkAddress_Async_0600'; + connection.getAllNets((error, value) => { + if (error) { + console.log(`${caseName} get data fail: ${error}`); + expect().assertFail(); + done(); + return; + } else { + console.log(`${caseName} get netID value : ${JSON.stringify(value[0])}`); + connection.getConnectionProperties(value[0], (error, value) => { + if (error) { + console.log(`${caseName} get ID fail: ${error}`); + expect().assertFail(); + done(); + } else { + console.log(`${caseName} get value success: ${JSON.stringify(value)}`); + console.log(caseName + " value.dnsList.length: " + value.dnsList.length); + if (value.dnsList.length > 0) { + expect(value.dnsList[0].prefixLength != 0).assertTrue(); + } + done(); + } + }); + } + }); + console.log("-----------------------Telephony getLinkAddress Test end-----------------------"); + }); + + /** + * @tc.name: Telephony_connection_NetAddress_0700 + * @tc.desc: NetAddress Properties detection + * @tc.author: kangyuntao + */ + it("Telephony_connection_NetAddress_0700", 0, async function (done) { + console.log("----------------------NetAddress Properties Test is starting-----------------------"); + try { + let resultPort = { + port: 23 + }; + expect(23).assertEqual(resultPort.port); + console.log("-----------------------NetAddress Properties Test end-----------------------"); + done(); + } catch (err) { + console.log(`"Telephony_connection_NetAddress_0700 err ` + err); + } + }) + + /** + * @tc.name: Telephony_connection_getNetAddress_Async_0800 + * @tc.desc: getNetAddress Properties detection + * @tc.author: kangyuntao + */ + it('Telephony_connection_getNetAddress_Async_0800', 0, async function (done) { + console.log("-----------------------Telephony getNetAddress Test is starting-----------------------"); + let caseName = 'Telephony_connection_getNetAddress_Async_0800'; + connection.getAllNets((error, value) => { + if (error) { + console.log(`${caseName} get data fail: ${error}`); + expect().assertFail(); + done(); + return; + } else { + console.log(`${caseName} get netID value : ${JSON.stringify(value[0])}`); + connection.getConnectionProperties(value[0], (error, value) => { + if (error) { + console.log(`${caseName} get ID fail: ${error}`); + expect().assertFail(); + done(); + } else { + console.log(`${caseName} get value success: ${JSON.stringify(value)}`); + console.log(caseName + 'value.netAddrList.length:' + value.netAddrList.length); + if (value.netAddrList.length > 0) { + expect(value.netAddrList[0].port != 0).assertTrue(); + } + done(); + } + }); + } + }); + console.log("-----------------------Telephony getNetAddress Test end-----------------------"); + }); + + /** + * @tc.name: Telephony_connection_NetCap_0900 + * @tc.desc: NetCap Properties detection + * @tc.author: kangyuntao + */ + it("Telephony_connection_NetCap_0900", 0, async function (done) { + console.log("-----------------------Telephony NetCap Properties Test is starting-----------------------"); + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + try { + console.log("Telephony_connection_NetCap_0900 NetCap: " + connection.NetCap); + expect(0).assertEqual(connection.NetCap.NET_CAPABILITY_MMS); + expect(11).assertEqual(connection.NetCap.NET_CAPABILITY_NOT_METERED); + expect(12).assertEqual(connection.NetCap.NET_CAPABILITY_INTERNET); + expect(15).assertEqual(connection.NetCap.NET_CAPABILITY_NOT_VPN); + expect(16).assertEqual(connection.NetCap.NET_CAPABILITY_VALIDATED); + console.log("-----------------------Telephony NetCap Properties Test end-----------------------"); + done(); + } catch (err) { + console.log(`Telephony_connection_NetCap_0900 err ` + err); + } + }) + + /** + * @tc.name: Telephony_connection_getNetCap_Async_1000 + * @tc.desc: getNetCap Properties detection + * @tc.author: kangyuntao + */ + it('Telephony_connection_getNetCap_Async_1000', 0, async function (done) { + console.log("-----------------------Telephony getNetCap Test is starting-----------------------"); + let caseName = 'Telephony_connection_getNetCap_Async_1000'; + connection.getAllNets((error, value) => { + if (error) { + console.log(`${caseName} get data fail: ${error}`); + expect().assertFail(); + done(); + return; + } else { + console.log(`Telephony_connection getAllNets netID value : ${JSON.stringify(value[0].netId)}`); + connection.getNetCapabilities(value[0], (error, data) => { + if (error) { + console.log(`${caseName} get ID fail: ${error}`); + expect().assertFail(); + done(); + } else { + console.log(`${caseName} get value success: ${JSON.stringify(data)}`); + console.log(`${caseName} get value successNetCap: ${JSON.stringify(data.netCaps_[0].netCap)}`); + expect(data.netCaps_[0].netCap != "").assertTrue(); + done(); + } + }); + } + }); + console.log("-----------------------Telephony getNetCap Test is end-----------------------"); + }); + + /** + * @tc.name: Telephony_connection_NetBearType_1100 + * @tc.desc: NetBearType Properties detection + * @tc.author: kangyuntao + */ + it("Telephony_connection_NetBearType_1100", 0, async function (done) { + console.log("-----------------------Telephony NetBearType Properties Test is starting-----------------------"); + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + try { + console.log("Telephony_connection_NetBearType_1100 NetBearType: " + connection.NetBearType); + expect(0).assertEqual(connection.NetBearType.BEARER_CELLULAR); + expect(1).assertEqual(connection.NetBearType.BEARER_WIFI); + expect(3).assertEqual(connection.NetBearType.BEARER_ETHERNET); + console.log("-----------------------Telephony NetBearType Properties Test end-----------------------"); + done(); + } catch (err) { + console.log(`Telephony_connection_NetBearType_1100 err ` + err); + } + }) + + /** + * @tc.name: Telephony_connection_getNetBearType_Async_1200 + * @tc.desc:getNetBearType Properties detection + * @tc.author: kangyuntao + */ + it('Telephony_connection_getNetBearType_Async_1200', 0, async function (done) { + console.log("-----------------------Telephony getNetBearType Test is starting-----------------------"); + let caseName = 'Telephony_connection_getNetBearType_Async_1200'; + connection.getAllNets((error, value) => { + if (error) { + console.log(`${caseName} get data fail: ${error}`); + expect().assertFail(); + done(); + return; + } else { + console.log(`Telephony_connection getAllNets netID value : ${JSON.stringify(value[0].netId)}`); + connection.getNetCapabilities(value[0], (error, data) => { + if (error) { + console.log(`${caseName} get ID fail: ${error}`); + expect().assertFail(); + done(); + } else { + console.log(`${caseName} get value success: ${JSON.stringify(data)}`); + console.log(`${caseName} get value success122222: ${JSON.stringify(data.bearerTypes_[0].bearerType)}`); + expect(data.bearerTypes_[0].bearerType != "").assertTrue(); + done(); + } + }); + } + }); + console.log("-----------------------Telephony getNetBearType Test is end-----------------------"); + }); + + /** + * @tc.name: Telephony_connection_getNetCapabilities_Promise_1300 + * @tc.desc: getNetCapabilities NetCap and NetBearType Properties detection + * @tc.author: kangyuntao + */ + it('Telephony_connection_getNetCapabilities_Promise_1300', 0, async function (done) { + console.log("-----------------------Telephony getNetCapabilities Promise Test is starting-----------------------"); + let caseName = 'Telephony_connection_getNetCapabilities_Promise_1300'; + connection.getAllNets().then((handle) => { + connection.getNetCapabilities(handle[0]).then((data) => { + console.log(`${caseName} getNetCapabilities promiss data suceess: ${JSON.stringify(data)}`); + console.log(`${caseName} get value successNetCap: ${JSON.stringify(data.netCaps_[0].netCap)}`); + console.log(`${caseName} get value successNearerTypes: ${JSON.stringify(data.bearerTypes_[0].bearerType)}`); + expect(data.netCaps_[0].netCap != "").assertTrue(); + expect(data.bearerTypes_[0].bearerType != "").assertTrue(); + console.log("-----------------------Telephony getNetCapabilities Promise Test is end-----------------------"); + done(); + }).catch((error) => { + console.log(`${caseName} getNetCapabilities promiss fail: ${error}`); + expect().assertFail(); + done(); + }); + }).catch((error) => { + console.log(`${caseName} getAllNets promiss error: ${error}`); + expect().assertFail(); + done(); + }); + }); + }) + +} + diff --git a/telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/MainAbility/test/List.test.ets b/telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/MainAbility/test/List.test.ets new file mode 100644 index 000000000..eed2cac75 --- /dev/null +++ b/telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/MainAbility/test/List.test.ets @@ -0,0 +1,28 @@ +/** + * 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. + */ + +//other import +import connectionJsunit from './ConnectionJsunit.test.ets'; +import socketJsunit from './SocketJsunit.test.ets'; +import webSocketJsunit from './WebSocketJsunit.test.ets'; +import connectionSecondJsUnit from './ConnectionSecondJsUnit.test.ets'; + +export default function testsuite() { + //other + socketJsunit(); + webSocketJsunit(); + connectionJsunit(); + connectionSecondJsUnit(); +} \ No newline at end of file diff --git a/telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/MainAbility/test/SocketJsunit.test.ets b/telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/MainAbility/test/SocketJsunit.test.ets new file mode 100644 index 000000000..92e551199 --- /dev/null +++ b/telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/MainAbility/test/SocketJsunit.test.ets @@ -0,0 +1,1796 @@ +// @ts-nocheck +/** + * 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 {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "deccjsunit/index.ets"; +import socket from '@ohos.net.socket' +import utils from './Utils.ets' + +export default function socketJsunit() { + describe('socketTest', function () { + console.log("************* socket Test start*************"); + + /* + * @tc.number : Telephony_Socket_Socket_constructUDPSocketInstance_0100 + * @tc.name : constructUDPSocketInstance + * @tc.desc : Creates a UDPSocket object. + */ + it('Telephony_Socket_Socket_constructUDPSocketInstance_0100', 0, async function (done) { + console.log("************* Telephony_Socket_Socket_constructUDPSocketInstance_0100 Test start*************"); + var udpSocket = socket.constructUDPSocketInstance(); + expect(udpSocket != null).assertTrue(); + console.log("************* Telephony_Socket_Socket_constructUDPSocketInstance_0100 Test end*************"); + done(); + }) + + /* + * @tc.number : Telephony_Socket_Socket_constructTCPSocketInstance_0100 + * @tc.name : constructTCPSocketInstance + * @tc.desc : Creates a TCPSocket object. + */ + it('Telephony_Socket_Socket_constructTCPSocketInstance_0100', 0, async function (done) { + console.log("************* Telephony_Socket_Socket_constructTCPSocketInstance_0100 Test start*************"); + var tcpSocket = socket.constructTCPSocketInstance(); + expect(tcpSocket != null).assertTrue(); + console.log("************* Telephony_Socket_Socket_constructTCPSocketInstance_0100 Test end*************"); + done(); + }) + + /* + * @tc.number : Telephony_Socket_Socket_NetAddress_0100 + * @tc.name : NetAddress + * @tc.desc : interface NetAddress + */ + it('Telephony_Socket_Socket_NetAddress_0100', 0, async function (done) { + console.log("************* Telephony_Socket_Socket_NetAddress_0100 Test start*************"); + let netAddress: socket.NetAddress = { + address: "test address", + family: 1, + port: 8080 + } + expect(netAddress.address === "test address").assertTrue() + expect(netAddress.family === 1).assertTrue() + expect(netAddress.port === 8080).assertTrue() + console.log("************* Telephony_Socket_Socket_NetAddress_0100 Test end*************"); + done(); + }); + + /* + * @tc.number : Telephony_Socket_UDPSendOptions_data_0100 + * @tc.name : UDPSendOptions.data + * @tc.desc : UDPSendOptions.data + */ + it('Telephony_Socket_UDPSendOptions_data_0100', 0, async function (done) { + console.log("************* Telephony_Socket_UDPSendOptions_data_0100 Test start*************"); + let udpSendOptions: socket.UDPSendOptions = { + data: "test data", + address: { + address: "test address", + family: 1, + port: 8080 + } + } + expect(udpSendOptions.data === "test data").assertTrue() + console.log("************* Telephony_Socket_UDPSendOptions_data_0100 Test end*************"); + done(); + }); + + /* + * @tc.number : Telephony_Socket_ExtraOptionsBase_receiveBufferSize_0100 + * @tc.name : ExtraOptionsBase.receiveBufferSize + * @tc.desc : ExtraOptionsBase.receiveBufferSize + */ + it('Telephony_Socket_ExtraOptionsBase_receiveBufferSize_0100', 0, async function (done) { + console.log("************* Telephony_Socket_ExtraOptionsBase_receiveBufferSize_0100 Test start*************"); + let extraOptionsBase: socket.ExtraOptionsBase = { + receiveBufferSize: 1, + sendBufferSize: 1, + reuseAddress: true, + socketTimeout: 5000, + } + expect(extraOptionsBase.receiveBufferSize === 1).assertTrue() + console.log("************* Telephony_Socket_ExtraOptionsBase_receiveBufferSize_0100 Test end*************"); + done(); + }); + + /* + * @tc.number : Telephony_Socket_ExtraOptionsBase_sendBufferSize_0100 + * @tc.name : ExtraOptionsBase.sendBufferSize + * @tc.desc : ExtraOptionsBase.sendBufferSize + */ + it('Telephony_Socket_ExtraOptionsBase_sendBufferSize_0100', 0, async function (done) { + console.log("************* Telephony_Socket_ExtraOptionsBase_sendBufferSize_0100 Test start*************"); + let extraOptionsBase: socket.ExtraOptionsBase = { + receiveBufferSize: 1, + sendBufferSize: 1, + reuseAddress: true, + socketTimeout: 5000, + } + expect(extraOptionsBase.sendBufferSize === 1).assertTrue() + console.log("************* Telephony_Socket_ExtraOptionsBase_sendBufferSize_0100 Test end*************"); + done(); + }); + + /* + * @tc.number : Telephony_Socket_ExtraOptionsBase_reuseAddress_0100 + * @tc.name : ExtraOptionsBase.reuseAddress + * @tc.desc : ExtraOptionsBase.reuseAddress + */ + it('Telephony_Socket_ExtraOptionsBase_reuseAddress_0100', 0, async function (done) { + console.log("************* Telephony_Socket_ExtraOptionsBase_reuseAddress_0100 Test start*************"); + let extraOptionsBase: socket.ExtraOptionsBase = { + receiveBufferSize: 1, + sendBufferSize: 1, + reuseAddress: true, + socketTimeout: 5000, + } + expect(extraOptionsBase.reuseAddress).assertTrue() + console.log("************* Telephony_Socket_ExtraOptionsBase_reuseAddress_0100 Test end*************"); + done(); + }); + + /* + * @tc.number : Telephony_Socket_ExtraOptionsBase_socketTimeout_0100 + * @tc.name : ExtraOptionsBase.socketTimeout + * @tc.desc : ExtraOptionsBase.socketTimeout + */ + it('Telephony_Socket_ExtraOptionsBase_socketTimeout_0100', 0, async function (done) { + console.log("************* Telephony_Socket_ExtraOptionsBase_socketTimeout_0100 Test start*************"); + let extraOptionsBase: socket.ExtraOptionsBase = { + receiveBufferSize: 1, + sendBufferSize: 1, + reuseAddress: true, + socketTimeout: 5000, + } + expect(extraOptionsBase.socketTimeout === 5000).assertTrue() + console.log("************* Telephony_Socket_ExtraOptionsBase_socketTimeout_0100 Test end*************"); + done(); + }); + + /* + * @tc.number : Telephony_Socket_SocketStateBase_isClose_0100 + * @tc.name : SocketStateBase.isClose + * @tc.desc : SocketStateBase.isClose + */ + it('Telephony_Socket_SocketStateBase_isClose_0100', 0, async function (done) { + console.log("************* Telephony_Socket_SocketStateBase_isClose_0100 Test start*************"); + let socketStateBase: socket.SocketStateBase = { + isBound: true, + isClose: true, + isConnected: true + } + expect(socketStateBase.isClose).assertTrue() + console.log("************* Telephony_Socket_SocketStateBase_isClose_0100 Test end*************"); + done(); + }); + + /* + * @tc.number : Telephony_Socket_SocketRemoteInfo_port_0100 + * @tc.name : SocketRemoteInfo.port + * @tc.desc : SocketRemoteInfo.port + */ + it('Telephony_Socket_SocketRemoteInfo_port_0100', 0, async function (done) { + console.log("************* Telephony_Socket_SocketRemoteInfo_port_0100 Test start*************"); + let socketRemoteInfo: socket.SocketRemoteInfo = { + address: "test address", + family: 'IPv4', + port: 8080, + size: 1 + } + expect(socketRemoteInfo.port === 8080).assertTrue() + console.log("************* Telephony_Socket_SocketRemoteInfo_port_0100 Test end*************"); + done(); + }); + + /* + * @tc.number : Telephony_Socket_SocketRemoteInfo_size_0100 + * @tc.name : SocketRemoteInfo.size + * @tc.desc : SocketRemoteInfo.size + */ + it('Telephony_Socket_SocketRemoteInfo_size_0100', 0, async function (done) { + console.log("************* Telephony_Socket_SocketRemoteInfo_size_0100 Test start*************"); + let socketRemoteInfo: socket.SocketRemoteInfo = { + address: "test address", + family: 'IPv4', + port: 8080, + size: 1 + } + expect(socketRemoteInfo.size === 1).assertTrue() + console.log("************* Telephony_Socket_SocketRemoteInfo_size_0100 Test end*************"); + done(); + }); + + /* + * @tc.number : Telephony_Socket_TCPConnectOptions_timeout_0100 + * @tc.name : TCPConnectOptions.timeout + * @tc.desc : TCPConnectOptions.timeout + */ + it('Telephony_Socket_TCPConnectOptions_timeout_0100', 0, async function (done) { + console.log("************* Telephony_Socket_TCPConnectOptions_timeout_0100 Test start*************"); + let tcpConnectOptions: socket.TCPConnectOptions = { + address: { + address: "test address", + family: 1, + port: 8080 + }, + timeout: 1000 + } + expect(tcpConnectOptions.timeout === 1000).assertTrue() + console.log("************* Telephony_Socket_TCPConnectOptions_timeout_0100 Test end*************"); + done(); + }); + + /* + * @tc.number : Telephony_Socket_TCPSendOptions_data_0100 + * @tc.name : TCPSendOptions.data + * @tc.desc : TCPSendOptions.data + */ + it('Telephony_Socket_TCPSendOptions_data_0100', 0, async function (done) { + console.log("************* Telephony_Socket_TCPSendOptions_data_0100 Test start*************"); + let tcpSendOptions: socket.TCPSendOptions = { + data: "test data", + encoding: "test encoding" + } + expect(tcpSendOptions.data === "test data").assertTrue() + console.log("************* Telephony_Socket_TCPSendOptions_data_0100 Test end*************"); + done(); + }); + + /* + * @tc.number : Telephony_Socket_TCPSendOptions_encoding_0100 + * @tc.name : TCPSendOptions.encoding + * @tc.desc : TCPSendOptions.encoding + */ + it('Telephony_Socket_TCPSendOptions_encoding_0100', 0, async function (done) { + console.log("************* Telephony_Socket_TCPSendOptions_encoding_0100 Test start*************"); + let tcpSendOptions: socket.TCPSendOptions = { + data: "test data", + encoding: "test encoding" + } + expect(tcpSendOptions.encoding === "test encoding").assertTrue() + console.log("************* Telephony_Socket_TCPSendOptions_encoding_0100 Test end*************"); + done(); + }); + + /* + * @tc.number : Telephony_Socket_TCPExtraOptions_keepAlive_0100 + * @tc.name : TCPExtraOptions.keepAlive + * @tc.desc : TCPExtraOptions.keepAlive + */ + it('Telephony_Socket_TCPExtraOptions_keepAlive_0100', 0, async function (done) { + console.log("************* Telephony_Socket_TCPExtraOptions_keepAlive_0100 Test start*************"); + let tcpExtraOptions: socket.TCPExtraOptions = { + keepAlive: true, + OOBInline: false, + TCPNoDelay: true, + socketLinger: { + on: true, + linger: false + } + } + expect(tcpExtraOptions.keepAlive).assertTrue() + console.log("************* Telephony_Socket_TCPExtraOptions_keepAlive_0100 Test end*************"); + done(); + }); + + /* + * @tc.number : Telephony_Socket_TCPExtraOptions_OOBInline_0100 + * @tc.name : TCPExtraOptions.OOBInline + * @tc.desc : TCPExtraOptions.OOBInline + */ + it('Telephony_Socket_TCPExtraOptions_OOBInline_0100', 0, async function (done) { + console.log("************* Telephony_Socket_TCPExtraOptions_OOBInline_0100 Test start*************"); + let tcpExtraOptions: socket.TCPExtraOptions = { + keepAlive: true, + OOBInline: false, + TCPNoDelay: true, + socketLinger: { + on: true, + linger: false + } + } + expect(!tcpExtraOptions.OOBInline).assertTrue() + console.log("************* Telephony_Socket_TCPExtraOptions_OOBInline_0100 Test end*************"); + done(); + }); + + /* + * @tc.number : Telephony_Socket_TCPExtraOptions_TCPNoDelay_0100 + * @tc.name : TCPExtraOptions.TCPNoDelay + * @tc.desc : TCPExtraOptions.TCPNoDelay + */ + it('Telephony_Socket_TCPExtraOptions_TCPNoDelay_0100', 0, async function (done) { + console.log("************* Telephony_Socket_TCPExtraOptions_TCPNoDelay_0100 Test start*************"); + let tcpExtraOptions: socket.TCPExtraOptions = { + keepAlive: true, + OOBInline: false, + TCPNoDelay: true, + socketLinger: { + on: true, + linger: false + } + } + expect(tcpExtraOptions.TCPNoDelay).assertTrue() + console.log("************* Telephony_Socket_TCPExtraOptions_TCPNoDelay_0100 Test end*************"); + done(); + }); + + /* + * @tc.number : Telephony_Socket_TCPExtraOptions_socketLinger_0100 + * @tc.name : TCPExtraOptions.socketLinger + * @tc.desc : TCPExtraOptions.socketLinger + */ + it('Telephony_Socket_TCPExtraOptions_socketLinger_0100', 0, async function (done) { + console.log("************* Telephony_Socket_TCPExtraOptions_socketLinger_0100 Test start*************"); + let tcpExtraOptions: socket.TCPExtraOptions = { + keepAlive: true, + OOBInline: false, + TCPNoDelay: true, + socketLinger: { + on: true, + linger: false + } + } + expect(tcpExtraOptions.socketLinger.on).assertTrue() + expect(!tcpExtraOptions.socketLinger.linger).assertTrue() + console.log("************* Telephony_Socket_TCPExtraOptions_socketLinger_0100 Test end*************"); + done(); + }); + + + /* + * @tc.number : Telephony_Socket_UDPSocket_bind_0100 + * @tc.name : bind + * @tc.desc : Binds the IP address and port number. + */ + it('Telephony_Socket_UDPSocket_bind_0100', 0, async function (done) { + let caseName = "Telephony_Socket_UDPSocket_bind_0100" + console.log("************* Telephony_Socket_UDPSocket_bind_0100 Test start*************"); + let netAddress: socket.NetAddress = { + address: "test address", + family: 1, + port: 8080 + } + socket.UDPSocket.bind(netAddress, (error, data) => { + if (error) { + console.log(`${caseName} error, case success,error:${toString(error)}`); + done(); + return; + } + expect().assertFail(); + console.log(`${caseName} error, case failed,data:${toString(data)}`); + done(); + }) + console.log("************* Telephony_Socket_UDPSocket_bind_0100 Test end*************"); + done(); + }); + + /* + * @tc.number : Telephony_Socket_UDPSocket_bind_0200 + * @tc.name : bind + * @tc.desc : Binds the IP address and port number. + */ + it('Telephony_Socket_UDPSocket_bind_0200', 0, async function (done) { + let caseName = "Telephony_Socket_UDPSocket_bind_0200" + console.log("************* Telephony_Socket_UDPSocket_bind_0200 Test start*************"); + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + let netAddress: socket.NetAddress = { + address: "test address", + family: 1, + port: 8080 + } + try{ + await socket.UDPSocket.bind(netAddress).then(data => { + console.log(`${caseName} success,data:${toString(data)}`); + }).catch((error) => { + console.log(`${caseName} failed,error:${toString(error)}`); + }); + }catch(err){ + console.log(`${caseName} failed,catch error:${toString(error)}`); + } + console.log("************* Telephony_Socket_UDPSocket_bind_0200 Test end*************"); + done(); + }); + + /* + * @tc.number : Telephony_Socket_UDPSocket_bind_0300 + * @tc.name : bind + * @tc.desc : Binds the IP address and port number. + */ + it('Telephony_Socket_UDPSocket_bind_0300', 0, async function (done) { + console.log("************* Telephony_Socket_UDPSocket_bind_0300 Test start*************"); + let caseName = "Telephony_Socket_UDPSocket_bind_0300" + let netAddress: socket.NetAddress = { + address: "second test address" + } + socket.UDPSocket.bind(netAddress, (error, data) => { + if (error) { + console.log(`${caseName} error, case success,error:${toString(error)}`); + done(); + return; + } + expect().assertFail(); + console.log(`${caseName} error, case failed,data:${toString(data)}`); + done(); + }) + console.log("************* Telephony_Socket_UDPSocket_bind_0300 Test end*************"); + done(); + }); + + /* + * @tc.number : Telephony_Socket_UDPSocket_bind_0400 + * @tc.name : bind + * @tc.desc : Binds the IP address and port number. + */ + it('Telephony_Socket_UDPSocket_bind_0400', 0, async function (done) { + console.log("************* Telephony_Socket_UDPSocket_bind_0400 Test start*************"); + let caseName = "Telephony_Socket_UDPSocket_bind_0400" + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + let netAddress: socket.NetAddress = { + address: "third test address", + family: 3, + port: 8080 + } + socket.UDPSocket.bind(netAddress).then(data => { + console.log(`${caseName} success,data:${toString(data)}`); + }).catch((error) => { + console.log(`${caseName} failed,error:${toString(error)}`); + }); + console.log("************* Telephony_Socket_UDPSocket_bind_0400 Test end*************"); + done(); + }); + + /* + * @tc.number : Telephony_Socket_UDPSocket_send_0100 + * @tc.name : send + * @tc.desc : Sends data over a UDPSocket connection. + */ + it('Telephony_Socket_UDPSocket_send_0100', 0, async function (done) { + console.log("************* Telephony_Socket_UDPSocket_send_0100 Test start*************"); + let caseName = "Telephony_Socket_UDPSocket_send_0100" + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + let udpSendOptions: socket.UDPSendOptions = { + data: "test data", + address: { + address: "test address", + family: 1, + port: 8080 + } + } + socket.UDPSocket.send(udpSendOptions, (error, data) => { + if (error) { + console.log(`${caseName} error, case success,error:${toString(error)}`); + done(); + return; + } + expect().assertFail(); + console.log(`${caseName} error, case failed,data:${toString(data)}`); + done(); + }) + console.log("************* Telephony_Socket_UDPSocket_send_0100 Test end*************"); + done(); + }); + + /* + * @tc.number : Telephony_Socket_UDPSocket_send_0200 + * @tc.name : send + * @tc.desc : Sends data over a UDPSocket connection. + */ + it('Telephony_Socket_UDPSocket_send_0200', 0, async function (done) { + console.log("************* Telephony_Socket_UDPSocket_send_0200 Test start*************"); + let caseName = "Telephony_Socket_UDPSocket_send_0200" + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + let udpSendOptions: socket.UDPSendOptions = { + data: "test data", + address: { + address: "test address", + family: 1, + port: 8080 + } + } + socket.UDPSocket.send(udpSendOptions).then(data => { + console.log(`${caseName} success,data:${toString(data)}`); + }).catch((error) => { + console.log(`${caseName} failed,error:${toString(error)}`); + }); + console.log("************* Telephony_Socket_UDPSocket_send_0200 Test end*************"); + done(); + }); + + /* + * @tc.number : Telephony_Socket_UDPSocket_send_0300 + * @tc.name : send + * @tc.desc : Sends data over a UDPSocket connection. + */ + it('Telephony_Socket_UDPSocket_send_0300', 0, async function (done) { + console.log("************* Telephony_Socket_UDPSocket_send_0300 Test start*************"); + let caseName = "Telephony_Socket_UDPSocket_send_0300" + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + let udpSendOptions: socket.UDPSendOptions = { + data: "test data", + address: { + address: "second test address", + } + } + socket.UDPSocket.send(udpSendOptions, (error, data) => { + if (error) { + console.log(`${caseName} error, case success,error:${toString(error)}`); + done(); + return; + } + expect().assertFail(); + console.log(`${caseName} error, case failed,data:${toString(data)}`); + done(); + }) + console.log("************* Telephony_Socket_UDPSocket_send_0300 Test end*************"); + done(); + }); + + /* + * @tc.number : Telephony_Socket_UDPSocket_send_0400 + * @tc.name : send + * @tc.desc : Sends data over a UDPSocket connection. + */ + it('Telephony_Socket_UDPSocket_send_0400', 0, async function (done) { + console.log("************* Telephony_Socket_UDPSocket_send_0400 Test start*************"); + let caseName = "Telephony_Socket_UDPSocket_send_0400" + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + let udpSendOptions: socket.UDPSendOptions = { + data: "test data", + address: { + address: "third test address" + } + } + socket.UDPSocket.send(udpSendOptions).then(data => { + console.log(`${caseName} success,data:${toString(data)}`); + }).catch((error) => { + console.log(`${caseName} failed,error:${toString(error)}`); + }); + console.log("************* Telephony_Socket_UDPSocket_send_0400 Test end*************"); + done(); + }); + + /* + * @tc.number : Telephony_Socket_UDPSocket_getState_0100 + * @tc.name : getState + * @tc.desc : Obtains the status of the UDPSocket connection. + */ + it('Telephony_Socket_UDPSocket_getState_0100', 0, async function (done) { + console.log("************* Telephony_Socket_UDPSocket_getState_0100 Test start*************"); + let caseName = "Telephony_Socket_UDPSocket_getState_0100" + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + socket.UDPSocket.getState((error, data) => { + if (error) { + console.log(`${caseName} error, case success,error:${toString(error)}`); + done(); + return; + } + let socketStateBase: socket.SocketStateBase = data + console.log(`${caseName} data:${toString(socketStateBase.isClose)}`); + done(); + }) + console.log("************* Telephony_Socket_UDPSocket_getState_0100 Test end*************"); + done(); + }); + + /* + * @tc.number : Telephony_Socket_UDPSocket_getState_0200 + * @tc.name : getState + * @tc.desc : Obtains the status of the UDPSocket connection. + */ + it('Telephony_Socket_UDPSocket_getState_0200', 0, async function (done) { + console.log("************* Telephony_Socket_UDPSocket_getState_0200 Test start*************"); + let caseName = "Telephony_Socket_UDPSocket_getState_0200" + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + socket.UDPSocket.getState().then(data => { + console.log(`${caseName} success,data:${toString(data)}`); + }).catch((error) => { + console.log(`${caseName} failed,error:${toString(error)}`); + }); + + console.log("************* Telephony_Socket_UDPSocket_getState_0200 Test end*************"); + done(); + }); + + /* + * @tc.number : Telephony_Socket_UDPSocket_setExtraOptions_0100 + * @tc.name : setExtraOptions + * @tc.desc : Sets other attributes of the UDPSocket connection. + */ + it('Telephony_Socket_UDPSocket_setExtraOptions_0100', 0, async function (done) { + console.log("************* Telephony_Socket_UDPSocket_setExtraOptions_0100 Test start*************"); + let caseName = "Telephony_Socket_UDPSocket_setExtraOptions_0100" + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + let udpExtraOptions: socket.UDPExtraOptions = { + broadcast: true + } + socket.UDPSocket.setExtraOptions(udpExtraOptions, (error) => { + if (error) { + console.log(`${caseName} error, case success,error:${toString(error)}`); + done(); + return; + } + expect().assertFail(); + expect(true).assertTrue(); + console.log(`${caseName} error, case failed`); + done(); + }) + console.log("************* Telephony_Socket_UDPSocket_setExtraOptions_0100 Test end*************"); + done(); + }); + + /* + * @tc.number : Telephony_Socket_UDPSocket_setExtraOptions_0200 + * @tc.name : setExtraOptions + * @tc.desc : Sets other attributes of the UDPSocket connection. + */ + it('Telephony_Socket_UDPSocket_setExtraOptions_0200', 0, async function (done) { + console.log("************* Telephony_Socket_UDPSocket_setExtraOptions_0200 Test start*************"); + let caseName = "Telephony_Socket_UDPSocket_setExtraOptions_0200" + let udpExtraOptions: socket.UDPExtraOptions = { + broadcast: true + } + try { + await socket.UDPSocket.setExtraOptions(udpExtraOptions); + console.log(`${caseName} success`); + done(); + } catch (error) { + console.log(`${caseName} failed,error:${error}`); + done(); + } + console.log("************* Telephony_Socket_UDPSocket_setExtraOptions_0200 Test end*************"); + done(); + }); + + /* + * @tc.number : Telephony_Socket_UDPSocket_setExtraOptions_0300 + * @tc.name : setExtraOptions + * @tc.desc : Sets other attributes of the UDPSocket connection. + */ + it('Telephony_Socket_UDPSocket_setExtraOptions_0300', 0, async function (done) { + console.log("************* Telephony_Socket_UDPSocket_setExtraOptions_0300 Test start*************"); + let caseName = "Telephony_Socket_UDPSocket_setExtraOptions_0300" + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + let udpExtraOptions: socket.UDPExtraOptions = {} + socket.UDPSocket.setExtraOptions(udpExtraOptions, (error) => { + if (error) { + console.log(`${caseName} error, case success,error:${toString(error)}`); + done(); + return; + } + expect().assertFail(); + console.log(`${caseName} error, case failed`); + done(); + }) + console.log("************* Telephony_Socket_UDPSocket_setExtraOptions_0300 Test end*************"); + done(); + }); + + /* + * @tc.number : Telephony_Socket_UDPSocket_setExtraOptions_0400 + * @tc.name : setExtraOptions + * @tc.desc : Sets other attributes of the UDPSocket connection. + */ + it('Telephony_Socket_UDPSocket_setExtraOptions_0400', 0, async function (done) { + console.log("************* Telephony_Socket_UDPSocket_setExtraOptions_0400 Test start*************"); + let caseName = "Telephony_Socket_UDPSocket_setExtraOptions_0400" + let udpExtraOptions: socket.UDPExtraOptions = {} + try { + await socket.UDPSocket.setExtraOptions(udpExtraOptions); + console.log(`${caseName} success`); + done(); + } catch (error) { + console.log(`${caseName} failed,error:${error}`); + expect(true).assertTrue(); + done(); + } + console.log("************* Telephony_Socket_UDPSocket_setExtraOptions_0400 Test end*************"); + done(); + }); + + /* + * @tc.number : Telephony_Socket_UDPSocket_on_message_0100 + * @tc.name : on + * @tc.desc : Listens for message receiving events of the UDPSocket connection. + */ + it('Telephony_Socket_UDPSocket_on_message_0100', 0, async function (done) { + console.log("************* Telephony_Socket_UDPSocket_on_message_0100 Test start*************"); + let caseName = "Telephony_Socket_UDPSocket_on_message_0100" + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + socket.UDPSocket.on('message', (data) => { + let socketRemoteInfo: socket.SocketRemoteInfo = data.remoteInfo; + console.log(`${caseName} port:${socketRemoteInfo.port}`); + console.log(`${caseName} size:${socketRemoteInfo.size}`); + }); + console.log("************* Telephony_Socket_UDPSocket_on_message_0100 Test end*************"); + done(); + }); + + /* + * @tc.number : Telephony_Socket_UDPSocket_off_message_0100 + * @tc.name : off + * @tc.desc : Cancels listening for message receiving events of the UDPSocket connection. + */ + it('Telephony_Socket_UDPSocket_off_message_0100', 0, async function (done) { + console.log("************* Telephony_Socket_UDPSocket_off_message_0100 Test start*************"); + let caseName = "Telephony_Socket_UDPSocket_off_message_0100" + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + socket.UDPSocket.off("message", data => { + let socketRemoteInfo: socket.SocketRemoteInfo = data.remoteInfo; + console.log(`${caseName} port:${socketRemoteInfo.port}`); + console.log(`${caseName} size:${socketRemoteInfo.size}`); + }); + console.log("************* Telephony_Socket_UDPSocket_off_message_0100 Test end*************"); + done(); + }); + + /* + * @tc.number : Telephony_Socket_UDPSocket_off_message_0200 + * @tc.name : off + * @tc.desc : Cancels listening for message receiving events of the UDPSocket connection. + */ + it('Telephony_Socket_UDPSocket_off_message_0200', 0, async function (done) { + console.log("************* Telephony_Socket_UDPSocket_off_message_0200 Test start*************"); + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + socket.UDPSocket.off("message"); + expect(true).assertTrue(); + console.log("************* Telephony_Socket_UDPSocket_off_message_0200 Test end*************"); + done(); + }); + + /* + * @tc.number : Telephony_Socket_UDPSocket_on_listening_0100 + * @tc.name : on + * @tc.desc : Listens for data packet message events or close events of the UDPSocket connection. + */ + it('Telephony_Socket_UDPSocket_on_listening_0100', 0, async function (done) { + console.log("************* Telephony_Socket_UDPSocket_on_listening_0100 Test start*************"); + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + socket.UDPSocket.on("listening", data => { + expect(true).assertTrue(); + }); + console.log("************* Telephony_Socket_UDPSocket_on_listening_0100 Test end*************"); + done(); + }); + + /* + * @tc.number : Telephony_Socket_UDPSocket_off_listening_0100 + * @tc.name : off + * @tc.desc : Cancels listening for data packet message events or close events of the UDPSocket connection. + */ + it('Telephony_Socket_UDPSocket_off_listening_0100', 0, async function (done) { + console.log("************* Telephony_Socket_UDPSocket_off_listening_0100 Test start*************"); + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + socket.UDPSocket.off("listening", data => { + expect(true).assertTrue(); + }); + console.log("************* Telephony_Socket_UDPSocket_off_listening_0100 Test end*************"); + done(); + }); + + /* + * @tc.number : Telephony_Socket_UDPSocket_off_listening_0200 + * @tc.name : off + * @tc.desc : Cancels listening for data packet message events or close events of the UDPSocket connection. + */ + it('Telephony_Socket_UDPSocket_off_listening_0200', 0, async function (done) { + console.log("************* Telephony_Socket_UDPSocket_off_listening_0200 Test start*************"); + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + socket.UDPSocket.off("listening"); + expect(true).assertTrue(); + console.log("************* Telephony_Socket_UDPSocket_off_listening_0200 Test end*************"); + done(); + }); + + /* + * @tc.number : Telephony_Socket_UDPSocket_on_close_0100 + * @tc.name : on + * @tc.desc : Listens for data packet message events or close events of the UDPSocket connection. + */ + it('Telephony_Socket_UDPSocket_on_close_0100', 0, async function (done) { + console.log("************* Telephony_Socket_UDPSocket_on_close_0100 Test start*************"); + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + socket.UDPSocket.on("close", data => { + expect(true).assertTrue(); + }); + console.log("************* Telephony_Socket_UDPSocket_on_close_0100 Test end*************"); + done(); + }); + + /* + * @tc.number : Telephony_Socket_UDPSocket_off_close_0100 + * @tc.name : off + * @tc.desc : Cancels listening for data packet message events or close events of the UDPSocket connection. + */ + it('Telephony_Socket_UDPSocket_off_close_0100', 0, async function (done) { + console.log("************* Telephony_Socket_UDPSocket_off_close_0100 Test start*************"); + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + socket.UDPSocket.off("close", data => { + expect(true).assertTrue(); + }); + console.log("************* Telephony_Socket_UDPSocket_off_close_0100 Test end*************"); + done(); + }); + + /* + * @tc.number : Telephony_Socket_UDPSocket_off_close_0200 + * @tc.name : off + * @tc.desc : Cancels listening for data packet message events or close events of the UDPSocket connection. + */ + it('Telephony_Socket_UDPSocket_off_close_0200', 0, async function (done) { + console.log("************* Telephony_Socket_UDPSocket_off_close_0200 Test start*************"); + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + socket.UDPSocket.off("close"); + expect(true).assertTrue(); + console.log("************* Telephony_Socket_UDPSocket_off_close_0200 Test end*************"); + done(); + }); + + /* + * @tc.number : Telephony_Socket_UDPSocket_on_error_0100 + * @tc.name : on + * @tc.desc : Listens for error events of the UDPSocket connection. + */ + it('Telephony_Socket_UDPSocket_on_error_0100', 0, async function (done) { + console.log("************* Telephony_Socket_UDPSocket_on_error_0100 Test start*************"); + let caseName = "Telephony_Socket_UDPSocket_on_error_0100" + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + socket.UDPSocket.on("error", error => { + console.log(`${caseName} fail, error:${toString(error)}`); + expect().assertFail(); + }); + expect(true).assertTrue(); + console.log("************* Telephony_Socket_UDPSocket_on_error_0100 Test end*************"); + done(); + }); + + /* + * @tc.number : Telephony_Socket_UDPSocket_off_error_0100 + * @tc.name : off + * @tc.desc : Cancels listening for error events of the UDPSocket connection. + */ + it('Telephony_Socket_UDPSocket_off_error_0100', 0, async function (done) { + console.log("************* Telephony_Socket_UDPSocket_off_error_0100 Test start*************"); + let caseName = "Telephony_Socket_UDPSocket_off_error_0100" + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + socket.UDPSocket.off("error", error => { + console.log(`${caseName} fail, error:${toString(error)}`); + expect().assertFail(); + }); + expect(true).assertTrue(); + console.log("************* Telephony_Socket_UDPSocket_off_error_0100 Test end*************"); + done(); + }); + + /* + * @tc.number : Telephony_Socket_UDPSocket_off_error_0200 + * @tc.name : off + * @tc.desc : Cancels listening for error events of the UDPSocket connection. + */ + it('Telephony_Socket_UDPSocket_off_error_0200', 0, async function (done) { + console.log("************* Telephony_Socket_UDPSocket_off_error_0200 Test start*************"); + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + socket.UDPSocket.off("error"); + expect(true).assertTrue(); + console.log("************* Telephony_Socket_UDPSocket_off_error_0200 Test end*************"); + done(); + }); + + /* + * @tc.number : Telephony_Socket_TCPSocket_bind_0100 + * @tc.name : bind + * @tc.desc : Binds the IP address and port number + */ + it('Telephony_Socket_TCPSocket_bind_0100', 0, async function (done) { + console.log("************* Telephony_Socket_TCPSocket_bind_0100 Test start*************"); + let caseName = "Telephony_Socket_TCPSocket_bind_0100" + let netAddress: socket.NetAddress = { + address: "test address", + family: 1, + port: 8080 + } + socket.TCPSocket.bind(netAddress, (error, data) => { + if (error) { + console.log(`${caseName} error, case success,error:${toString(error)}`); + done(); + return; + } + expect().assertFail(); + console.log(`${caseName} error, case failed,data:${toString(data)}`); + done(); + }) + console.log("************* Telephony_Socket_TCPSocket_bind_0100 Test end*************"); + done(); + }); + + /* + * @tc.number : Telephony_Socket_TCPSocket_bind_0200 + * @tc.name : bind + * @tc.desc : Binds the IP address and port number + */ + it('Telephony_Socket_TCPSocket_bind_0200', 0, async function (done) { + console.log("************* Telephony_Socket_TCPSocket_bind_0200 Test start*************"); + let caseName = "Telephony_Socket_TCPSocket_bind_0200" + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + let netAddress: socket.NetAddress = { + address: "test address", + family: 1, + port: 8080 + } + socket.TCPSocket.bind(netAddress).then(data => { + console.log(`${caseName} success,data:${toString(data)}`); + }).catch((error) => { + console.log(`${caseName} failed,error:${toString(error)}`); + }); + console.log("************* Telephony_Socket_TCPSocket_bind_0200 Test end*************"); + done(); + }); + + /* + * @tc.number : Telephony_Socket_TCPSocket_bind_0300 + * @tc.name : bind + * @tc.desc : Binds the IP address and port number + */ + it('Telephony_Socket_TCPSocket_bind_0300', 0, async function (done) { + console.log("************* Telephony_Socket_TCPSocket_bind_0300 Test start*************"); + let caseName = "Telephony_Socket_TCPSocket_bind_0300" + let netAddress: socket.NetAddress = { + address: "second test address", + } + socket.TCPSocket.bind(netAddress, (error, data) => { + if (error) { + console.log(`${caseName} error, case success,error:${toString(error)}`); + done(); + return; + } + expect().assertFail(); + console.log(`${caseName} error, case failed,data:${toString(data)}`); + done(); + }) + console.log("************* Telephony_Socket_TCPSocket_bind_0300 Test end*************"); + done(); + }); + + /* + * @tc.number : Telephony_Socket_TCPSocket_bind_0400 + * @tc.name : bind + * @tc.desc : Binds the IP address and port number + */ + it('Telephony_Socket_TCPSocket_bind_0400', 0, async function (done) { + console.log("************* Telephony_Socket_TCPSocket_bind_0400 Test start*************"); + let caseName = "Telephony_Socket_TCPSocket_bind_0400" + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + let netAddress: socket.NetAddress = { + address: "third test address" + } + socket.TCPSocket.bind(netAddress).then(data => { + console.log(`${caseName} success,data:${toString(data)}`); + }).catch((error) => { + console.log(`${caseName} failed,error:${toString(error)}`); + }); + console.log("************* Telephony_Socket_TCPSocket_bind_0400 Test end*************"); + done(); + }); + + /* + * @tc.number : Telephony_Socket_TCPSocket_send_0100 + * @tc.name : send + * @tc.desc : Sends data over a TCPSocket connection. + */ + it('Telephony_Socket_TCPSocket_send_0100', 0, async function (done) { + console.log("************* Telephony_Socket_TCPSocket_send_0100 Test start*************"); + let caseName = "Telephony_Socket_TCPSocket_send_0100" + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + let tcpSendOptions: socket.TCPSendOptions = { + data: "test data", + encoding: "test encoding" + } + socket.TCPSocket.send(tcpSendOptions, (error, data) => { + if (error) { + console.log(`${caseName} error, case success,error:${toString(error)}`); + done(); + return; + } + expect().assertFail(); + console.log(`${caseName} error, case failed,data:${toString(data)}`); + done(); + }) + console.log("************* Telephony_Socket_TCPSocket_send_0100 Test end*************"); + done(); + }); + + /* + * @tc.number : Telephony_Socket_TCPSocket_send_0200 + * @tc.name : send + * @tc.desc : Sends data over a TCPSocket connection. + */ + it('Telephony_Socket_TCPSocket_send_0200', 0, async function (done) { + console.log("************* Telephony_Socket_TCPSocket_send_0200 Test start*************"); + let caseName = "Telephony_Socket_TCPSocket_send_0200" + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + let tcpSendOptions: socket.TCPSendOptions = { + data: "test data", + encoding: "test encoding" + } + socket.TCPSocket.send(tcpSendOptions).then(data => { + console.log(`${caseName} success,data:${toString(data)}`); + }).catch((error) => { + console.log(`${caseName} failed,error:${toString(error)}`); + }); + console.log("************* Telephony_Socket_TCPSocket_send_0200 Test end*************"); + done(); + }); + + /* + * @tc.number : Telephony_Socket_TCPSocket_send_0300 + * @tc.name : send + * @tc.desc : Sends data over a TCPSocket connection. + */ + it('Telephony_Socket_TCPSocket_send_0300', 0, async function (done) { + console.log("************* Telephony_Socket_TCPSocket_send_0300 Test start*************"); + let caseName = "Telephony_Socket_TCPSocket_send_0300" + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + let tcpSendOptions: socket.TCPSendOptions = { + data: "second test data", + } + socket.TCPSocket.send(tcpSendOptions, (error, data) => { + if (error) { + console.log(`${caseName} error, case success,error:${toString(error)}`); + done(); + return; + } + expect().assertFail(); + console.log(`${caseName} error, case failed,data:${toString(data)}`); + done(); + }) + console.log("************* Telephony_Socket_TCPSocket_send_0300 Test end*************"); + done(); + }); + + /* + * @tc.number : Telephony_Socket_TCPSocket_send_0400 + * @tc.name : send + * @tc.desc : Sends data over a TCPSocket connection. + */ + it('Telephony_Socket_TCPSocket_send_0400', 0, async function (done) { + console.log("************* Telephony_Socket_TCPSocket_send_0400 Test start*************"); + let caseName = "Telephony_Socket_TCPSocket_send_0400" + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + let tcpSendOptions: socket.TCPSendOptions = { + data: "second test data", + } + socket.TCPSocket.send(tcpSendOptions).then(data => { + console.log(`${caseName} success,data:${toString(data)}`); + }).catch((error) => { + console.log(`${caseName} failed,error:${toString(error)}`); + }); + console.log("************* Telephony_Socket_TCPSocket_send_0400 Test end*************"); + done(); + }); + + /* + * @tc.number : Telephony_Socket_TCPSocket_connect_0100 + * @tc.name : connect + * @tc.desc : Sets up a connection to the specified IP address and port number. + */ + it('Telephony_Socket_TCPSocket_connect_0100', 0, async function (done) { + console.log("************* Telephony_Socket_TCPSocket_connect_0100 Test start*************"); + let caseName = "Telephony_Socket_TCPSocket_connect_0100" + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + let tcpConnectOptions: socket.TCPConnectOptions = { + address: { + address: "test address", + family: 1, + port: 8080 + }, + timeout: 1000 + } + socket.TCPSocket.connect(tcpConnectOptions, (error, data) => { + if (error) { + console.log(`${caseName} error, case success,error:${toString(error)}`); + done(); + return; + } + expect().assertFail(); + console.log(`${caseName} error, case failed,data:${toString(data)}`); + done(); + }) + console.log("************* Telephony_Socket_TCPSocket_connect_0100 Test end*************"); + done(); + }); + + /* + * @tc.number : Telephony_Socket_TCPSocket_connect_0200 + * @tc.name : connect + * @tc.desc : Sets up a connection to the specified IP address and port number. + */ + it('Telephony_Socket_TCPSocket_connect_0200', 0, async function (done) { + console.log("************* Telephony_Socket_TCPSocket_connect_0200 Test start*************"); + let caseName = "Telephony_Socket_TCPSocket_connect_0200" + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + let tcpConnectOptions: socket.TCPConnectOptions = { + address: { + address: "test address", + family: 1, + port: 8080 + }, + timeout: 1000 + } + socket.TCPSocket.connect(tcpConnectOptions).then(function (data) { + console.log(`${caseName} success,data:${toString(data)}`); + }).catch((error) => { + console.log(`${caseName} failed,error:${toString(error)}`); + }); + console.log("************* Telephony_Socket_TCPSocket_connect_0200 Test end*************"); + done(); + }); + + /* + * @tc.number : Telephony_Socket_TCPSocket_connect_0300 + * @tc.name : connect + * @tc.desc : Sets up a connection to the specified IP address and port number. + */ + it('Telephony_Socket_TCPSocket_connect_0300', 0, async function (done) { + console.log("************* Telephony_Socket_TCPSocket_connect_0300 Test start*************"); + let caseName = "Telephony_Socket_TCPSocket_connect_0300" + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + let tcpConnectOptions: socket.TCPConnectOptions = { + address: { + address: "second test address", + family: 1, + port: 8080 + } + } + socket.TCPSocket.connect(tcpConnectOptions, (error, data) => { + if (error) { + console.log(`${caseName} error, case success,error:${toString(error)}`); + done(); + return; + } + expect().assertFail(); + console.log(`${caseName} error, case failed,data:${toString(data)}`); + done(); + }) + console.log("************* Telephony_Socket_TCPSocket_connect_0300 Test end*************"); + done(); + }); + + /* + * @tc.number : Telephony_Socket_TCPSocket_connect_0400 + * @tc.name : connect + * @tc.desc : Sets up a connection to the specified IP address and port number. + */ + it('Telephony_Socket_TCPSocket_connect_0200', 0, async function (done) { + console.log("************* Telephony_Socket_TCPSocket_connect_0400 Test start*************"); + let caseName = "Telephony_Socket_TCPSocket_connect_0400" + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + let tcpConnectOptions: socket.TCPConnectOptions = { + address: { + address: "second test address", + family: 1, + port: 8080 + } + } + socket.TCPSocket.connect(tcpConnectOptions).then(function (data) { + console.log(`${caseName} success,data:${toString(data)}`); + }).catch((error) => { + console.log(`${caseName} failed,error:${toString(error)}`); + }); + console.log("************* Telephony_Socket_TCPSocket_connect_0400 Test end*************"); + done(); + }); + + /* + * @tc.number : Telephony_Socket_TCPSocket_getState_0100 + * @tc.name : getState + * @tc.desc : Obtains the status of the TCPSocket connection. + */ + it('Telephony_Socket_TCPSocket_getState_0100', 0, async function (done) { + console.log("************* Telephony_Socket_TCPSocket_getState_0100 Test start*************"); + let caseName = "Telephony_Socket_TCPSocket_getState_0100" + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + socket.TCPSocket.getState((error, data) => { + if (error) { + console.log(`${caseName} case success,error:${toString(error)}`); + done(); + return; + } + expect().assertFail(); + console.log(`${caseName} case failed,data:${toString(data)}`); + done(); + }) + console.log("************* Telephony_Socket_TCPSocket_getState_0100 Test end*************"); + done(); + }); + + /* + * @tc.number : Telephony_Socket_TCPSocket_getState_0200 + * @tc.name : getState + * @tc.desc : Obtains the status of the TCPSocket connection. + */ + it('Telephony_Socket_TCPSocket_getState_0200', 0, async function (done) { + console.log("************* Telephony_Socket_TCPSocket_getState_0200 Test start*************"); + let caseName = "Telephony_Socket_TCPSocket_getState_0200" + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + socket.TCPSocket.getState().then(data => { + console.log(`${caseName} success,data:${toString(data)}`); + }).catch((error) => { + console.log(`${caseName} failed,error:${toString(error)}`); + }); + + console.log("************* Telephony_Socket_TCPSocket_getState_0200 Test end*************"); + done(); + }); + + /* + * @tc.number : Telephony_Socket_TCPSocket_setExtraOptions_0100 + * @tc.name : setExtraOptions + * @tc.desc : Sets other attributes of the TCPSocket connection. + */ + it('Telephony_Socket_TCPSocket_setExtraOptions_0100', 0, async function (done) { + console.log("************* Telephony_Socket_TCPSocket_setExtraOptions_0100 Test start*************"); + let caseName = "Telephony_Socket_TCPSocket_setExtraOptions_0100" + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + let tcpExtraOptions: socket.TCPExtraOptions = { + keepAlive: true, + OOBInline: true, + TCPNoDelay: true, + socketLinger: { + on: true, + linger: true + } + } + socket.TCPSocket.setExtraOptions(tcpExtraOptions, (error) => { + if (error) { + console.log(`${caseName} error, case success,error:${toString(error)}`); + done(); + return; + } + expect().assertFail(); + console.log(`${caseName} error, case failed`); + done(); + }) + console.log("************* Telephony_Socket_TCPSocket_setExtraOptions_0100 Test end*************"); + done(); + }); + + /* + * @tc.number : Telephony_Socket_TCPSocket_setExtraOptions_0200 + * @tc.name : setExtraOptions + * @tc.desc : Sets other attributes of the TCPSocket connection. + */ + it('Telephony_Socket_TCPSocket_setExtraOptions_0200', 0, async function (done) { + console.log("************* Telephony_Socket_TCPSocket_setExtraOptions_0200 Test start*************"); + let caseName = "Telephony_Socket_TCPSocket_setExtraOptions_0200" + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + let tcpExtraOptions: socket.TCPExtraOptions = { + keepAlive: true, + OOBInline: true, + TCPNoDelay: true, + socketLinger: { + on: true, + linger: true + } + } + try { + await socket.TCPSocket.setExtraOptions(tcpExtraOptions); + console.log(`${caseName} success`); + expect(true).assertTrue(); + done(); + } catch (error) { + console.log(`${caseName} failed,error:${error}`); + done(); + } + console.log("************* Telephony_Socket_TCPSocket_setExtraOptions_0200 Test end*************"); + done(); + }); + + /* + * @tc.number : Telephony_Socket_TCPSocket_setExtraOptions_0300 + * @tc.name : setExtraOptions + * @tc.desc : Sets other attributes of the TCPSocket connection. + */ + it('Telephony_Socket_TCPSocket_setExtraOptions_0300', 0, async function (done) { + console.log("************* Telephony_Socket_TCPSocket_setExtraOptions_0300 Test start*************"); + let caseName = "Telephony_Socket_TCPSocket_setExtraOptions_0300" + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + let tcpExtraOptions: socket.TCPExtraOptions = { + socketLinger: { + on: true, + linger: true + } + } + socket.TCPSocket.setExtraOptions(tcpExtraOptions, (error) => { + if (error) { + console.log(`${caseName} error, case success,error:${toString(error)}`); + done(); + return; + } + expect().assertFail(); + console.log(`${caseName} error, case failed`); + done(); + }) + console.log("************* Telephony_Socket_TCPSocket_setExtraOptions_0300 Test end*************"); + done(); + }); + + /* + * @tc.number : Telephony_Socket_TCPSocket_setExtraOptions_0400 + * @tc.name : setExtraOptions + * @tc.desc : Sets other attributes of the TCPSocket connection. + */ + it('Telephony_Socket_TCPSocket_setExtraOptions_0400', 0, async function (done) { + console.log("************* Telephony_Socket_TCPSocket_setExtraOptions_0400 Test start*************"); + let caseName = "Telephony_Socket_TCPSocket_setExtraOptions_0400" + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + let tcpExtraOptions: socket.TCPExtraOptions = { + socketLinger: { + on: true, + linger: true + } + } + try { + await socket.TCPSocket.setExtraOptions(tcpExtraOptions); + console.log(`${caseName} success`); + expect(true).assertTrue(); + done(); + } catch (error) { + console.log(`${caseName} failed,error:${error}`); + done(); + } + console.log("************* Telephony_Socket_TCPSocket_setExtraOptions_0400 Test end*************"); + done(); + }); + + /* + * @tc.number : Telephony_Socket_TCPSocket_getRemoteAddress_0100 + * @tc.name : getRemoteAddress + * @tc.desc : Obtains the peer address of a TCPSocket connection. + */ + it('Telephony_Socket_TCPSocket_getRemoteAddress_0100', 0, async function (done) { + console.log("************* Telephony_Socket_TCPSocket_getRemoteAddress_0100 Test start*************"); + let caseName = "Telephony_Socket_TCPSocket_getRemoteAddress_0100" + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + socket.TCPSocket.getRemoteAddress((error) => { + if (error) { + console.log(`${caseName} error, case success,error:${toString(error)}`); + done(); + return; + } + expect().assertFail(); + done(); + }) + console.log("************* Telephony_Socket_TCPSocket_getRemoteAddress_0100 Test end*************"); + done(); + }); + + /* + * @tc.number : Telephony_Socket_TCPSocket_getRemoteAddress_0200 + * @tc.name : getRemoteAddress + * @tc.desc : Obtains the peer address of a TCPSocket connection. + */ + it('Telephony_Socket_TCPSocket_getRemoteAddress_0200', 0, async function (done) { + console.log("************* Telephony_Socket_TCPSocket_getRemoteAddress_0200 Test start*************"); + let caseName = "Telephony_Socket_TCPSocket_getRemoteAddress_0200" + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + socket.TCPSocket.getRemoteAddress().then(data => { + console.log(`${caseName} success,data:${toString(data)}`); + }).catch((error) => { + console.log(`${caseName} failed,error:${toString(error)}`); + }); + console.log("************* Telephony_Socket_TCPSocket_getRemoteAddress_0200 Test end*************"); + done(); + }); + + /* + * @tc.number : Telephony_Socket_TCPSocket_on_message_0100 + * @tc.name : on + * @tc.desc : Listens for message receiving events of the TCPSocket connection. + */ + it('Telephony_Socket_TCPSocket_on_message_0100', 0, async function (done) { + console.log("************* Telephony_Socket_TCPSocket_on_message_0100 Test start*************"); + let caseName = "Telephony_Socket_TCPSocket_on_message_0100" + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + socket.TCPSocket.on("message", data => { + let socketRemoteInfo: socket.SocketRemoteInfo = data.remoteInfo; + console.log(`${caseName} port:${socketRemoteInfo.port}`); + console.log(`${caseName} size:${socketRemoteInfo.size}`); + }); + console.log("************* Telephony_Socket_TCPSocket_on_message_0100 Test end*************"); + done(); + }); + + /* + * @tc.number : Telephony_Socket_TCPSocket_off_message_0100 + * @tc.name : off + * @tc.desc : Cancels listening for message receiving events of the TCPSocket connection. + */ + it('Telephony_Socket_TCPSocket_off_message_0100', 0, async function (done) { + console.log("************* Telephony_Socket_TCPSocket_off_message_0100 Test start*************"); + let caseName = "Telephony_Socket_TCPSocket_off_message_0100" + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + socket.TCPSocket.off("message", data => { + let socketRemoteInfo: socket.SocketRemoteInfo = data.remoteInfo; + console.log(`${caseName} port:${socketRemoteInfo.port}`); + console.log(`${caseName} size:${socketRemoteInfo.size}`); + }); + console.log("************* Telephony_Socket_TCPSocket_off_message_0100 Test end*************"); + done(); + }); + + /* + * @tc.number : Telephony_Socket_TCPSocket_off_message_0200 + * @tc.name : off + * @tc.desc : Cancels listening for message receiving events of the TCPSocket connection. + */ + it('Telephony_Socket_TCPSocket_off_message_0200', 0, async function (done) { + console.log("************* Telephony_Socket_TCPSocket_off_message_0200 Test start*************"); + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + socket.TCPSocket.off("message"); + expect(true).assertTrue(); + console.log("************* Telephony_Socket_TCPSocket_off_message_0200 Test end*************"); + done(); + }); + + /* + * @tc.number : Telephony_Socket_TCPSocket_on_connect_0100 + * @tc.name : on + * @tc.desc : Listens for connection or close events of the TCPSocket connection. + */ + it('Telephony_Socket_TCPSocket_on_connect_0100', 0, async function (done) { + console.log("************* Telephony_Socket_TCPSocket_on_connect_0100 Test start*************"); + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + socket.TCPSocket.on("connect", data => { + expect(true).assertTrue(); + }); + console.log("************* Telephony_Socket_TCPSocket_on_connect_0100 Test end*************"); + done(); + }); + + /* + * @tc.number : Telephony_Socket_TCPSocket_off_connect_0100 + * @tc.name : off + * @tc.desc : Cancels listening for connection or close events of the TCPSocket connection. + */ + it('Telephony_Socket_TCPSocket_off_connect_0100', 0, async function (done) { + console.log("************* Telephony_Socket_TCPSocket_off_connect_0100 Test start*************"); + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + socket.TCPSocket.off("connect", data => { + expect(true).assertTrue(); + }); + console.log("************* Telephony_Socket_TCPSocket_off_connect_0100 Test end*************"); + done(); + }); + + /* + * @tc.number : Telephony_Socket_TCPSocket_off_connect_0200 + * @tc.name : off + * @tc.desc : Cancels listening for connection or close events of the TCPSocket connection. + */ + it('Telephony_Socket_TCPSocket_off_connect_0200', 0, async function (done) { + console.log("************* Telephony_Socket_TCPSocket_off_connect_0200 Test start*************"); + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + socket.TCPSocket.off("connect"); + expect(true).assertTrue(); + console.log("************* Telephony_Socket_TCPSocket_off_connect_0200 Test end*************"); + done(); + }); + + /* + * @tc.number : Telephony_Socket_TCPSocket_on_close_0100 + * @tc.name : on + * @tc.desc : Listens for connection or close events of the TCPSocket connection. + */ + it('Telephony_Socket_TCPSocket_on_close_0100', 0, async function (done) { + console.log("************* Telephony_Socket_TCPSocket_on_close_0100 Test start*************"); + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + socket.TCPSocket.on("close", data => { + expect(true).assertTrue(); + }); + console.log("************* Telephony_Socket_TCPSocket_on_close_0100 Test end*************"); + done(); + }); + + /* + * @tc.number : Telephony_Socket_TCPSocket_off_close_0100 + * @tc.name : off + * @tc.desc : Cancels listening for connection or close events of the TCPSocket connection. + */ + it('Telephony_Socket_TCPSocket_off_close_0100', 0, async function (done) { + console.log("************* Telephony_Socket_TCPSocket_off_close_0100 Test start*************"); + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + socket.TCPSocket.off("close", data => { + expect(true).assertTrue(); + }); + console.log("************* Telephony_Socket_TCPSocket_off_close_0100 Test end*************"); + done(); + }); + + /* + * @tc.number : Telephony_Socket_TCPSocket_off_close_0200 + * @tc.name : off + * @tc.desc : Cancels listening for connection or close events of the TCPSocket connection. + */ + it('Telephony_Socket_TCPSocket_off_close_0200', 0, async function (done) { + console.log("************* Telephony_Socket_TCPSocket_off_close_0200 Test start*************"); + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + socket.TCPSocket.off("close"); + expect(true).assertTrue(); + console.log("************* Telephony_Socket_TCPSocket_off_close_0200 Test end*************"); + done(); + }); + + /* + * @tc.number : Telephony_Socket_TCPSocket_on_error_0100 + * @tc.name : on + * @tc.desc : Listens for error events of the TCPSocket connection. + */ + it('Telephony_Socket_TCPSocket_on_error_0100', 0, async function (done) { + console.log("************* Telephony_Socket_TCPSocket_on_error_0100 Test start*************"); + let caseName = "Telephony_Socket_TCPSocket_on_error_0100" + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + socket.TCPSocket.on("error", error => { + console.log(`${caseName} fail, error:${toString(error)}`); + expect().assertFail(); + }); + expect(true).assertTrue(); + console.log("************* Telephony_Socket_TCPSocket_on_error_0100 Test end*************"); + done(); + }); + + /* + * @tc.number : Telephony_Socket_TCPSocket_off_error_0100 + * @tc.name : off + * @tc.desc : Cancels listening for error events of the TCPSocket connection. + */ + it('Telephony_Socket_TCPSocket_off_error_0100', 0, async function (done) { + console.log("************* Telephony_Socket_TCPSocket_off_error_0100 Test start*************"); + let caseName = "Telephony_Socket_TCPSocket_off_error_0100" + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + socket.TCPSocket.off("error", error => { + console.log(`${caseName} fail, error:${toString(error)}`); + expect().assertFail(); + }); + expect(true).assertTrue(); + console.log("************* Telephony_Socket_TCPSocket_off_error_0100 Test end*************"); + done(); + }); + + /* + * @tc.number : Telephony_Socket_TCPSocket_off_error_0200 + * @tc.name : off + * @tc.desc : Cancels listening for error events of the TCPSocket connection. + */ + it('Telephony_Socket_TCPSocket_off_error_0200', 0, async function (done) { + console.log("************* Telephony_Socket_TCPSocket_off_error_0200 Test start*************"); + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + socket.TCPSocket.off("error"); + expect(true).assertTrue(); + console.log("************* Telephony_Socket_TCPSocket_off_error_0200 Test end*************"); + done(); + }); + + console.log("************* socket Test end*************"); + + }) +} \ No newline at end of file diff --git a/telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/MainAbility/test/Utils.ets b/telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/MainAbility/test/Utils.ets new file mode 100644 index 000000000..65f70088d --- /dev/null +++ b/telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/MainAbility/test/Utils.ets @@ -0,0 +1,119 @@ +// @ts-nocheck +/** + * 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 class Utils { + static rect_left; + static rect_top; + static rect_right; + static rect_bottom; + static rect_value; + static notCheck = true; + + static sleep(time) { + return new Promise((resolve, reject) => { + setTimeout(() => { + resolve() + }, time) + }).then(() => { + console.info(`sleep ${time} over...`) + }) + } + + static getComponentRect(key) { + let strJson = getInspectorByKey(key); + let obj = JSON.parse(strJson); + console.info("[getInspectorByKey] current component obj is: " + JSON.stringify(obj)); + let rectInfo = JSON.parse('[' + obj.$rect + ']') + console.info("[getInspectorByKey] rectInfo is: " + rectInfo); + this.rect_left = JSON.parse('[' + rectInfo[0] + ']')[0] + this.rect_top = JSON.parse('[' + rectInfo[0] + ']')[1] + this.rect_right = JSON.parse('[' + rectInfo[1] + ']')[0] + this.rect_bottom = JSON.parse('[' + rectInfo[1] + ']')[1] + return this.rect_value = { + "left": this.rect_left, "top": this.rect_top, "right": this.rect_right, "bottom": this.rect_bottom + } + } + + static async swipe(downX, downY, upX, upY, steps) { + console.info('start to swipe') + this.drags(downX, downY, upX, upY, steps, false) + } + + static async drag(downX, downY, upX, upY, steps) { + console.info('start to drag') + this.drags(downX, downY, upX, upY, steps, true) + } + + static async drags(downX, downY, upX, upY, steps, drag) { + var xStep; + var yStep; + var swipeSteps; + var ret; + xStep = 0; + yStep = 0; + ret = false; + swipeSteps = steps; + if (swipeSteps == 0) { + swipeSteps = 1; + } + xStep = (upX - downX) / swipeSteps; + yStep = (upY - downY) / swipeSteps; + console.info('move step is: ' + 'xStep: ' + xStep + ' yStep: ' + yStep) + var downPonit: TouchObject = { + id: 1, + x: downX, + y: downY, + type: TouchType.Down, + } + console.info('down touch started: ' + JSON.stringify(downPonit)) + sendTouchEvent(downPonit); + console.info('start to move') + if (drag) { + await this.sleep(500) + } + for (var i = 1;i <= swipeSteps; i++) { + var movePoint: TouchObject = { + id: 1, + x: downX + (xStep * i), + y: downY + (yStep * i), + type: TouchType.Move + } + console.info('move touch started: ' + JSON.stringify(movePoint)) + ret = sendTouchEvent(movePoint) + if (ret == false) { + break; + } + await this.sleep(5) + } + console.info('start to up') + if (drag) { + await this.sleep(100) + } + var upPoint: TouchObject = { + id: 1, + x: upX, + y: upY, + type: TouchType.Up, + } + console.info('up touch started: ' + JSON.stringify(upPoint)) + sendTouchEvent(upPoint) + await this.sleep(500) + } +} + + + + diff --git a/telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/MainAbility/test/WebSocketJsunit.test.ets b/telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/MainAbility/test/WebSocketJsunit.test.ets new file mode 100644 index 000000000..79008189d --- /dev/null +++ b/telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/MainAbility/test/WebSocketJsunit.test.ets @@ -0,0 +1,515 @@ +// @ts-nocheck +/** + * 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 {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "deccjsunit/index.ets"; +import webSocket from '@ohos.net.webSocket' +import utils from './Utils.ets' + +export default function webSocketJsunit() { + describe('webSocketTest', function () { + console.log("************* webSocket Test start*************"); + + /* + * @tc.number : Telephony_WebSocket_WebSocket_createWebSocket_0100 + * @tc.name : createWebSocket + * @tc.desc : Creates a web socket connection. + */ + it('Telephony_WebSocket_WebSocket_createWebSocket_0100', 0, async function (done) { + console.log("************* Telephony_WebSocket_WebSocket_createWebSocket_0100 Test start*************"); + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + var mWebSocket = webSocket.createWebSocket(); + expect(mWebSocket != null).assertTrue(); + console.log("************* Telephony_WebSocket_WebSocket_createWebSocket_0100 Test end*************"); + done(); + }) + + /* + * @tc.number : Telephony_WebSocket_WebSocketRequestOptions_header_0100 + * @tc.name : webSocketRequestOptions.header + * @tc.desc : webSocketRequestOptions.header + */ + it('Telephony_WebSocket_WebSocketRequestOptions_header_0100', 0, async function (done) { + console.log("************* Telephony_WebSocket_WebSocketRequestOptions_header_0100 Test start*************"); + let webSocketRequestOptions: webSocket.WebSocketRequestOptions = { + header: "test header" + } + expect(webSocketRequestOptions.header === "test header").assertTrue(); + console.log("************* Telephony_WebSocket_WebSocketRequestOptions_header_0100 Test end*************"); + done(); + }) + + /* + * @tc.number : Telephony_WebSocket_WebSocketCloseOptions_code_0100 + * @tc.name : webSocketCloseOptions.code + * @tc.desc : webSocketCloseOptions.code + */ + it('Telephony_WebSocket_WebSocketCloseOptions_code_0100', 0, async function (done) { + console.log("************* Telephony_WebSocket_WebSocketCloseOptions_code_0100 Test start*************"); + let webSocketCloseOptions: webSocket.WebSocketCloseOptions = { + code: 1 + } + expect(webSocketCloseOptions.code === 1).assertTrue(); + console.log("************* Telephony_WebSocket_WebSocketCloseOptions_code_0100 Test end*************"); + done(); + }) + + /* + * @tc.number : Telephony_WebSocket_WebSocket_connect_0100 + * @tc.name : connect + * @tc.desc : Initiates a WebSocket request to establish a WebSocket connection to a given URL. + */ + it('Telephony_WebSocket_WebSocket_connect_0100', 0, async function (done) { + console.log("************* Telephony_WebSocket_WebSocket_connect_0100 Test start*************"); + let caseName = "Telephony_WebSocket_WebSocket_connect_0100" + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + webSocket.connect({ + url: "www.baidu.com" + }, (error, data) => { + if (error) { + console.log(`${caseName} error, case success,error:${toString(error)}`); + done(); + return; + } + expect().assertFail(); + console.log(`${caseName} error, case failed,data:${toString(data)}`); + done(); + }) + console.log("************* Telephony_WebSocket_WebSocket_connect_0100 Test end*************"); + done(); + }) + + /* + * @tc.number : Telephony_WebSocket_WebSocket_connect_0200 + * @tc.name : connect + * @tc.desc : Initiates a WebSocket request to establish a WebSocket connection to a given URL. + */ + it('Telephony_WebSocket_WebSocket_connect_0200', 0, async function (done) { + console.log("************* Telephony_WebSocket_WebSocket_connect_0200 Test start*************"); + let caseName = "Telephony_WebSocket_WebSocket_connect_0200" + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + let webSocketRequestOptions: webSocket.WebSocketRequestOptions = { + header: "test header" + } + webSocket.connect("www.baidu.com", webSocketRequestOptions, (error, data) => { + if (error) { + console.log(`${caseName} error, case success,error:${toString(error)}`); + done(); + return; + } + expect().assertFail(); + console.log(`${caseName} error, case failed,data:${toString(data)}`); + done(); + }) + console.log("************* Telephony_WebSocket_WebSocket_connect_0200 Test end*************"); + done(); + }) + + /* + * @tc.number : Telephony_WebSocket_WebSocket_connect_0300 + * @tc.name : connect + * @tc.desc : Initiates a WebSocket request to establish a WebSocket connection to a given URL. + */ + it('Telephony_WebSocket_WebSocket_connect_0300', 0, async function (done) { + console.log("************* Telephony_WebSocket_WebSocket_connect_0300 Test start*************"); + let caseName = "Telephony_WebSocket_WebSocket_connect_0300" + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + let webSocketRequestOptions: webSocket.WebSocketRequestOptions = { + header: "test header" + } + webSocket.connect("www.baidu.com", webSocketRequestOptions).then(data => { + expect(true).assertTrue(); + console.log(`${caseName} success,data:${toString(data)}`); + }).catch((error) => { + console.log(`${caseName} failed,error:${toString(error)}`); + }) + console.log("************* Telephony_WebSocket_WebSocket_connect_0300 Test end*************"); + done(); + }) + + /* + * @tc.number : Telephony_WebSocket_WebSocket_connect_0400 + * @tc.name : connect + * @tc.desc : Initiates a WebSocket request to establish a WebSocket connection to a given URL. + */ + it('Telephony_WebSocket_WebSocket_connect_0400', 0, async function (done) { + console.log("************* Telephony_WebSocket_WebSocket_connect_0400 Test start*************"); + let caseName = "Telephony_WebSocket_WebSocket_connect_0400" + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + webSocket.connect("www.baidu.com").then(data => { + expect(true).assertTrue(); + console.log(`${caseName} success,data:${toString(data)}`); + }).catch((error) => { + console.log(`${caseName} failed,error:${toString(error)}`); + }) + console.log("************* Telephony_WebSocket_WebSocket_connect_0400 Test end*************"); + done(); + }) + + /* + * @tc.number : Telephony_WebSocket_WebSocket_send_0100 + * @tc.name : send + * @tc.desc : Sends data through a WebSocket connection. + */ + it('Telephony_WebSocket_WebSocket_send_0100', 0, async function (done) { + console.log("************* Telephony_WebSocket_WebSocket_send_0100 Test start*************"); + let caseName = "Telephony_WebSocket_WebSocket_send_0100" + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + webSocket.send("test data", (error, data) => { + if (error) { + console.log(`${caseName} error, case success,error:${toString(error)}`); + done(); + return; + } + expect().assertFail(); + console.log(`${caseName} error, case failed,data:${toString(data)}`); + done(); + }) + console.log("************* Telephony_WebSocket_WebSocket_send_0100 Test end*************"); + done(); + }) + + /* + * @tc.number : Telephony_WebSocket_WebSocket_send_0200 + * @tc.name : send + * @tc.desc : Sends data through a WebSocket connection. + */ + it('Telephony_WebSocket_WebSocket_send_0200', 0, async function (done) { + console.log("************* Telephony_WebSocket_WebSocket_send_0200 Test start*************"); + let caseName = "Telephony_WebSocket_WebSocket_send_0200" + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + webSocket.send("test data").then(data => { + expect(true).assertTrue(); + console.log(`${caseName} success,data:${toString(data)}`); + }).catch((error) => { + console.log(`${caseName} failed,error:${toString(error)}`); + }) + console.log("************* Telephony_WebSocket_WebSocket_send_0200 Test end*************"); + done(); + }) + + /* + * @tc.number : Telephony_WebSocket_WebSocket_on_open_0100 + * @tc.name : on + * @tc.desc : Enables listening for the open events of a WebSocket connection. + */ + it('Telephony_WebSocket_WebSocket_on_open_0100', 0, async function (done) { + console.log("************* Telephony_WebSocket_WebSocket_on_open_0100 Test start*************"); + let caseName = "Telephony_WebSocket_WebSocket_on_open_0100" + try{ + webSocket.on("open", (error, data) => { + if (error) { + console.log(`${caseName} error, case success,error:${toString(error)}`); + done(); + return; + } + expect().assertFail(); + console.log(`${caseName} error, case failed,data:${toString(data)}`); + done(); + }); + expect(true).assertTrue(); + done(); + }catch(err){ + expect(true).assertTrue(); + console.log(`${caseName} error, catch error:${toString(err)}`); + done(); + } + console.log("************* Telephony_WebSocket_WebSocket_on_open_0100 Test end*************"); + done(); + }); + + /* + * @tc.number : Telephony_WebSocket_WebSocket_off_open_0100 + * @tc.name : off + * @tc.desc : Cancels listening for the open events of a WebSocket connection. + */ + it('Telephony_WebSocket_WebSocket_off_open_0100', 0, async function (done) { + console.log("************* Telephony_WebSocket_WebSocket_off_open_0100 Test start*************"); + let caseName = "Telephony_WebSocket_WebSocket_off_open_0100" + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + webSocket.off("open", (error, data) => { + if (error) { + console.log(`${caseName} error, case success,error:${toString(error)}`); + done(); + return; + } + expect().assertFail(); + console.log(`${caseName} error, case failed,data:${toString(data)}`); + done(); + }); + console.log("************* Telephony_WebSocket_WebSocket_off_open_0100 Test end*************"); + done(); + }); + + /* + * @tc.number : Telephony_WebSocket_WebSocket_off_open_0200 + * @tc.name : off + * @tc.desc : Cancels listening for the open events of a WebSocket connection. + */ + it('Telephony_WebSocket_WebSocket_off_open_0200', 0, async function (done) { + console.log("************* Telephony_WebSocket_WebSocket_off_open_0200 Test start*************"); + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + webSocket.off("open"); + expect(true).assertTrue(); + console.log("************* Telephony_WebSocket_WebSocket_off_open_0200 Test end*************"); + done(); + }); + + /* + * @tc.number : Telephony_WebSocket_WebSocket_on_message_0100 + * @tc.name : on + * @tc.desc : Enables listening for the message events of a WebSocket connection. + */ + it('Telephony_WebSocket_WebSocket_on_message_0100', 0, async function (done) { + console.log("************* Telephony_WebSocket_WebSocket_on_message_0100 Test start*************"); + let caseName = "Telephony_WebSocket_WebSocket_on_message_0100" + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + webSocket.on("message", (error, data) => { + if (error) { + console.log(`${caseName} error, case success,error:${toString(error)}`); + done(); + return; + } + expect().assertFail(); + console.log(`${caseName} error, case failed,data:${toString(data)}`); + done(); + }); + console.log("************* Telephony_WebSocket_WebSocket_on_message_0100 Test end*************"); + done(); + }); + + /* + * @tc.number : Telephony_WebSocket_WebSocket_off_message_0100 + * @tc.name : off + * @tc.desc : Cancels listening for the message events of a WebSocket connection. + */ + it('Telephony_WebSocket_WebSocket_off_message_0100', 0, async function (done) { + console.log("************* Telephony_WebSocket_WebSocket_off_message_0100 Test start*************"); + let caseName = "Telephony_WebSocket_WebSocket_off_message_0100" + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + webSocket.off("message", (error, data) => { + if (error) { + console.log(`${caseName} error, case success,error:${toString(error)}`); + done(); + return; + } + expect().assertFail(); + console.log(`${caseName} error, case failed,data:${toString(data)}`); + done(); + }); + console.log("************* Telephony_WebSocket_WebSocket_off_message_0100 Test end*************"); + done(); + }); + + /* + * @tc.number : Telephony_WebSocket_WebSocket_off_message_0200 + * @tc.name : off + * @tc.desc : Cancels listening for the message events of a WebSocket connection. + */ + it('Telephony_WebSocket_WebSocket_off_message_0200', 0, async function (done) { + console.log("************* Telephony_WebSocket_WebSocket_off_message_0200 Test start*************"); + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + webSocket.off("message"); + expect(true).assertTrue(); + console.log("************* Telephony_WebSocket_WebSocket_off_message_0200 Test end*************"); + done(); + }); + + /* + * @tc.number : Telephony_WebSocket_WebSocket_on_close_0100 + * @tc.name : on + * @tc.desc : Enables listening for the close events of a WebSocket connection. + */ + it('Telephony_WebSocket_WebSocket_on_close_0100', 0, async function (done) { + console.log("************* Telephony_WebSocket_WebSocket_on_close_0100 Test start*************"); + let caseName = "Telephony_WebSocket_WebSocket_on_close_0100" + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + webSocket.on("close", (error, data) => { + if (error) { + console.log(`${caseName} error, case success,error:${toString(error)}`); + done(); + return; + } + expect().assertFail(); + console.log(`${caseName} error, case failed,data:${toString(data)}`); + done(); + }); + console.log("************* Telephony_WebSocket_WebSocket_on_close_0100 Test end*************"); + done(); + }); + + /* + * @tc.number : Telephony_WebSocket_WebSocket_off_close_0100 + * @tc.name : off + * @tc.desc : Cancels listening for the close events of a WebSocket connection. + */ + it('Telephony_WebSocket_WebSocket_off_close_0100', 0, async function (done) { + console.log("************* Telephony_WebSocket_WebSocket_off_close_0100 Test start*************"); + let caseName = "Telephony_WebSocket_WebSocket_off_close_0100" + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + webSocket.off("close", (error, data) => { + if (error) { + console.log(`${caseName} error, case success,error:${toString(error)}`); + done(); + return; + } + expect().assertFail(); + console.log(`${caseName} error, case failed,data:${toString(data)}`); + done(); + }); + console.log("************* Telephony_WebSocket_WebSocket_off_close_0100 Test end*************"); + done(); + }); + + /* + * @tc.number : Telephony_WebSocket_WebSocket_off_close_0200 + * @tc.name : off + * @tc.desc : Cancels listening for the close events of a WebSocket connection. + */ + it('Telephony_WebSocket_WebSocket_off_close_0200', 0, async function (done) { + console.log("************* Telephony_WebSocket_WebSocket_off_close_0200 Test start*************"); + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + webSocket.off("close"); + expect(true).assertTrue(); + console.log("************* Telephony_WebSocket_WebSocket_off_close_0200 Test end*************"); + done(); + }); + + /* + * @tc.number : Telephony_WebSocket_WebSocket_on_error_0100 + * @tc.name : on + * @tc.desc : Enables listening for the error events of a WebSocket connection. + */ + it('Telephony_WebSocket_WebSocket_on_error_0100', 0, async function (done) { + console.log("************* Telephony_WebSocket_WebSocket_on_error_0100 Test start*************"); + let caseName = "Telephony_WebSocket_WebSocket_on_error_0100" + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + webSocket.on("error", error => { + console.log(`${caseName} fail, error:${toString(error)}`); + expect().assertFail(); + }); + expect(true).assertTrue(); + console.log("************* Telephony_WebSocket_WebSocket_on_error_0100 Test end*************"); + done(); + }); + + /* + * @tc.number : Telephony_WebSocket_WebSocket_off_error_0100 + * @tc.name : off + * @tc.desc : Cancels listening for the error events of a WebSocket connection. + */ + it('Telephony_WebSocket_WebSocket_off_error_0100', 0, async function (done) { + console.log("************* Telephony_WebSocket_WebSocket_off_error_0100 Test start*************"); + let caseName = "Telephony_WebSocket_WebSocket_off_error_0100" + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + webSocket.off("error", error => { + console.log(`${caseName} fail, error:${toString(error)}`); + expect().assertFail(); + }); + expect(true).assertTrue(); + console.log("************* Telephony_WebSocket_WebSocket_off_error_0100 Test end*************"); + done(); + }); + + /* + * @tc.number : Telephony_WebSocket_WebSocket_off_error_0200 + * @tc.name : off + * @tc.desc : Cancels listening for the error events of a WebSocket connection. + */ + it('Telephony_WebSocket_WebSocket_off_error_0200', 0, async function (done) { + console.log("************* Telephony_WebSocket_WebSocket_off_error_0200 Test start*************"); + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + webSocket.off("error"); + expect(true).assertTrue(); + console.log("************* Telephony_WebSocket_WebSocket_off_error_0200 Test end*************"); + done(); + }); + + console.log("************* webSocket Test end*************"); + + }) +} \ No newline at end of file diff --git a/telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/MainAbility/test/lib/Const.js b/telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/MainAbility/test/lib/Const.js new file mode 100644 index 000000000..f9263cd46 --- /dev/null +++ b/telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/MainAbility/test/lib/Const.js @@ -0,0 +1,36 @@ +/** + * 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. + */ + +// sim slot id +export const DEFAULT_SLOTID = 0; +export const SLOTID3 = 3; +export const SLOTID2 = 2; +export const SLOTID_MINUS1 = -1; + +// sim correct password +export const CORRECT_PIN = '1234'; +export const CORRECT_PIN2 = '18099014'; + +// sim incorrect password +export const INCORRECT_PIN = '134679'; +export const INCORRECT_PIN_LEN3 = '123'; +export const INCORRECT_PUK = '134679'; +export const INCORRECT_PIN2 = '134679'; +export const INCORRECT_PIN2_LEN3 = '123'; +export const INCORRECT_PIN2_LEN9 = '123456789'; +export const INCORRECT_PUK2 = '134679'; + +// lock status response +export const LOCK_RESULT = { SUCCESS: 0, FAILURE: -1, EXCEPTION: -2 }; \ No newline at end of file diff --git a/telephony/telephonyjstest/netmanager_socket/entry/src/main/resources/base/element/string.json b/telephony/telephonyjstest/netmanager_socket/entry/src/main/resources/base/element/string.json new file mode 100644 index 000000000..03b8532c5 --- /dev/null +++ b/telephony/telephonyjstest/netmanager_socket/entry/src/main/resources/base/element/string.json @@ -0,0 +1,12 @@ +{ + "string": [ + { + "name": "entry_MainAbility", + "value": "entry_MainAbility" + }, + { + "name": "description_mainability", + "value": "ETS_Empty Ability" + } + ] +} \ No newline at end of file diff --git a/telephony/telephonyjstest/netmanager_socket/entry/src/main/resources/base/media/icon.png b/telephony/telephonyjstest/netmanager_socket/entry/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>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/resources/rawfile/star-1-2.png b/telephony/telephonyjstest/netmanager_socket/entry/src/main/resources/rawfile/star-1-2.png new file mode 100644 index 0000000000000000000000000000000000000000..450c3dd3ca68bf601bd08e5f41797d376e20d00d GIT binary patch literal 8295 zcma)iby!qi)GiDI3@ITfJq#cs(xo6VIK9g0Is58cut9YYAhAky89NJ&c$4N6Nm zw8Wj?_uaqmbN@K!?C070th3LGz1Mo*9j&FIL_x|(iid|s0au1;Ejqu(x%6MX}UcP^pVq^MKx?9Z3<6HZSZ(YTWwl+ z4})r2h&L?_5Z3xL9JTpl$1We;HwOfV*U2Dd;4VathABE2mL~&90=s!A z17A=j029Bxgn&sP{lPFWGr*0ABr?l!nhT^H>H*JtEAfpTOhQ8`F<+vJ8@ZDt_v2l} zOF0@&=65xE>0mI)Bv(k<5_x1Wr}DE!>r#HG91U6(z}Lz^i4RY3X&Tfw3&nM%1C5a) z%(ySExg?jj0C8QEq$g*CpQ*Xk7yhNiNn@bzJnMOrz${d^ZW9+zK}FP6Wt)@*prd*F z(rz`Qjq{pA&L7Hx1K?P`{_=|>e3O_&^n>(;eRI>{gq^xXjKN& z@MCLic)gQH^`1Je&lNP6cFPmo@#}YJ&*-b0%L%rIiIEC%K9b2VMf24JMlrxCU;4bM9NM`z%7*&=MO^=(k?eYD|N0NSRUq1vD*l*s- z4;5;mae9K07G>0^3_eR`n2mvtsZw7^GmKor6U4O}T!EZW#(u#BA_V$L+A#=JNj^p8 zMo$u9AUc@@o>+Zc_I+>hn*oW`p*FU_>v9MlGJsQZG`UKU!kSII&(iR9spGPLK_?dv zH62cSuh@C=`WqBAh*E;+sLBQMSO4tFt#w3r4D|KjW&wIRodFgZ;AhwXl8fiVM#Mlq?)7vx`ZL}!b@}1f<))jG`dj8AWF8Jt&p)QZi4IvM<$fyTHy((7 z_OI$?I{kDulhThr+>EksY|4LaHNAz}+DgDCag*>B4ccc;ylt*QweQ$+ zaU1J{j4VM#N>nqMl^fHb;cJyC5i38kTb5L%!`KGwH%;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Wo?dER_ux6XQb@q$tQPW?CMu6GVQd;R=iR;-S{Kr%Zks7>b1 zNs{|-+jhObYE}NR&`TGGr^h^4bjh%c>R#@=8nM&Md>_a+zVulsl;){flFekV1t9ob z+SqfV_Pv3$2f)bQ8%Ul2>fdYR^1zs0BQF~olsOj5AodC&Q_7SMFzsz2 z9newxE&jodk~tNHwl%LBMMDbrk=(^b literal 0 HcmV?d00001 diff --git a/telephony/telephonyjstest/new_add/BUILD.gn b/telephony/telephonyjstest/new_add/BUILD.gn new file mode 100644 index 000000000..9feab10c4 --- /dev/null +++ b/telephony/telephonyjstest/new_add/BUILD.gn @@ -0,0 +1,32 @@ +# 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("ActsNewAddEtsTest") { + hap_profile = "./entry/src/main/config.json" + deps = [ + ":ace_demo_ets_assets", + ":ace_demo_ets_resources", + ] + ets2abc = true + certificate_profile = "./signature/openharmony_sx.p7b" + hap_name = "ActsNewAddEtsTest" +} +ohos_js_assets("ace_demo_ets_assets") { + source_dir = "./entry/src/main/ets/MainAbility" +} +ohos_resources("ace_demo_ets_resources") { + sources = [ "./entry/src/main/resources" ] + hap_profile = "./entry/src/main/config.json" +} diff --git a/telephony/telephonyjstest/new_add/Test.json b/telephony/telephonyjstest/new_add/Test.json new file mode 100644 index 000000000..cb0f0ae2e --- /dev/null +++ b/telephony/telephonyjstest/new_add/Test.json @@ -0,0 +1,18 @@ +{ + "description": "Configuration for hjunit demo Tests", + "driver": { + "type": "JSUnitTest", + "test-timeout": "1800000", + "package": "com.ohos.newadd", + "shell-timeout": "60000" + }, + "kits": [ + { + "test-file-name": [ + "ActsNewAddEtsTest.hap" + ], + "type": "AppInstallKit", + "cleanup-apps": true + } + ] +} diff --git a/telephony/telephonyjstest/new_add/entry/src/main/config.json b/telephony/telephonyjstest/new_add/entry/src/main/config.json new file mode 100644 index 000000000..0a3639dd7 --- /dev/null +++ b/telephony/telephonyjstest/new_add/entry/src/main/config.json @@ -0,0 +1,93 @@ +{ + "app": { + "bundleName": "com.ohos.newadd", + "vendor": "open", + "version": { + "code": 1000000, + "name": "1.0.0" + }, + "apiVersion": { + "compatible": 7, + "releaseType": "Release", + "target": 7 + } + }, + "deviceConfig": {}, + "module": { + "package": "com.ohos.newadd", + "name": ".MyApplication", + "mainAbility": ".MainAbility", + "srcPath": "MainAbility", + "deviceType": [ + "phone" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "entry", + "moduleType": "entry", + "installationFree": false + }, + "abilities": [ + { + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ], + "orientation": "unspecified", + "visible": true, + "srcPath": "MainAbility", + "name": ".MainAbility", + "srcLanguage": "ets", + "icon": "$media:icon", + "description": "$string:description_mainability", + "formsEnabled": false, + "label": "$string:entry_MainAbility", + "type": "page", + "launchType": "standard" + } + ], + "js": [ + { + "mode": { + "syntax": "ets", + "type": "pageAbility" + }, + "pages": [ + "pages/index", + "pages/Button", + "pages/Blank", + "pages/DataPanel", + "pages/Divider", + "pages/Text", + "pages/RowSplit", + "pages/Scroll", + "pages/Stack", + "pages/Image", + "pages/Progress", + "pages/Qrcode", + "pages/Rating", + "pages/Span", + "pages/Slider", + "pages/Badge", + "pages/Column", + "pages/ColumnSplit", + "pages/Counter", + "pages/Flex", + "pages/GridContainer" + + ], + "name": ".MainAbility", + "window": { + "designWidth": 720, + "autoDesignWidth": false + } + } + ] + } +} \ No newline at end of file diff --git a/telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/app.ets b/telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/app.ets new file mode 100644 index 000000000..261fadca2 --- /dev/null +++ b/telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/app.ets @@ -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('Application onCreate') + }, + onDestroy() { + console.info('Application onDestroy') + }, +} \ No newline at end of file diff --git a/telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/pages/Badge.ets b/telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/pages/Badge.ets new file mode 100644 index 000000000..66de6f8e3 --- /dev/null +++ b/telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/pages/Badge.ets @@ -0,0 +1,95 @@ +/* + * 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. + */ + +@Entry +@Component +struct badge { + @State counts: number = 33 + @State message: string = 'new' + @State active: boolean = false + private content: string = "badge Page"; + + onPageShow() { + console.info('badge page show called'); + } + + onBuildDone() { + console.info('badge page build done called'); + } + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Scroll() { + Column() { + Text(`${this.content}`) + .fontSize(50) + .fontWeight(FontWeight.Bold) + Badge({ + count: this.counts, + position: BadgePosition.Right, + maxCount: 99, + style: { color: 0xFFFFFF, fontSize: 16, badgeSize: 20, badgeColor: Color.Red } + }) { + Button('message') + .onClick(() => { + this.counts++ + }) + .width(100).height(50).backgroundColor(0x317aff) + } + .width(100) + .height(50) + .key('badge') + + Text("BadgePosition.RightTop").fontSize(16) + Badge({ + count: this.counts, + position: BadgePosition.RightTop, + maxCount: 99, + style: { color: 0xFFFFFF, fontSize: '16', badgeSize: '20', badgeColor: Color.Red } + }) { + Button('message') + .onClick(() => { + this.counts++ + }) + .width(100).height(50).backgroundColor(0x317aff) + } + .width(100) + .height(50) + .key('badge1') + + Text("BadgePosition.Left").fontSize(16) + Badge({ + count: this.counts, + position: BadgePosition.Left, + maxCount: 99, + style: { color: Color.Pink, fontSize: 16, badgeSize: 20, badgeColor: Color.Red } + }) { + Button('message') + .onClick(() => { + this.counts++ + }) + .width(100).height(50).backgroundColor(0x317aff) + } + .width(100) + .height(50) + .key('badge2') + } + } + } + .key('flex') + .width('100%') + .height('100%') + } +} diff --git a/telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/pages/Blank.ets b/telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/pages/Blank.ets new file mode 100644 index 000000000..a50fc719e --- /dev/null +++ b/telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/pages/Blank.ets @@ -0,0 +1,47 @@ +/* + * 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. + */ + +@Entry +@Component +struct blank_testcase { + @State Color: Color = Color.Pink + @State active: boolean = false + private content: string = "Blank Page" + + onPageShow() { + console.info('Blank page show called'); + } + + onBuildDone() { + console.info('Blank page build done called'); + } + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Text(`${this.content}`) + .fontSize(50) + .fontWeight(FontWeight.Bold) + Blank(100) + .color(this.Color) + .key('blank') + Text('on/off').fontSize(18).height(60) + } + .key('flex') + .width('100%') + .height('100%') + + + } +} diff --git a/telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/pages/Button.ets b/telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/pages/Button.ets new file mode 100644 index 000000000..ac2271ea3 --- /dev/null +++ b/telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/pages/Button.ets @@ -0,0 +1,70 @@ +/* + * 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 router from '@system.router' + +@Entry +@Component +struct button_testcase { + @State stateEffect: boolean = true + @State ButtonType: ButtonType = ButtonType.Circle + private content: string = "Button Page"; + + onPageShow() { + console.info('Button page show called'); + } + + onBuildDone() { + console.info('Button page build done called'); + } + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Text(`${this.content}`) + .fontSize(50) + .fontWeight(FontWeight.Bold) + Button('1.value', { type: ButtonType.Circle, stateEffect: this.stateEffect }) + .fontSize(12) + .fontWeight(FontWeight.Bold) + .fontColor(0xCCCCCC) + .height(40) + .width(40) + .key('button') + .backgroundColor('#0D9FFB') + .onClick(() => { + router.back() + }) + .padding(10) + Button() { + Text("2.Capsule") + } + .type(ButtonType.Capsule) + .stateEffect(false) + .backgroundColor('#0D9FFB') + .padding(10) + .key('button1') + + Button() { + Text("3.Normal") + }.type(ButtonType.Normal) + .backgroundColor('#0D9FFB') + .key('button2') + + }.key('flex') + .width('100%') + .height('100%') + } +} + diff --git a/telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/pages/Column.ets b/telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/pages/Column.ets new file mode 100644 index 000000000..b9e5c84e2 --- /dev/null +++ b/telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/pages/Column.ets @@ -0,0 +1,51 @@ +/* + * 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. + */ + +@Entry +@Component +struct column { + @State active: boolean = false + private content: string = "Column Page" + + onPageShow() { + console.info('Column page show called'); + } + + onBuildDone() { + console.info('Column page build done called'); + } + + build() { + Column({ space: 5 }) { + Text('alignItems(Center)').fontSize(9).fontColor(0xCCCCCC).width('90%') + Column() { + Column().width('50%').height(50).backgroundColor(0xAFEEEE) + Column().width('50%').height(50).backgroundColor(0x00FFFF) + }.alignItems(HorizontalAlign.Center).width('90%').border({ width: 1 }).key('column') + + Text('alignItems(Start)').fontSize(9).fontColor(0xCCCCCC).width('90%') + Column({ space: '5' }) { + Column().width('50%').height(50).backgroundColor(0xAFEEEE) + Column().width('50%').height(50).backgroundColor(0x00FFFF) + }.alignItems(HorizontalAlign.Start).width('90%').border({ width: 1 }).key('column1') + + Text('alignItems(End)').fontSize(9).fontColor(0xCCCCCC).width('90%') + Column() { + Column().width('50%').height(50).backgroundColor(0xAFEEEE) + Column().width('50%').height(50).backgroundColor(0x00FFFF) + }.alignItems(HorizontalAlign.End).width('90%').border({ width: 1 }).key('column2') + }.width('100%').padding({ top: 5 }) + } +} diff --git a/telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/pages/ColumnSplit.ets b/telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/pages/ColumnSplit.ets new file mode 100644 index 000000000..cb0597310 --- /dev/null +++ b/telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/pages/ColumnSplit.ets @@ -0,0 +1,70 @@ +/* + * 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. + */ + +@Entry +@Component +struct columnSplit { + private content: string = "ColumnSplit Page" + + onPageShow() { + console.info('ColumnSplit page show called'); + } + + onBuildDone() { + console.info('ColumnSplit page build done called'); + } + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Scroll() { + Column() { + Text(`${this.content}`) + .fontSize(50) + .fontWeight(FontWeight.Bold) + Column() { + Text('ColumnSplit').fontSize(9).fontColor(0xCCCCCC).width('90%') + ColumnSplit() { + Text('1').width('100%').height(50).backgroundColor(0xF5DEB3).textAlign(TextAlign.Center) + Text('2').width('100%').height(50).backgroundColor(0xD2B48C).textAlign(TextAlign.Center) + Text('3').width('100%').height(50).backgroundColor(0xF5DEB3).textAlign(TextAlign.Center) + Text('4').width('100%').height(50).backgroundColor(0xD2B48C).textAlign(TextAlign.Center) + Text('5').width('100%').height(50).backgroundColor(0xF5DEB3).textAlign(TextAlign.Center) + }.key('columnSplit') + .resizeable(true) + .width('90%').height('60%') + + }.width("100%") + + Column() { + Text('ColumnSplit1').fontSize(9).fontColor(0xCCCCCC).width('90%') + ColumnSplit() { + Text('1').width('100%').height(50).backgroundColor(0xF5DEB3).textAlign(TextAlign.Center) + Text('2').width('100%').height(50).backgroundColor(0xD2B48C).textAlign(TextAlign.Center) + Text('3').width('100%').height(50).backgroundColor(0xF5DEB3).textAlign(TextAlign.Center) + Text('4').width('100%').height(50).backgroundColor(0xD2B48C).textAlign(TextAlign.Center) + Text('5').width('100%').height(50).backgroundColor(0xF5DEB3).textAlign(TextAlign.Center) + }.key('columnSplit1') + .resizeable(false) + .width('90%').height('60%') + + }.width("100%") + } + } + } + .key('flex') + .width('100%') + .height('100%') + } +} diff --git a/telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/pages/Counter.ets b/telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/pages/Counter.ets new file mode 100644 index 000000000..ecdbfaf10 --- /dev/null +++ b/telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/pages/Counter.ets @@ -0,0 +1,51 @@ +/* + * 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. + */ + +@Entry +@Component +struct counter { + @State value: number = 0 + @State active: boolean = false + private content: string = "Counter Page" + + onPageShow() { + console.info('Counter page show called'); + } + + onBuildDone() { + console.info('Counter page build done called'); + } + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Text(`${this.content}`) + .fontSize(50) + .fontWeight(FontWeight.Bold) + Counter() { + Text(this.value.toString()) + }.margin(100) + .key('counter') + .onInc(() => { + this.value++ + }) + .onDec(() => { + this.value-- + }) + }.width("100%") + .key('flex') + .width('100%') + .height('100%') + } +} diff --git a/telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/pages/DataPanel.ets b/telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/pages/DataPanel.ets new file mode 100644 index 000000000..3c6248484 --- /dev/null +++ b/telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/pages/DataPanel.ets @@ -0,0 +1,69 @@ +/* + * 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 router from '@system.router' + +@Entry +@Component +struct dataPanel_testcase { + @State width: string= "200" + @State height: string= "100" + @State active: boolean = false + private content: string = "DataPanel Page" + + onPageShow() { + console.info('Blank page show called'); + } + + onBuildDone() { + console.info('Blank page build done called'); + } + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Text(`${this.content}`) + .fontSize(50) + DataPanel({ values: [20, 40, 20], max: 100, type: DataPanelType.Line }) + .width(this.width) + .height(this.height) + .key('DataPanel') + .onClick(() => { + router.back() + }) + .closeEffect(false) + + DataPanel({ values: [20, 40, 20], max: 100, type: DataPanelType.Circle}) + .width(this.width) + .height(this.height) + .key('DataPanel2') + .onClick(() => { + router.back() + }) + .closeEffect(true) + DataPanel({ values: [20, 40, 20], max: 100}) + .width(this.width) + .height(this.height) + .key('DataPanel3') + .onClick(() => { + router.back() + }) + .closeEffect(false) + } + .key('flex') + .width('100%') + .height('100%') + + } +} diff --git a/telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/pages/Divider.ets b/telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/pages/Divider.ets new file mode 100644 index 000000000..02bf60779 --- /dev/null +++ b/telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/pages/Divider.ets @@ -0,0 +1,71 @@ +/* + * 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 router from '@system.router' + +@Entry +@Component +struct divider_textcase { + @State vertical: boolean = true + @State color: Color = Color.Red + @State strokeWidth: number = 7 + @State lineCap: LineCapStyle = LineCapStyle.Butt + @State active: boolean = false + private content: string = "Divider Page"; + + onPageShow() { + console.info('Button page show called'); + } + + onBuildDone() { + console.info('Button page build done called'); + } + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Text(`${this.content}`) + .fontSize(50) + Divider() + .lineCap(LineCapStyle.Butt) + .strokeWidth(this.strokeWidth) + .color(this.color) + .vertical(this.vertical) + .height(150) + .key('divider') + .onClick(() => { + router.back() + }) + Divider() + .lineCap(LineCapStyle.Round) + .vertical(false) + .color(Color.Green) + .strokeWidth(10) + .height(150) + .key('divider1') + Divider() + .lineCap(LineCapStyle.Square) + .color(Color.Green) + .vertical(true) + .strokeWidth(10) + .height(150) + .key('divider2') + } + .key('flex') + .width('100%') + .height('100%') + } +} + + diff --git a/telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/pages/Flex.ets b/telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/pages/Flex.ets new file mode 100644 index 000000000..a0e21251e --- /dev/null +++ b/telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/pages/Flex.ets @@ -0,0 +1,135 @@ +/* + * 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. + */ + +@Entry +@Component +struct flex { + private content: string = "Flex Page" + + onPageShow() { + console.info('Flex page show called'); + } + + onBuildDone() { + console.info('Flex page build done called'); + } + + build() { + Column() { + Column({ space : 2 }) { + Text('direction:Column').fontSize(9).fontColor(0xCCCCCC).width('90%') + Flex({ + direction: FlexDirection.Column, + wrap: FlexWrap.NoWrap, + justifyContent: FlexAlign.Center, + alignItems:ItemAlign.Start, + alignContent: FlexAlign.Start, + }) { + Text('1').width('100%').height(20).backgroundColor(0xF5DEB3) + Text('2').width('100%').height(20).backgroundColor(0xD2B48C) + Text('3').width('100%').height(20).backgroundColor(0xF5DEB3) + } + .key('flex') + .height(70) + .width('90%') + .padding(10) + .backgroundColor(0xAFEEEE) + + Text('direction:Row').fontSize(9).fontColor(0xCCCCCC).width('90%') + Flex({ + direction: FlexDirection.Row, + wrap: FlexWrap.Wrap, + justifyContent: FlexAlign.Start, + alignItems:ItemAlign.Start, + alignContent: FlexAlign.Center, + }) { + Text('1').width('20%').height(20).backgroundColor(0xF5DEB3) + Text('2').width('20%').height(20).backgroundColor(0xD2B48C) + Text('3').width('20%').height(20).backgroundColor(0xF5DEB3) + } + .key('flex1') + .height(70) + .width('90%') + .padding(10) + .backgroundColor(0xAFEEEE) + + Text('direction:RowReverse').fontSize(9).fontColor(0xCCCCCC).width('90%') + Flex({ + direction: FlexDirection.RowReverse, + wrap: FlexWrap.Wrap, + justifyContent: FlexAlign.End, + alignItems:ItemAlign.End, + alignContent: FlexAlign.End, + }) { + Text('1').width('50%').height(20).backgroundColor(0xF5DEB3) + Text('2').width('50%').height(20).backgroundColor(0xD2B48C) + Text('3').width('50%').height(20).backgroundColor(0xF5DEB3) + } + .key('flex2') + .height(90) + .width('90%') + .padding(10) + .backgroundColor(0xAFEEEE) + + Text('justifyContent:SpaceBetween').fontSize(9).fontColor(0xCCCCCC).width('90%') + Flex({ + justifyContent: FlexAlign.SpaceBetween, + wrap: FlexWrap.Wrap, + }) { + Text('1').width('100%').height(20).backgroundColor(0xF5DEB3) + Text('2').width('100%').height(20).backgroundColor(0xD2B48C) + Text('3').width('100%').height(20).backgroundColor(0xF5DEB3) + } + .key('flex3') + .height(100) + .width('90%') + .padding(10) + .backgroundColor(0xAFEEEE) + + Text('justifyContent AND alignContent').fontSize(9).fontColor(0xCCCCCC).width('90%') + Flex({ + justifyContent: FlexAlign.SpaceEvenly, + alignContent: FlexAlign.SpaceEvenly, + wrap: FlexWrap.Wrap, + }) { + Text('1').width('50%').height(20).backgroundColor(0xF5DEB3) + Text('2').width('50%').height(20).backgroundColor(0xD2B48C) + Text('3').width('50%').height(20).backgroundColor(0xF5DEB3) + } + .key('flex4') + .height(90) + .width('90%') + .padding(10) + .backgroundColor(0xAFEEEE) + + Text('justifyContent AND alignContent').fontSize(9).fontColor(0xCCCCCC).width('90%') + Flex({ + justifyContent: FlexAlign.SpaceAround, + alignContent: FlexAlign.SpaceAround, + wrap: FlexWrap.Wrap, + }) { + Text('1').width('50%').height(20).backgroundColor(0xF5DEB3) + Text('2').width('50%').height(20).backgroundColor(0xD2B48C) + Text('3').width('50%').height(20).backgroundColor(0xF5DEB3) + } + .key('flex5') + .height(90) + .width('90%') + .padding(10) + .backgroundColor(0xAFEEEE) + }.width('100%').margin({ top: 5 }) + }.width('100%') + } +} diff --git a/telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/pages/GridContainer.ets b/telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/pages/GridContainer.ets new file mode 100644 index 000000000..573581104 --- /dev/null +++ b/telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/pages/GridContainer.ets @@ -0,0 +1,170 @@ +/* + * 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. + */ + +@Entry +@Component +struct gridContainer { + @State sizeType: SizeType = SizeType.XS + @State active: boolean = false + private content: string = "GridContainer Page" + + onPageShow() { + console.info('GridContainer page show called'); + } + + onBuildDone() { + console.info('GridContainer page build done called'); + } + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Text(`${this.content}`) + .fontSize(50) + .fontWeight(FontWeight.Bold) + Scroll() { + Column({ space: 5 }) { + GridContainer({ columns: 12, sizeType: this.sizeType, gutter: 10, margin: 20 }) { + Row() { + Text('1') + .useSizeType({ + xs: { span: 6, offset: 0 }, + sm: { span: 2, offset: 0 }, + md: { span: 2, offset: 0 }, + lg: { span: 2, offset: 0 } + }) + .height(50).backgroundColor(0x4682B4).textAlign(TextAlign.Center) + Text('2').gridSpan(2) + + .height(50).backgroundColor(0x00BFFF).textAlign(TextAlign.Center) + Text('3').gridOffset(3) + + .height(50).backgroundColor(0x4682B4).textAlign(TextAlign.Center) + } + }.key('gridContainer') + .width('90%') + .alignItems(HorizontalAlign.Start) + + Text('Click Simulate to change the device width').fontSize(9).width('90%').fontColor(0xCCCCCC) + Row() { + Button('XS') + .onClick(() => { + this.sizeType = SizeType.XS + }).backgroundColor(0x317aff) + Button('SM') + .onClick(() => { + this.sizeType = SizeType.SM + }).backgroundColor(0x317aff) + Button('MD') + .onClick(() => { + this.sizeType = SizeType.MD + }).backgroundColor(0x317aff) + Button('LG') + .onClick(() => { + this.sizeType = SizeType.LG + }).backgroundColor(0x317aff) + } + + GridContainer({ columns: "auto", sizeType: SizeType.MD, gutter: '10', margin: '20' }) { + Row() { + Text('1') + .useSizeType({ + xs: { span: 6, offset: 0 }, + sm: { span: 2, offset: 0 }, + md: { span: 2, offset: 0 }, + lg: { span: 2, offset: 0 } + }) + .height(50).backgroundColor(0x4682B4).textAlign(TextAlign.Center) + Text('2').gridSpan(2) + + .height(50).backgroundColor(0x00BFFF).textAlign(TextAlign.Center) + Text('3').gridOffset(3) + + .height(50).backgroundColor(0x4682B4).textAlign(TextAlign.Center) + } + }.key('gridContainer1') + .width('90%') + .alignItems(HorizontalAlign.Center) + + GridContainer({ columns: 12, sizeType: SizeType.SM, gutter: 10, margin: 20 }) { + Row() { + Text('1') + .useSizeType({ + xs: { span: 6, offset: 0 }, + sm: { span: 2, offset: 0 }, + md: { span: 2, offset: 0 }, + lg: { span: 2, offset: 0 } + }) + .height(50).backgroundColor(0x4682B4).textAlign(TextAlign.Center) + Text('2').gridSpan(2) + + .height(50).backgroundColor(0x00BFFF).textAlign(TextAlign.Center) + Text('3').gridOffset(3) + + .height(50).backgroundColor(0x4682B4).textAlign(TextAlign.Center) + } + }.key('gridContainer2') + .width('90%') + .alignItems(HorizontalAlign.End) + + GridContainer({ columns: 12, sizeType: SizeType.LG, gutter: 10, margin: 20 }) { + Row() { + Text('1') + .useSizeType({ + xs: { span: 6, offset: 0 }, + sm: { span: 2, offset: 0 }, + md: { span: 2, offset: 0 }, + lg: { span: 2, offset: 0 } + }) + .height(50).backgroundColor(0x4682B4).textAlign(TextAlign.Center) + Text('2').gridSpan(2) + + .height(50).backgroundColor(0x00BFFF).textAlign(TextAlign.Center) + Text('3').gridOffset(3) + + .height(50).backgroundColor(0x4682B4).textAlign(TextAlign.Center) + } + }.key('gridContainer3') + .width('90%') + .alignItems(HorizontalAlign.End) + + GridContainer({ columns: 12, sizeType: SizeType.Auto, gutter: 10, margin: 20 }) { + Row() { + Text('1') + .useSizeType({ + xs: { span: 6, offset: 0 }, + sm: { span: 2, offset: 0 }, + md: { span: 2, offset: 0 }, + lg: { span: 2, offset: 0 } + }) + .height(50).backgroundColor(0x4682B4).textAlign(TextAlign.Center) + Text('2').gridSpan(2) + + .height(50).backgroundColor(0x00BFFF).textAlign(TextAlign.Center) + Text('3').gridOffset(3) + + .height(50).backgroundColor(0x4682B4).textAlign(TextAlign.Center) + } + }.key('gridContainer4') + .width('90%') + .alignItems(HorizontalAlign.End) + + }.width('100%').margin({ top: 5 }) + } + } + .key('flex') + .width('100%') + .height('100%') + } +} diff --git a/telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/pages/Image.ets b/telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/pages/Image.ets new file mode 100644 index 000000000..5cc583e93 --- /dev/null +++ b/telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/pages/Image.ets @@ -0,0 +1,90 @@ +/* + * 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. + */ + +@Entry +@Component +struct image_textcase { + @State Width: number = 0 + @State height: number = 0 + + onPageShow() { + console.info('Image page show called'); + } + + onBuildDone() { + console.info('Image page build done called'); + } + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Column() { + Text(`Image page`) + .fontSize(50) + .fontWeight(FontWeight.Bold) + Image("/resources/rawfile/hand.png") + .matchTextDirection(false) + .fitOriginalSize(false) + .fillColor(0xCCCCCC) + .objectFit(ImageFit.Cover) + .objectRepeat(ImageRepeat.NoRepeat) + .interpolation(ImageInterpolation.None) + .renderMode(ImageRenderMode.Original) + .autoResize(false) + .syncLoad(false) + .sourceSize({ width: 200, height: 100 }) + .alt("/resources/rawfile/person.png") + .key('image1') + Image("/resources/rawfile/hand.png") + .objectFit(ImageFit.Contain) + .objectRepeat(ImageRepeat.X) + .interpolation(ImageInterpolation.High) + .renderMode(ImageRenderMode.Template) + .key('image2') + .height(180) + .width(180) + .onComplete((msg: { + width: number, + height: number + }) => { + this.Width = msg.width + this.height = msg.height + console.info('Width ----' + this.Width) + console.info('height ----' + this.height) + }) + .onError(() => { + console.info('load image fail') + }) + Image("/resources/rawfile/hand.png") + .objectFit(ImageFit.Fill) + .objectRepeat(ImageRepeat.Y) + .interpolation(ImageInterpolation.Low) + .key('image3') + Image("/resources/rawfile/hand.png") + .objectFit(ImageFit.None) + .objectRepeat(ImageRepeat.XY) + .interpolation(ImageInterpolation.Medium) + .key('image4') + Image("/resources/rawfile/hand.png") + .objectFit(ImageFit.ScaleDown) + .key('image5') + }.width(300) + .height(300) + .borderColor(Color.Pink) + .borderWidth(4) + } + } +} + + diff --git a/telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/pages/Navigator.ets b/telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/pages/Navigator.ets new file mode 100644 index 000000000..6c50769cf --- /dev/null +++ b/telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/pages/Navigator.ets @@ -0,0 +1,60 @@ +/* + * 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. + */ + +@Entry +@Component +struct navigator_testcase { + @State active: boolean = false + @State params: Object = { text: 'news' } + + onPageShow() { + console.info('Navigator page show called'); + } + + onBuildDone() { + console.info('Navigator page build done called'); + } + + build() { + Column() { + Navigator({ target: "pages/index", type: NavigationType.Back }) { + Text('Navigator test in Navigator,back') + }.active(this.active) + .key('navigator') + .params({ + data: 24 + }) + + Navigator({ target: "pages/index", type: NavigationType.Push }) { + Text('Navigator test in Navigator,push') + }.active(this.active) + .key('navigator2') + .params({ + data: 24 + }) + + Navigator({ target: "pages/index", type: NavigationType.Replace }) { + Text('Navigator test in Navigator,replace') + }.active(this.active) + .key('navigator3') + .params({ + data: 24 + }) + }.width(300) + .height(300) + .borderColor(Color.Pink) + .borderWidth(2) + } +} diff --git a/telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/pages/Panel.ets b/telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/pages/Panel.ets new file mode 100644 index 000000000..32ddabbd1 --- /dev/null +++ b/telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/pages/Panel.ets @@ -0,0 +1,96 @@ +/* + * 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. + */ + +@Entry +@Component +struct PanelExample { + @State show: boolean = true + + onPageShow() { + console.info('Panel page show called'); + } + + onBuildDone() { + console.info('Panel page build done called'); + } + + build() { + Column() { + Text('2021-09-30 Today Calendar: 1.afternoon......Click for details') + .width('90%') + .height(50) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + .padding({ left: 20 }) + .onClick(() => { + this.show = !this.show + }) + Panel(this.show) { + Column() { + Text('Today Calendar') + Divider() + Text('1. afternoon 4:00 The project meeting') + } + } + .key('panel') + .type(PanelType.Foldable) + .mode(PanelMode.Half) + .dragBar(true) + .fullHeight(500) + .halfHeight(250) + .miniHeight(100) + .onChange((value: any) => { + console.info(`width:${value.width},height:${value.height},mode:${value.mode}`) + }) + + Panel(this.show) { + Column() { + Text('Today Calendar') + Divider() + Text('1. afternoon 4:00 The project meeting') + } + } + .key('panel2') + .type(PanelType.Minibar) + .mode(PanelMode.Mini) + .dragBar(true) + .fullHeight(500) + .halfHeight(250) + .miniHeight(100) + .onChange((value: any) => { + console.info(`width:${value.width},height:${value.height},mode:${value.mode}`) + }) + + Panel(false) { + Column() { + Text('Today Calendar') + Divider() + Text('1. afternoon 4:00 The project meeting') + } + } + .key('panel3') + .type(PanelType.Temporary) + .mode(PanelMode.Full) + .dragBar(true) + .fullHeight(500) + .halfHeight(250) + .miniHeight(100) + .onChange((value: any) => { + console.info(`width:${value.width},height:${value.height},mode:${value.mode}`) + }) + + }.width('100%').height('50%').backgroundColor(0xDCDCDC).padding({ top: 5 }) + } +} \ No newline at end of file diff --git a/telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/pages/Progress.ets b/telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/pages/Progress.ets new file mode 100644 index 000000000..c8608089f --- /dev/null +++ b/telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/pages/Progress.ets @@ -0,0 +1,76 @@ +/* + * 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. + */ + +@Entry +@Component +struct progress_testcase { + onPageShow() { + console.info('Progress page show called'); + } + + onBuildDone() { + console.info('Progress page build done called'); + } + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Column() { + Text(`Progress page`) + .fontSize(50) + .fontWeight(FontWeight.Bold) + Progress({ value: 20, total: 40, style: ProgressStyle.Linear }) + .value(3) + .color(Color.Blue) + .width(50) + .height(70) + .key('progress') + + Progress({ value: 20, total: 40, style: ProgressStyle.Eclipse }) + .value(3) + .color(Color.Blue) + .width(50) + .height(70) + .key('progress2') + + Progress({ value: 20, total: 40, style: ProgressStyle.Ring }) + .value(3) + .color(Color.Blue) + .width(50) + .height(70) + .key('progress3') + + Progress({ value: 20, total: 40, style: ProgressStyle.ScaleRing }) + .value(3) + .color(Color.Blue) + .width(50) + .height(70) + .key('progress4') + + Progress({ value: 20, total: 40, style: ProgressStyle.Capsule }) + .value(3) + .color(Color.Blue) + .width(50) + .height(70) + .key('progress5') + + } + .width(400) + .height(400) + .borderColor(Color.Pink) + .borderWidth(2) + } + } +} + diff --git a/telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/pages/Qrcode.ets b/telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/pages/Qrcode.ets new file mode 100644 index 000000000..5c0dd84ef --- /dev/null +++ b/telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/pages/Qrcode.ets @@ -0,0 +1,44 @@ +/* + * 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. + */ + +@Entry +@Component +struct qrcode_textcase { + @State Color: Color = Color.Pink + + onPageShow() { + console.info('Qrcode page show called'); + } + + onBuildDone() { + console.info('Qrcode page build done called'); + } + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Text(`Qrcode page`) + .fontSize(50) + .fontWeight(FontWeight.Bold) + QRCode('hello world') + .color("#FFFFC0CB") + .backgroundColor(this.Color) + .width("200") + .height("100") + .key('qrcode') + } + } +} + + diff --git a/telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/pages/Rating.ets b/telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/pages/Rating.ets new file mode 100644 index 000000000..b29e26a39 --- /dev/null +++ b/telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/pages/Rating.ets @@ -0,0 +1,63 @@ +/* + * 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. + */ + +@Entry +@Component +struct rating_testcase { + @State rating: number = 2 + + onPageShow() { + console.info('Rating page show called'); + } + + onBuildDone() { + console.info('Rating page build done called'); + } + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Column() { + Text(`Rating page`) + .fontSize(50) + .fontWeight(FontWeight.Bold) + Rating({ rating: 2, indicator: false }) + .stepSize(0.5) + .stars(5) + .starStyle({ + backgroundUri: '/resources/rawfile/star-1-1.png', + foregroundUri: '/resources/rawfile/star-1-3.png', + secondaryUri: '/resources/rawfile/star-1-2.png' + }) + .onChange((value: number) => { + this.rating = value + }) + .key('rating1') + Rating({ rating: 2, indicator: true }) + .stepSize(0.5) + .stars(5) + .starStyle({ + backgroundUri: '/resources/rawfile/star-1-1.png', + foregroundUri: '/resources/rawfile/star-1-3.png', + secondaryUri: '/resources/rawfile/star-1-2.png' + }) + .key('rating2') + }.width(300) + .height(300) + .borderColor(Color.Pink) + .borderWidth(2) + } + } +} + diff --git a/telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/pages/RowSplit.ets b/telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/pages/RowSplit.ets new file mode 100644 index 000000000..0f4f397b1 --- /dev/null +++ b/telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/pages/RowSplit.ets @@ -0,0 +1,78 @@ +/* + * 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 router from '@system.router' + +@Entry +@Component +struct rowSplit_testcase { + @State resizeable: boolean = false + private content: string = "rowSplit Page"; + + onPageShow() { + console.info('RowSplit page show called'); + } + + onBuildDone() { + console.info('RowSplit page build done called'); + } + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Text(`${this.content}`) + .fontSize(50) + .fontWeight(FontWeight.Bold) + RowSplit() { + Column() { + Text('Demo1.RowSplit') + .fontSize(15) + .fontWeight(FontWeight.Bold) + } + + Column() { + Text('Demo2.RowSplit') + .fontSize(15) + .fontWeight(FontWeight.Bold) + } + } + .height(100) + .key('rowSplit') + .resizeable(this.resizeable) + .onClick(() => { + router.back() + }) + + RowSplit() { + Column() { + Text('Demo3.RowSplit') + .fontSize(15) + .fontWeight(FontWeight.Bold) + } + + Column() { + Text('Demo4.RowSplit') + .fontSize(15) + .fontWeight(FontWeight.Bold) + } + }.height(100) + .key('rowSplit1') + .resizeable(true) + } + .key('flex') + .width('100%') + .height('100%') + } +} + diff --git a/telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/pages/Scroll.ets b/telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/pages/Scroll.ets new file mode 100644 index 000000000..363089d22 --- /dev/null +++ b/telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/pages/Scroll.ets @@ -0,0 +1,200 @@ +/* + * 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. + */ + +@Entry +@Component +struct scroll_testcase { + @State scrollBarWidth: number = 20 + @State scrollable: ScrollDirection = ScrollDirection.None + @State scrollBarColor: Color = Color.Pink + @State scrollBar: BarState= BarState.On + private value1: Array = [1, 2, 3, 4, 5, 6, 7, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30] + @State edge: Edge= Edge.Top + private content: string = "Scroll Page"; + scroller: Scroller = new Scroller(); + + onPageShow() { + console.info('Button page show called'); + } + + onBuildDone() { + console.info('Button page build done called'); + } + + build() { + + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Text(`${this.content}`) + .fontSize(50) + .fontWeight(FontWeight.Bold) + Scroll(this.scroller) { + Column() { + ForEach( + this.value1, + item => { + Text(`${item}`) + .fontSize(15) + .width(400) + .margin(10) + .height(70) + .backgroundColor(0xfff5deb3) + }, + item => item + ) + } + } + .scrollable(ScrollDirection.Vertical) + .scrollBar(this.scrollBar) + .scrollBarColor(this.scrollBarColor) + .scrollBarWidth(this.scrollBarWidth) + .key('scroll') + .width(400) + .height(200) + .onScroll((xOffset: number, yOffset: number) => { + console.info(` current offset is ${xOffset} ${yOffset}`) + }) + .onScrollEnd(() => { + console.info(` now on scroll end`) + }) + .onScrollEdge((side: Edge) => { + console.info(`To the edge`) + }) + Scroll() { + Row() { + Text('scroll uppppp') + .width(60) + .height(100) + .backgroundColor(Color.Yellow) + .margin({ + right: 5, + left: 5 + }) + .key('text') + + Text('scroll to') + .width(60) + .height(100) + .backgroundColor(Color.Green) + .margin({ + right: 5, + left: 5 + }) + .onClick(() => { + this.scroller.scrollTo({ + xOffset: 100, + yOffset: 100, + }) + }) + Text('scroll page') + .width(60) + .height(100) + .backgroundColor(Color.Blue) + .margin({ + right: 5, + left: 5 + }) + .onClick(() => { + this.scroller.scrollPage({ + next: true + }) + }) + Text('scroll Edge') + .width(60) + .height(100) + .backgroundColor(Color.Blue) + .margin({ + right: 5, + left: 5 + }) + .onClick(() => { + this.scroller.scrollEdge(Edge.Top) + }) + Text('scroll Edge') + .width(60) + .height(100) + .backgroundColor(Color.Blue) + .margin({ + right: 5, + left: 5 + }) + .onClick(() => { + this.scroller.currentOffset() + }) + Text('scroll to index') + .width(60) + .height(100) + .backgroundColor(Color.Blue) + .margin({ + right: 5, + left: 5 + }) + .onClick(() => { + this.scroller.scrollToIndex(0) + console.info(` now on scroll end`) + }) + } + } + .key('scroll1') + .height(100) + .scrollable(ScrollDirection.Horizontal) + + Scroll() { + Column() { + Text("start").fontSize(30) + Text("scrollable1") + Text("scrollable2") + Text("scrollable3") + Text("scrollable4") + Text("scrollable1") + Text("scrollable2") + Text("scrollable3") + Text("scrollable4") + } + } + .padding(10) + .scrollable(ScrollDirection.None) + .scrollBar(BarState.Off) + .scrollBarColor(Color.Red) + .scrollBarWidth(5) + .width(300) + .height(200) + .key('scroll2') + + Scroll() { + Column() { + Text("start").fontSize(30) + Text("scrollable1") + Text("scrollable2") + Text("scrollable3") + Text("scrollable4") + Text("scrollable1") + Text("scrollable2") + Text("scrollable3") + Text("scrollable4") + } + } + .padding(10) + .scrollable(ScrollDirection.Free) + .scrollBar(BarState.Off) + .scrollBarColor(Color.Red) + .scrollBarWidth(5) + .width(300) + .height(200) + .key('scroll3') + } + .key('flex') + + } +} diff --git a/telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/pages/Slider.ets b/telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/pages/Slider.ets new file mode 100644 index 000000000..625cd0287 --- /dev/null +++ b/telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/pages/Slider.ets @@ -0,0 +1,82 @@ +/* + * 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. + */ + +@Entry +@Component +struct slider { + @State inSetValue: number= 40 + @State outSetValue: number= 40 + @State direction: Axis= Axis.Horizontal + @State Begin: number = SliderChangeMode.Begin + + onPageShow() { + console.info('Slider page show called'); + } + + onBuildDone() { + console.info('Slider page build done called'); + } + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Column() { + Text(`Slider page`) + .fontSize(50) + .fontWeight(FontWeight.Bold) + Slider({ + value: this.outSetValue, + min: 0, + max: 100, + step: 1, + direction: Axis.Horizontal, + reverse: false, + style: SliderStyle.OutSet + }) + .blockColor('#FFFF0000') + .selectedColor('#FF0000FF') + .trackColor('#FF808080') + .minLabel('10') + .maxLabel('10') + .showTips(false) + .showSteps(false) + .onChange((value: number, mode: SliderChangeMode) => { + this.outSetValue = value + this.Begin = mode + console.info('value: ' + value + '---mode: ' + mode) + }) + .width("100") + .height("100") + .key('slider1') + Slider({ + value: 40, + min: 0, + max: 100, + step: 1, + style: SliderStyle.InSet + }) + .blockColor(Color.Red) + .selectedColor(Color.Blue) + .trackColor(Color.Gray) + .showTips(true) + .showSteps(true) + .key('slider2') + }.width(300) + .height(300) + .borderColor(Color.Pink) + .borderWidth(2) + } + } +} + diff --git a/telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/pages/Span.ets b/telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/pages/Span.ets new file mode 100644 index 000000000..df5a71043 --- /dev/null +++ b/telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/pages/Span.ets @@ -0,0 +1,64 @@ +/* + * 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. + */ + +@Entry +@Component +struct span_textcase { + + onPageShow() { + console.info('Span page show called'); + } + + onBuildDone() { + console.info('Span page build done called'); + } + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Column() { + Text() { + Span('Test Span demo') + .decoration({ type: TextDecorationType.LineThrough, "color": Color.Red }) + .textCase(TextCase.UpperCase) + .fontColor(Color.Blue) + .fontSize("20fp") + .letterSpacing(5) + .fontFamily("sans-serif") + .fontWeight(FontWeight.Bold) + .fontStyle(FontStyle.Italic) + .key('span1') + Span('The second test Span demo') + .textCase(TextCase.LowerCase) + .fontColor(Color.Black) + .letterSpacing('5') + .fontSize(30) + .key('span2') + Span('The third test Span demo') + .textCase(TextCase.Normal) + .fontColor(Color.Yellow) + .fontSize("30fp") + .key('span3') + } + } + .width(300) + .height(300) + .borderColor(Color.Pink) + .borderWidth(4) + } + } +} + + + diff --git a/telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/pages/Stack.ets b/telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/pages/Stack.ets new file mode 100644 index 000000000..2a694889f --- /dev/null +++ b/telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/pages/Stack.ets @@ -0,0 +1,103 @@ +/* + * 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 router from '@system.router' + +@Entry +@Component +struct stack_testcase { + @State alignContent: Alignment = Alignment.Bottom + private content: string = "Stack Page"; + + onPageShow() { + console.info('Stack page show called'); + } + + onBuildDone() { + console.info('Stack page build done called'); + } + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Text(`${this.content}`) + .fontSize(50) + .fontWeight(FontWeight.Bold) + Stack({ alignContent: this.alignContent }) { + Text('First child, show in bottom').width('90%').height('100%').backgroundColor(0xd2cab3).align(Alignment.Top) + Text('Second child, show in top').width('70%').height('60%').backgroundColor(0xc1cbac).align(Alignment.Top) + } + .width('100%') + .height(80) + .margin({ top: 5 }) + .key('stack') + .onClick(() => { + router.back() + }) + + Stack({ alignContent: Alignment.BottomStart }) { + Text('First child, show in bottom').width('90%').height('100%').backgroundColor(0xd2cab3).align(Alignment.Top) + Text('Second child, show in top').width('70%').height('60%').backgroundColor(0xc1cbac).align(Alignment.Top) + }.width('100%').height(80).margin({ top: 5 }) + .key('stack1') + + Stack({ alignContent: Alignment.BottomEnd }) { + Text('First child, show in bottom').width('90%').height('100%').backgroundColor(0xd2cab3).align(Alignment.Top) + Text('Second child, show in top').width('70%').height('60%').backgroundColor(0xc1cbac).align(Alignment.Top) + }.width('100%').height(80).margin({ top: 5 }) + .key('stack2') + + Stack({ alignContent: Alignment.Start }) { + Text('First child, show in bottom').width('90%').height('100%').backgroundColor(0xd2cab3).align(Alignment.Top) + Text('Second child, show in top').width('70%').height('60%').backgroundColor(0xc1cbac).align(Alignment.Top) + }.width('100%').height(80).margin({ top: 5 }) + .key('stack3') + + Stack({ alignContent: Alignment.Center }) { + Text('First child, show in bottom').width('90%').height('100%').backgroundColor(0xd2cab3).align(Alignment.Top) + Text('Second child, show in top').width('70%').height('60%').backgroundColor(0xc1cbac).align(Alignment.Top) + }.width('100%').height(80).margin({ top: 5 }) + .key('stack4') + + Stack({ alignContent: Alignment.End }) { + Text('First child, show in bottom').width('90%').height('100%').backgroundColor(0xd2cab3).align(Alignment.Top) + Text('Second child, show in top').width('70%').height('60%').backgroundColor(0xc1cbac).align(Alignment.Top) + }.width('100%').height(80).margin({ top: 5 }) + .key('stack5') + + Stack({ alignContent: Alignment.Top }) { + Text('First child, show in bottom').width('90%').height('100%').backgroundColor(0xd2cab3).align(Alignment.Top) + Text('Second child, show in top').width('70%').height('60%').backgroundColor(0xc1cbac).align(Alignment.Top) + }.width('100%').height(60).margin({ top: 5 }) + .key('stack6') + + Stack({ alignContent: Alignment.TopStart }) { + Text('First child, show in bottom').width('90%').height('100%').backgroundColor(0xd2cab3).align(Alignment.Top) + Text('Second child, show in top').width('70%').height('60%').backgroundColor(0xc1cbac).align(Alignment.Top) + }.width('100%').height(60).margin({ top: 5 }) + .key('stack7') + + Stack({ alignContent: Alignment.TopEnd }) { + Text('First child, show in bottom').width('90%').height('100%').backgroundColor(0xd2cab3).align(Alignment.Top) + Text('Second child, show in top').width('70%').height('60%').backgroundColor(0xc1cbac).align(Alignment.Top) + }.width('100%').height(60).margin({ top: 5 }) + .key('stack8') + } + .key('flex') + .width('100%') + .height('100%') + + } +} + diff --git a/telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/pages/Text.ets b/telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/pages/Text.ets new file mode 100644 index 000000000..fbd1415dc --- /dev/null +++ b/telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/pages/Text.ets @@ -0,0 +1,237 @@ +/* + * 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. + */ + +// @ts-nocheck +import router from '@system.router' + +var paramInfo = router.getParams() +console.info("cd paramInfo" + JSON.stringify(paramInfo)) + +@Entry +@Component +struct text_textcase { + @State textAlign: TextAlign= TextAlign.End + @State lineHeight: string= '15fp' + @State overflow: TextOverflow = TextOverflow.Ellipsis + @State textOverflow: textOverflow<{ "overflow": TextOverflow }> = { "overflow": this.overflow } + @State maxLines: number = 2 + @State baselineOffset: number = 0 + @State textCase: TextCase= TextCase.Normal + @State decoration: decoration<{ + type: TextDecorationType, + color: Color + }> = { type: TextDecorationType.Underline, color: Color.Red } + @State color: Color = Color.Red + @State width: string= "200" + @State height: string= "100" + @State size: size = { width: 200, height: 100 } + @State marginBottom: string = "10px" + @State marginTop: string = "10px" + @State marginLeft: string = "10px" + @State marginRingt: string= "10px" + @State paddingBottom: string= "5" + @State paddingTop: string= "5" + @State paddingLeft: string= "5" + @State paddingRingt: string= "5" + @State constraintSize: constraintSize = { minWidth: 20, maxWidth: 200, minHeight: 0, maxHeight: 50 } + @State layoutPriority: string= "9px" + @State layoutWeight: string = "10px" + @State align: Alignment = Alignment.Center + @State direction: Direction = Direction.Auto + @State position: position<{ + x: string, + y: string + }> = { x: "50", y: "50" } + @State markAnchor: markAnchor<{ + x: string, + y: string + }> = { x: "50", y: "50" } + @State offset: offset<{ + x: string, + y: string + }> = { x: "50", y: "50" } + @State flexGrow: number = 5 + @State flexShrink: number = 2 + @State flexBasis: number = 0 + @State alignSelf: ItemAlign = ItemAlign.Auto + @State borderStyle: BorderStyle = BorderStyle.Dashed + @State borderRadius: number = 10 + @State borderWidth: string= "4px" + @State borderColor: Color= Color.Blue + @State backgroundColor: Color = Color.Pink + @State backgroundImageSize: ImageSize = ImageSize.Cover + @State backgroundImagePosition: Alignment= Alignment.Center + @State opacity: number= 1 + @State visibility: Visibility= Visibility.Visible + @State enabled: boolean = false + @State zIndex: number = 1 + @State fontStyle: FontStyle = FontStyle.Italic + @State fontSize: number = 15 + @State minFontSize: number = 15 + @State maxFontSize: number = 15 + @State letterSpacing: number= 10 + @State fontWeight: FontWeight= FontWeight.Bold + @State fontColor: Color= Color.Black + @State active: boolean = false + private content: string = "Text Page"; + + onPageShow() { + console.info('Text page show called'); + } + + onBuildDone() { + console.info('Text page build done called'); + } + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Text(`${this.content}`) + .fontSize(50) + .fontWeight(FontWeight.Bold) + Text('Text Anto test,Text Anto test,Text Anto test,Text Anto test,test,Text Anto test,Text Anto test,Text Anto test,Text Anto test,Text Anto test,Text Anto test') + .width(this.width) + .height(this.height) + .padding({ bottom: this.paddingBottom, top: this.paddingTop, right: this.paddingRingt, left: this.paddingLeft }) + .margin({ bottom: this.marginBottom, top: this.marginTop, right: this.marginRingt, left: this.marginLeft }) + .constraintSize(this.constraintSize) + .layoutWeight(this.layoutWeight) + .align(this.align) + .direction(this.direction) + .position(this.position) + .markAnchor(this.markAnchor) + .offset(this.offset) + .flexBasis(this.flexBasis) + .flexGrow(this.flexGrow) + .flexShrink(this.flexShrink) + .alignSelf(this.alignSelf) + .borderStyle(this.borderStyle) + .borderRadius(this.borderRadius) + .borderWidth(this.borderWidth) + .borderColor(this.borderColor) + .backgroundColor(this.backgroundColor) + .opacity(this.opacity) + .visibility(this.visibility) + .enabled(this.enabled) + .zIndex(this.zIndex) + .fontColor(this.fontColor) + .fontSize(this.fontSize) + .minFontSize(this.minFontSize) + .letterSpacing(this.letterSpacing) + .maxFontSize(this.maxFontSize) + .fontWeight(this.fontWeight) + .fontStyle(this.fontStyle) + .fontFamily("sans-serif") + .textAlign(this.textAlign) + .textOverflow(this.textOverflow) + .lineHeight(this.lineHeight) + .baselineOffset(this.baselineOffset) + .maxLines(2) + .textCase(this.textCase) + .decoration(this.decoration) + .aspectRatio(1) + .fontColor(Color.Black) + .key('Text') + Text('Text Anto test,Text Anto test,Text Anto test,Text Anto test,Text Anto test,Text Anto test,Text Anto test,Text Anto test') + .size({ width: 100, height: 50 }) + .padding({ bottom: 5, top: 5, right: 5, left: 10 }) + .margin({ bottom: 15, top: 10, right: 10, left: 10 }) + .fontSize('13') + .textAlign(TextAlign.Start) + .align(Alignment.Start) + .direction(Direction.Ltr) + .alignSelf(ItemAlign.Start) + .borderStyle(BorderStyle.Dotted) + .borderWidth(2) + .visibility(Visibility.Hidden) + .enabled(true) + .fontWeight(FontWeight.Normal) + .textAlign(TextAlign.Start) + .textOverflow(TextOverflow.Clip) + .maxLines(2) + .textCase(TextCase.LowerCase) + .decoration({ "type": TextDecorationType.LineThrough, "color": Color.Red }) + .fontColor(Color.White) + .key('Text1') + Text('Text Anto test,Text Anto test,Text Anto test,Text Anto test,Text Anto test,Text Anto test,Text Anto test,Text Anto test,Text Anto test') + .fontSize(13) + .width('100%') + .textAlign(TextAlign.Center) + .align(Alignment.TopEnd) + .direction(Direction.Rtl) + .alignSelf(ItemAlign.Center) + .borderStyle(BorderStyle.Solid) + .borderWidth(2) + .visibility(Visibility.None) + .fontWeight(FontWeight.Bolder) + .textAlign(TextAlign.Center) + .textOverflow(TextOverflow.None) + .textCase(TextCase.UpperCase) + .decoration({ "type": TextDecorationType.None, "color": Color.Red }) + .fontColor(Color.Blue) + .key('Text2') + Text('Text Anto test,Text Anto test,Text Anto test,Text Anto test') + .fontSize(13) + .align(Alignment.Top) + .alignSelf(ItemAlign.End) + .borderWidth(2) + .width('100%') + .fontWeight(FontWeight.Lighter) + .decoration({ type: TextDecorationType.Overline, color: Color.Red }) + .fontColor(Color.Gray) + .key('Text3') + Text('Text Anto test,Text Anto test') + .fontSize(13) + .align(Alignment.TopStart) + .alignSelf(ItemAlign.Baseline) + .borderWidth(2) + .width('100%') + .fontWeight(FontWeight.Medium) + .fontColor(Color.Brown) + .key('Text4') + Text('Text Anto test,Text Anto test,Text Anto test') + .fontSize(13) + .align(Alignment.End) + .alignSelf(ItemAlign.Stretch) + .borderWidth(2) + .width('100%') + .fontWeight(FontWeight.Regular) + .fontColor(Color.Grey) + .key('Text5') + Text('Text Anto test,Text Anto test,Text Anto test') + .fontSize(13) + .align(Alignment.BottomEnd) + .width('100%') + .fontColor(Color.Orange) + .key('Text6') + Text('Text Anto test,Text Anto test,Text Anto test') + .fontSize(13) + .align(Alignment.Bottom) + .width('100%') + .fontColor(Color.Yellow) + .key('Text7') + Text('Text Anto test,Text Anto test,Text Anto test') + .fontSize(13) + .align(Alignment.BottomStart) + .width('100%') + .key('Text8') + + } + .key('flex') + .width('100%') + .height('100%') + } +} + + diff --git a/telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/pages/index.ets b/telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/pages/index.ets new file mode 100644 index 000000000..10359134d --- /dev/null +++ b/telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/pages/index.ets @@ -0,0 +1,65 @@ +// @ts-nocheck +/** + * 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 file from '@system.file'; + +import {Core, ExpectExtend, InstrumentLog, ReportExtend} from "deccjsunit/index.ets"; +import testsuite from "../test/List.test.ets"; +import featureAbility from "@ohos.ability.featureAbility"; + +@Entry +@Component +struct MyComponent { + aboutToAppear() { + console.info("start run testcase!!!!") + featureAbility.getWant() + .then((Want) => { + const core = Core.getInstance(); + const expectExtend = new ExpectExtend({ + 'id': 'extend' + }); + core.addService('expect', expectExtend); + const reportExtend = new ReportExtend(file); + core.addService('report', reportExtend); + core.init(); + core.subscribeEvent('task', reportExtend); + const configService = core.getDefaultService('config'); + Want.parameters['timeout'] = 100000 + console.info('parameters---->' + JSON.stringify(Want.parameters)); + configService.setConfig(Want.parameters); + testsuite(); + core.execute(); + console.info('Operation successful. Data: ' + JSON.stringify(Want)); + }) + .catch((error) => { + console.error('Operation failed. Cause: ' + JSON.stringify(error)); + }) + } + + build() { + Flex({ + direction: FlexDirection.Column, + alignItems: ItemAlign.Center, + justifyContent: FlexAlign.Center + }) { + Text('ACE ETS TEST') + .fontSize(50) + .fontWeight(FontWeight.Bold) + } + .width('100%') + .height('100%') + } +} + diff --git a/telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/test/CallJsunit.test.ets b/telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/test/CallJsunit.test.ets new file mode 100644 index 000000000..cd87b8360 --- /dev/null +++ b/telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/test/CallJsunit.test.ets @@ -0,0 +1,850 @@ +// @ts-nocheck +/** + * 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index.ets' +import call from '@ohos.telephony.call'; +import utils from './Utils.ets' + +export const PHONE_NUMBER = ''; +export const DEFAULT_SLOT_ID = 0; +export const MEDIA_TYPE_VOICE = 0; +export const DIAL_SCENCE_CALL_NORMAL = 0; +export const DIAL_CARRIER_TYPE = 0; +export const DIAL_SCENCE_CALL_PRIVILEGED = 1; +export const BOUNDARY_NUMBER_INT = 2147483649; +export const CALL_ID_NOT_EXIST = 999; + +export function toString (data) { + if (typeof data === 'object') { + return JSON.stringify(data); + } else { + return data; + } +} + +class CallAttributeOptions { + constructor (callId) { + this.callId = callId; + } +} + +export default function callJsunit(){ + describe('callTest', function(){ + console.log("==========> call Test start ==========>"); + + /** + * @tc.number Telephony_Call_Call_Dial_0100 + * @tc.name Makes a call. + * @tc.desc Function test + */ + it("Telephony_Call_Call_Dial_0100",0,async function(done){ + let caseName:string = "Telephony_Call_Call_Dial_0100"; + console.log(`==========> ${caseName} Test start ==========>`); + call.dial(PHONE_NUMBER,(err,data) => { + if(err){ + console.log(`${caseName} error,case success,error:${toString(err)}`); + done(); + return; + } + expect().assertFail(); + console.log(`${caseName} success,case fail`); + done(); + }); + console.log(`==========> ${caseName} Test end ==========>`); + done(); + }); + + /** + * @tc.number Telephony_Call_Call_Dial_0200 + * @tc.name Makes a call. + * @tc.desc Function test + */ + it("Telephony_Call_Call_Dial_0200",0,async function(done){ + let caseName:string = "Telephony_Call_Call_Dial_0200"; + console.log(`==========> ${caseName} Test start ==========>`); + let options = {extras:false, accountId:DEFAULT_SLOT_ID, videoState:MEDIA_TYPE_VOICE, + dialScene:DIAL_SCENCE_CALL_PRIVILEGED, dialType:DIAL_CARRIER_TYPE}; + call.dial(PHONE_NUMBER,options,(err,data) => { + if(err){ + console.log(`${caseName} error,case success,error:${toString(err)}`); + done(); + return; + } + expect().assertFail(); + console.log(`${caseName} success,case fail`); + done(); + }); + console.log(`==========> ${caseName} Test end ==========>`); + done(); + }); + + /** + * @tc.number Telephony_Call_Call_Dial_0200 + * @tc.name Makes a call. + * @tc.desc Function test + */ + it("Telephony_Call_Call_Dial_0200",0,async function(done){ + let caseName:string = "Telephony_Call_Call_Dial_0200"; + console.log(`==========> ${caseName} Test start ==========>`); + let options = {extras:false, accountId:DEFAULT_SLOT_ID, videoState:MEDIA_TYPE_VOICE, + dialScene:DIAL_SCENCE_CALL_PRIVILEGED, dialType:DIAL_CARRIER_TYPE}; + call.dial(PHONE_NUMBER,options,(err,data) => { + if(err){ + console.log(`${caseName} error,case success,error:${toString(err)}`); + done(); + return; + } + expect().assertFail(); + console.log(`${caseName} success,case fail`); + done(); + }); + console.log(`==========> ${caseName} Test end ==========>`); + done(); + }); + + + + /** + * @tc.number Telephony_Call_Call_Dial_0300 + * @tc.name Makes a call. + * @tc.desc Function test + */ + it("Telephony_Call_Call_Dial_0300",0,async function(done){ + let caseName:string = "Telephony_Call_Call_Dial_0300"; + console.log(`==========> ${caseName} Test start ==========>`); + let options = {extras:false, accountId:DEFAULT_SLOT_ID, videoState:MEDIA_TYPE_VOICE, + dialScene:DIAL_SCENCE_CALL_PRIVILEGED, dialType:DIAL_CARRIER_TYPE}; + call.dial(PHONE_NUMBER,options).then(data=>{ + expect(true).assertTrue(); + }).catch(error =>{ + console.log(caseName+ " dial error :"+ toString(error)); + done(); + return; + }); + console.log(`==========> ${caseName} Test end ==========>`); + done(); + }); + + /** + * @tc.number Telephony_Call_Call_MakeCall_0100 + * @tc.name Make a call. + * @tc.desc Function test + */ + it("Telephony_Call_Call_MakeCall_0100",0,async function(done){ + let caseName:string = "Telephony_Call_Call_MakeCall_0100"; + console.log(`==========> ${caseName} Test start ==========>`); + try{ + let telNumber = ""; + call.makeCall(telNumber,(error) => { + if(error){ + console.log(`${caseName} fail,case success,error:${toString(error)}`); + expect(true).assertTrue(); + done(); + return; + } + expect().assertFail(); + console.log(`${caseName} success,case fail`); + done(); + }); + }catch(err){ + console.log(`${caseName} fail,case success,error:${toString(err)}`); + expect(true).assertTrue(); + done(); + return; + } + console.log(`==========> ${caseName} Test end ==========>`); + done(); + }); + + /** + * @tc.number Telephony_Call_Call_MakeCall_0200 + * @tc.name Makes a call. + * @tc.desc Function test + */ + it("Telephony_Call_Call_MakeCall_0200",0,async function(done){ + let caseName:string = "Telephony_Call_Call_MakeCall_0200"; + console.log(`==========> ${caseName} Test start ==========>`); + let telNumber = ""; + try{ + call.makeCall(telNumber).then(()=>{ + console.log(`${caseName} success,case fail`); + done(); + }).catch(error =>{ + console.log(`${caseName} fail,case success,error:${toString(error)}`); + expect(true).assertTrue(); + done(); + return; + }); + }catch(err){ + console.log(`${caseName} fail,case success,error:${toString(err)}`); + expect(true).assertTrue(); + done(); + return; + } + console.log(`==========> ${caseName} Test end ==========>`); + done(); + }); + + /** + * @tc.number Telephony_Call_HasVoiceCapability_HasVoiceCapability + * @tc.name Checks whether a device supports voice calls. + * @tc.desc Return type test + */ + it("Telephony_Call_HasVoiceCapability_HasVoiceCapability",0,async function(done){ + let caseName = 'Telephony_Call_HasVoiceCapability_HasVoiceCapability'; + console.log(`==========> ${caseName} Test start ==========>`); + let ret = false; + let voiceCapablity = call.hasVoiceCapability(); + if(voiceCapablity === true || voiceCapablity === false){ + ret = true; + } + expect(ret).assertTrue(); + console.log(`==========> ${caseName} Test end ==========>`); + done(); + }); + + /** + * @tc.number Telephony_Call_Call_Reject_0100 + * @tc.name call_reject + * @tc.desc Function test + */ + it("Telephony_Call_Call_Reject_0100",0,async function(done){ + let caseName = 'Telephony_Call_Call_Reject_0100'; + console.log(`==========> ${caseName} Test start ==========>`); + call.reject(BOUNDARY_NUMBER_INT, (error) => { + if (error) { + console.log(`${caseName} error,case success,error:${toString(error)}`); + done(); + return; + } + expect().assertFail(); + console.log(`${caseName} success,case failed`); + done(); + }); + console.log(`==========> ${caseName} Test end ==========>`); + done(); + }); + + /** + * @tc.number Telephony_Call_Call_Reject_0200 + * @tc.name call_reject + * @tc.desc Function test + */ + it("Telephony_Call_Call_Reject_0200",0,async function(done){ + let caseName = 'Telephony_Call_Call_Reject_0200'; + console.log(`==========> ${caseName} Test start ==========>`); + let options = {messageContent:"hello"} + call.reject(BOUNDARY_NUMBER_INT,options, (error) => { + if (error) { + console.log(`${caseName} error,case success,error:${toString(error)}`); + done(); + return; + } + expect().assertFail(); + console.log(`${caseName} success,case failed`); + done(); + }); + console.log(`==========> ${caseName} Test end ==========>`); + done(); + }); + + /** + * @tc.number Telephony_Call_Call_Reject_0300 + * @tc.name call_reject + * @tc.desc Function test + */ + it("Telephony_Call_Call_Reject_0300",0,async function(done){ + let caseName = 'Telephony_Call_Call_Reject_0300'; + console.log(`==========> ${caseName} Test start ==========>`); + call.reject(CALL_ID_NOT_EXIST).then(() => { + expect().assertFail(); + console.log(`${caseName} success,case failed`); + done(); + }).catch(error => { + console.log(`${caseName} error,case success,error:${toString(error)}`); + done(); + return; + }); + console.log(`==========> ${caseName} Test end ==========>`); + done(); + }); + + /** + * @tc.number Telephony_Call_On_CallDetailsChange_0100 + * @tc.name Method in call_on of type callDetailsChange + * @tc.desc Function test + */ + it("Telephony_Call_On_CallDetailsChange_0100",0,async function(done){ + let caseName:string = "Telephony_Call_On_CallDetailsChange_0100"; + console.log(`==========> ${caseName} Test start ==========>`); + try{ + call.on("callDetailsChange",(err,data) => { + if(err){ + console.log(`${caseName} error,error :${toString(err)}`); + done(); + return; + } + expect(true).assertTrue(); + done(); + }); + done(); + }catch(err){ + expect().assertFail(); + console.log(`${caseName} fail, err:${err}`); + done(); + } + console.log(`==========> ${caseName} Test end ==========>`); + done(); + }); + + /** + * @tc.number Telephony_Call_Off_callDetailsChange_0100 + * @tc.name Method in call_off of type callDetailsChange + * @tc.desc Function test + */ + it("Telephony_Call_Off_CallDetailsChange_0100",0,async function(done){ + let caseName:string = "Telephony_Call_Off_CallDetailsChange_0100"; + console.log(`==========> ${caseName} Test start ==========>`); + try{ + call.off("callDetailsChange",(err,data) => { + if(err){ + console.log(`${caseName} error,error :${toString(err)}`); + done(); + return; + } + expect(true).assertTrue(); + done(); + }); + done(); + }catch(err){ + expect().assertFail(); + console.log(`${caseName} fail, err:${err}`); + done(); + } + console.log(`==========> ${caseName} Test end ==========>`); + done(); + }); + + /** + * @tc.number Telephony_Call_On_CallEventChange_0200 + * @tc.name Method in call_on of type callEventChange + * @tc.desc Function test + */ + it("Telephony_Call_On_CallEventChange_0200",0,async function(done){ + let caseName:string = "Telephony_Call_On_CallEventChange_0200"; + console.log(`==========> ${caseName} Test start ==========>`); + try{ + call.on("callEventChange",(err,data) => { + if(err){ + console.log(`${caseName} error,error :${toString(err)}`); + done(); + return; + } + expect(true).assertTrue(); + done(); + }); + done(); + }catch(err){ + expect().assertFail(); + console.log(`${caseName} fail, err:${err}`); + done(); + } + console.log(`==========> ${caseName} Test end ==========>`); + done(); + }); + + /** + * @tc.number Telephony_Call_Off_CallEventChange_0200 + * @tc.name Method in call_off of type callEventChange + * @tc.desc Function test + */ + it("Telephony_Call_Off_CallEventChange_0200",0,async function(done){ + let caseName:string = "Telephony_Call_Off_CallEventChange_0200"; + console.log(`==========> ${caseName} Test start ==========>`); + try{ + call.off("callEventChange",(err,data) => { + if(err){ + console.log(`${caseName} error,error :${toString(err)}`); + done(); + return; + } + expect(true).assertTrue(); + done(); + }); + done(); + }catch(err){ + expect().assertFail(); + console.log(`${caseName} fail, err:${err}`); + done(); + } + console.log(`==========> ${caseName} Test end ==========>`); + done(); + }); + + /** + * @tc.number Telephony_Call_Off_CallEventChange_0200 + * @tc.name Method in call_off of type callDisconnectedCause + * @tc.desc Function test + */ + it("Telephony_Call_On_CallDisconnectedCause_0300",0,async function(done){ + let caseName:string = "Telephony_Call_On_CallDisconnectedCause_0300"; + console.log(`==========> ${caseName} Test start ==========>`); + try{ + call.on("callDisconnectedCause",(err,data) => { + if(err){ + console.log(`${caseName} error,error :${toString(err)}`); + done(); + return; + } + expect(true).assertTrue(); + done(); + }); + done(); + }catch(err){ + expect().assertFail(); + console.log(`${caseName} fail, err:${err}`); + done(); + } + console.log(`==========> ${caseName} Test end ==========>`); + done(); + }); + + /** + * @tc.number Telephony_Call_Off_CallEventChange_0200 + * @tc.name Method in call_off of type callDisconnectedCause + * @tc.desc Function test + */ + it("Telephony_Call_Off_CallDisconnectedCause_0300",0,async function(done){ + let caseName:string = "Telephony_Call_Off_CallDisconnectedCause_0300"; + console.log(`==========> ${caseName} Test start ==========>`); + try{ + call.off("callDisconnectedCause",(err,data) => { + if(err){ + console.log(`${caseName} error,error :${toString(err)}`); + done(); + return; + } + expect(true).assertTrue(); + done(); + }); + done(); + }catch(err){ + expect().assertFail(); + console.log(`${caseName} fail, err:${err}`); + done(); + } + console.log(`==========> ${caseName} Test end ==========>`); + done(); + }); + + /** + * @tc.number Telephony_Call_AudioDevice_DEVICE_MIC + * @tc.name Enum AudioDevice + * @tc.desc Enum value test + */ + it("Telephony_Call_AudioDevice_DEVICE_MIC",0,async function(done){ + let caseName = 'Telephony_Call_AudioDevice_DEVICE_MIC'; + console.log(`==========> ${caseName} Test start ==========>`); + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + expect(0).assertEqual(call.AudioDevice.DEVICE_MIC); + console.log(`==========> ${caseName} Test end ==========>`); + done(); + }); + + /** + * @tc.number Telephony_Call_Dial_Dial_0200 + * @tc.name Makes a call. + * @tc.desc Function test + */ + it("Telephony_Call_DialOptions_Extras",0,async function(done){ + let caseName:string = "Telephony_Call_DialOptions_extras"; + console.log(`==========> ${caseName} Test start ==========>`); + let options = {extras:false, accountId:DEFAULT_SLOT_ID, videoState:MEDIA_TYPE_VOICE, + dialScene:DIAL_SCENCE_CALL_PRIVILEGED, dialType:DIAL_CARRIER_TYPE}; + call.dial(PHONE_NUMBER,options,(err,data) => { + if(err){ + console.log(`${caseName} error,case success,error:${toString(err)}`); + done(); + return; + } + expect().assertFail(); + console.log(`${caseName} success,case fail`); + done(); + }); + console.log(`==========> ${caseName} Test end ==========>`); + done(); + }); + + /** + * @tc.number Telephony_Call_CallTransferType_TRANSFER_TYPE_BUSY + * @tc.name Enum CallTransferType + * @tc.desc Enum value test + */ + it("Telephony_Call_CallTransferType_TRANSFER_TYPE_BUSY",0,async function(done){ + let caseName = 'Telephony_Call_CallTransferType_TRANSFER_TYPE_BUSY'; + console.log(`==========> ${caseName} Test start ==========>`); + expect(1).assertEqual(call.CallTransferType.TRANSFER_TYPE_BUSY); + console.log(`==========> ${caseName} Test end ==========>`); + done(); + }); + + /** + * @tc.number Telephony_Call_CallTransferSettingType_CALL_TRANSFER_REGISTRATION + * @tc.name Enum CallTransferSettingType + * @tc.desc Enum value test + */ + it("Telephony_Call_CallTransferSettingType_CALL_TRANSFER_REGISTRATION",0,async function(done){ + let caseName = 'Telephony_Call_CallTransferSettingType_CALL_TRANSFER_REGISTRATION'; + console.log(`==========> ${caseName} Test start ==========>`); + expect(3).assertEqual(call.CallTransferSettingType.CALL_TRANSFER_REGISTRATION); + console.log(`==========> ${caseName} Test end ==========>`); + done(); + }); + + /** + * @tc.number Telephony_Call_CallTransferSettingType_CALL_TRANSFER_ERASURE + * @tc.name Enum CallTransferSettingType + * @tc.desc Enum value test + */ + it("Telephony_Call_CallTransferSettingType_CALL_TRANSFER_ERASURE",0, function(done){ + let caseName = 'Telephony_Call_CallTransferSettingType_CALL_TRANSFER_ERASURE'; + console.log(`==========> ${caseName} Test start ==========>`); + expect(4).assertEqual(call.CallTransferSettingType.CALL_TRANSFER_ERASURE); + console.log(`==========> ${caseName} Test end ==========>`); + done(); + }); + + /** + * @tc.number Telephony_Call_CallAbilityEventId_EVENT_DIAL_NO_CARRIER + * @tc.name Enum CallAbilityEventId + * @tc.desc Enum value test + */ + it("Telephony_Call_CallAbilityEventId_EVENT_DIAL_NO_CARRIER",0, function(done){ + let caseName = 'Telephony_Call_CallAbilityEventId_EVENT_DIAL_NO_CARRIER'; + console.log(`==========> ${caseName} Test start ==========>`); + expect(1).assertEqual(call.CallAbilityEventId.EVENT_DIAL_NO_CARRIER); + console.log(`==========> ${caseName} Test end ==========>`); + done(); + }); + + /** + * @tc.number Telephony_Call_CallAbilityEventId_EVENT_INVALID_FDN_NUMBER + * @tc.name Enum CallAbilityEventId + * @tc.desc Enum value test + */ + it("Telephony_Call_CallAbilityEventId_EVENT_INVALID_FDN_NUMBER",0, function(done){ + let caseName = 'Telephony_Call_CallAbilityEventId_EVENT_INVALID_FDN_NUMBER'; + console.log(`==========> ${caseName} Test start ==========>`); + expect(2).assertEqual(call.CallAbilityEventId.EVENT_INVALID_FDN_NUMBER); + console.log(`==========> ${caseName} Test end ==========>`); + done(); + }); + + /** + * @tc.number Telephony_Call_CallTransferInfo_Type + * @tc.name Interface CallTransferInfo + * @tc.desc Interface value test + */ + it('Telephony_Call_CallTransferInfo_Type', 0, function (done) { + let caseName = 'Telephony_Call_CallTransferInfo_Type'; + console.log(`==========> ${caseName} Test start ==========>`); + let callTransferInfo = {transferNum:'10000000001', type: 2, settingType: 1} + expect(callTransferInfo.type === 2).assertTrue(); + console.log(`==========> ${caseName} Test end ==========>`); + done(); + }); + + /** + * @tc.number Telephony_Call_CallTransferResult_Status + * @tc.name Interface CallTransferResult + * @tc.desc Interface value test + */ + it('Telephony_Call_CallTransferResult_Status', 0, function (done) { + let caseName = 'Telephony_Call_CallTransferResult_Status'; + console.log(`==========> ${caseName} Test start ==========>`); + let callTransferResult = {status:0, number: '10000000001'} + expect(callTransferResult.status === 0).assertTrue(); + console.log(`==========> ${caseName} Test end ==========>`); + done(); + }); + + /** + * @tc.number Telephony_Call_CallTransferResult_Number + * @tc.name Interface CallTransferResult + * @tc.desc Interface value test + */ + it('Telephony_Call_CallTransferResult_Number', 0, function (done) { + let caseName = 'Telephony_Call_CallTransferResult_Number'; + console.log(`==========> ${caseName} Test start ==========>`); + let callTransferResult = {status:0, number: '10000000001'} + expect(callTransferResult.number === '10000000001').assertTrue(); + console.log(`==========> ${caseName} Test end ==========>`); + done(); + }); + + /** + * @tc.number Telephony_Call_CallAttributeOptions_CallId + * @tc.name Interface CallAttributeOptions + * @tc.desc Interface value test + */ + it('Telephony_Call_CallAttributeOptions_CallId', 0, function (done) { + let caseName = 'Telephony_Call_CallAttributeOptions_CallId'; + console.log(`==========> ${caseName} Test start ==========>`); + let callAttributeOptions = {call:1}; + expect(callAttributeOptions.call === 1).assertTrue(); + console.log(`==========> ${caseName} Test end ==========>`); + done(); + }); + + /** + * @tc.number Telephony_Call_CallRestrictionInfo_Type + * @tc.name Interface CallRestrictionInfo + * @tc.desc Interface value test + */ + it('Telephony_Call_CallRestrictionInfo_Type', 0, function (done) { + let caseName = 'Telephony_Call_CallRestrictionInfo_Type'; + console.log(`==========> ${caseName} Test start ==========>`); + let callRestrictionInfo = {type:0, password: '123456', mode:1} + expect(callRestrictionInfo.type === 0).assertTrue(); + console.log(`==========> ${caseName} Test end ==========>`); + done(); + }); + + /** + * @tc.number Telephony_Call_CallRestrictionInfo_Mode + * @tc.name Interface CallRestrictionInfo + * @tc.desc Interface value test + */ + it('Telephony_Call_CallRestrictionInfo_Mode', 0, function (done) { + let caseName = 'Telephony_Call_CallRestrictionInfo_Mode'; + console.log(`==========> ${caseName} Test start ==========>`); + let callRestrictionInfo = {type:0, password: '123456', mode:1} + expect(callRestrictionInfo.mode === 1).assertTrue(); + console.log(`==========> ${caseName} Test end ==========>`); + done(); + }); + + /** + * @tc.number Telephony_Call_CallEventOptions_EventId + * @tc.name Interface CallEventOptions + * @tc.desc Interface value test + */ + it('Telephony_Call_CallEventOptions_EventId', 0, function (done) { + let caseName = 'Telephony_Call_CallEventOptions_EventId'; + console.log(`==========> ${caseName} Test start ==========>`); + let callEventOptions = {eventId:1} + expect(callEventOptions.eventId === 1).assertTrue(); + console.log(`==========> ${caseName} Test end ==========>`); + done(); + }); + + /** + * @tc.number Telephony_Call_DisconnectedDetails_NO_ROUTE_TO_DESTINATION + * @tc.name Enum DisconnectedDetails + * @tc.desc Enum value test + */ + it("Telephony_Call_DisconnectedDetails_UNASSIGNED_NUMBER",0,async function(done){ + let caseName = 'Telephony_Call_DisconnectedDetails_UNASSIGNED_NUMBER'; + console.log(`==========> ${caseName} Test start ==========>`); + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + expect(1).assertEqual(call.DisconnectedDetails.UNASSIGNED_NUMBER); + expect(3).assertEqual(call.DisconnectedDetails.NO_ROUTE_TO_DESTINATION); + console.log(`==========> ${caseName} Test end ==========>`); + done(); + }); + + + /** + * @tc.number Telephony_Call_DisconnectedDetails_CHANNEL_UNACCEPTABLE + * @tc.name Enum DisconnectedDetails + * @tc.desc Enum value test + */ + it("Telephony_Call_DisconnectedDetails_CHANNEL_UNACCEPTABLE",0,async function(done){ + let caseName = 'Telephony_Call_DisconnectedDetails_CHANNEL_UNACCEPTABLE'; + console.log(`==========> ${caseName} Test start ==========>`); + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + expect(6).assertEqual(call.DisconnectedDetails.CHANNEL_UNACCEPTABLE); + expect(8).assertEqual(call.DisconnectedDetails.OPERATOR_DETERMINED_BARRING); + console.log(`==========> ${caseName} Test end ==========>`); + done(); + }); + + /** + * @tc.number Telephony_Call_DisconnectedDetails_NORMAL_CALL_CLEARING + * @tc.name Enum DisconnectedDetails + * @tc.desc Enum value test + */ + it("Telephony_Call_DisconnectedDetails_NORMAL_CALL_CLEARING",0,async function(done){ + let caseName = 'Telephony_Call_DisconnectedDetails_NORMAL_CALL_CLEARING'; + console.log(`==========> ${caseName} Test start ==========>`); + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + expect(16).assertEqual(call.DisconnectedDetails.NORMAL_CALL_CLEARING); + expect(17).assertEqual(call.DisconnectedDetails.USER_BUSY); + console.log(`==========> ${caseName} Test end ==========>`); + done(); + }); + + /** + * @tc.number Telephony_Call_DisconnectedDetails_NO_USER_RESPONDING + * @tc.name Enum DisconnectedDetails + * @tc.desc Enum value test + */ + it("Telephony_Call_DisconnectedDetails_NO_USER_RESPONDING",0,async function(done){ + let caseName = 'Telephony_Call_DisconnectedDetails_NO_USER_RESPONDING'; + console.log(`==========> ${caseName} Test start ==========>`); + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + expect(18).assertEqual(call.DisconnectedDetails.NO_USER_RESPONDING); + expect(19).assertEqual(call.DisconnectedDetails.USER_ALERTING_NO_ANSWER); + console.log(`==========> ${caseName} Test end ==========>`); + done(); + }); + + /** + * @tc.number Telephony_Call_DisconnectedDetails_CALL_REJECTED + * @tc.name Enum DisconnectedDetails + * @tc.desc Enum value test + */ + it("Telephony_Call_DisconnectedDetails_CALL_REJECTED",0,async function(done){ + let caseName = 'Telephony_Call_DisconnectedDetails_CALL_REJECTED'; + console.log(`==========> ${caseName} Test start ==========>`); + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + expect(21).assertEqual(call.DisconnectedDetails.CALL_REJECTED); + expect(22).assertEqual(call.DisconnectedDetails.NUMBER_CHANGED); + console.log(`==========> ${caseName} Test end ==========>`); + done(); + }); + + /** + * @tc.number Telephony_Call_DisconnectedDetails_DESTINATION_OUT_OF_ORDER + * @tc.name Enum DisconnectedDetails + * @tc.desc Enum value test + */ + it("Telephony_Call_DisconnectedDetails_DESTINATION_OUT_OF_ORDER",0,async function(done){ + let caseName = 'Telephony_Call_DisconnectedDetails_DESTINATION_OUT_OF_ORDER'; + console.log(`==========> ${caseName} Test start ==========>`); + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + expect(27).assertEqual(call.DisconnectedDetails.DESTINATION_OUT_OF_ORDER); + expect(28).assertEqual(call.DisconnectedDetails.INVALID_NUMBER_FORMAT); + console.log(`==========> ${caseName} Test end ==========>`); + done(); + }); + + /** + * @tc.number Telephony_Call_DisconnectedDetails_DESTINATION_NETWORK_OUT_OF_ORDER + * @tc.name Enum DisconnectedDetails + * @tc.desc Enum value test + */ + it("Telephony_Call_DisconnectedDetails_DESTINATION_NETWORK_OUT_OF_ORDER",0,async function(done){ + let caseName = 'Telephony_Call_DisconnectedDetails_NETWORK_OUT_OF_ORDER'; + console.log(`==========> ${caseName} Test start ==========>`); + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + expect(38).assertEqual(call.DisconnectedDetails.NETWORK_OUT_OF_ORDER); + expect(41).assertEqual(call.DisconnectedDetails.TEMPORARY_FAILURE); + console.log(`==========> ${caseName} Test end ==========>`); + done(); + }); + + /** + * @tc.number Telephony_Call_DisconnectedDetails_INVALID_PARAMETER + * @tc.name Enum DisconnectedDetails + * @tc.desc Enum value test + */ + it("Telephony_Call_DisconnectedDetails_INVALID_PARAMETER",0,async function(done){ + let caseName = 'Telephony_Call_DisconnectedDetails_INVALID_PARAMETER'; + console.log(`==========> ${caseName} Test start ==========>`); + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + expect(1025).assertEqual(call.DisconnectedDetails.INVALID_PARAMETER); + expect(1026).assertEqual(call.DisconnectedDetails.SIM_NOT_EXIT); + console.log(`==========> ${caseName} Test end ==========>`); + done(); + }); + + /** + * @tc.number Telephony_Call_DisconnectedDetails_SIM_PIN_NEED + * @tc.name Enum DisconnectedDetails + * @tc.desc Enum value test + */ + it("Telephony_Call_DisconnectedDetails_SIM_PIN_NEED",0,async function(done){ + let caseName = 'Telephony_Call_DisconnectedDetails_SIM_PIN_NEED'; + console.log(`==========> ${caseName} Test start ==========>`); + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + expect(1027).assertEqual(call.DisconnectedDetails.SIM_PIN_NEED); + expect(1029).assertEqual(call.DisconnectedDetails.CALL_NOT_ALLOW); + console.log(`==========> ${caseName} Test end ==========>`); + done(); + }); + + /** + * @tc.number Telephony_Call_DisconnectedDetails_SIM_INVALID + * @tc.name Enum DisconnectedDetails + * @tc.desc Enum value test + */ + it("Telephony_Call_DisconnectedDetails_SIM_INVALID",0,async function(done){ + let caseName = 'Telephony_Call_DisconnectedDetails_SIM_INVALID'; + console.log(`==========> ${caseName} Test start ==========>`); + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + expect(1045).assertEqual(call.DisconnectedDetails.SIM_INVALID); + expect(1045).assertEqual(call.DisconnectedDetails.SIM_INVALID); + console.log(`==========> ${caseName} Test end ==========>`); + done(); + }); + + }); + +} \ No newline at end of file diff --git a/telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/test/ConvertOptionsJsunit.test.ets b/telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/test/ConvertOptionsJsunit.test.ets new file mode 100644 index 000000000..8e1cd292b --- /dev/null +++ b/telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/test/ConvertOptionsJsunit.test.ets @@ -0,0 +1,1262 @@ +// @ts-nocheck +/** + * 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 {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index' +import ConvertXML from '@ohos.convertxml' +export default function convertOptionsJsunit() { + describe('XmlTest',function () { + console.log("************* settings Test start*************"); + it('Telephony_convertxml_ConvertXML_0100', 0, async function (done) { + var xml = + '' + + '' + + ' Happy ' + + ' Work' + + ' Play' + + ''; + var convertml = new ConvertXML(); + var result1 = convertml.convert(xml, {compact: false,trim :true}) + var str1 = '{"_declaration":{"_attributes":{"version":"1.0",'+ + '"encoding":"utf-8"}},'+ + '"_elements":[{"_type":"element",'+ + '"_name":"note",'+ + '"_attributes":{"importance":"high",'+ + '"logged":"true"},'+ + '"_elements":[{"_type":"element",'+ + '"_name":"title",'+ + '"_elements":[{"_type":"text",'+ + '"_text":"Happy"}]},'+ + '{"_type":"element",'+ + '"_name":"todo",'+ + '"_elements":[{"_type":"text",'+ + '"_text":"Work"}]},'+ + '{"_type":"element",'+ + '"_name":"todo",'+ + '"_elements":[{"_type":"text",'+ + '"_text":"Play"}]}]}]}' + expect(result1).assertEqual(str1); + done(); + }) + + it('Telephony_convertxml_ConvertXML_0200', 0, async function (done) { + var xml = + '' + + '' + + ' Happy' + + ' Work' + + ' Play' + + ''; + var convertml = new ConvertXML(); + var result1 = convertml.convert(xml, {compact: false, ignoreDeclaration: true}); + var str1 = '{"_elements":[{"_type":"element",'+ + '"_name":"note",'+ + '"_attributes":{"importance":"high",'+ + '"logged":"true"},'+ + '"_elements":[{"_type":"element",'+ + '"_name":"title",'+ + '"_elements":[{"_type":"text",'+ + '"_text":"Happy"}]},'+ + '{"_type":"element",'+ + '"_name":"todo",'+ + '"_elements":[{"_type":"text",'+ + '"_text":"Work"}]},'+ + '{"_type":"element",'+ + '"_name":"todo",'+ + '"_elements":[{"_type":"text",'+ + '"_text":"Play"}]}]}]}' + expect(result1).assertEqual(str1); + done(); + }) + + it('Telephony_convertxml_ConvertXML_0300', 0,async function (done) { + var xml = + '' + + '' + + ' Happy' + + ' Work' + + ' Play' + + ''; + var convertml = new ConvertXML(); + var result1 = convertml.convert(xml, {compact: false, ignoreDeclaration: true}); + var str1 = '{"_elements":[{"_type":"element",'+ + '"_name":"note",'+ + '"_attributes":{"importance":"high",'+ + '"logged":"true"},'+ + '"_elements":[{"_type":"element",'+ + '"_name":"title",'+ + '"_elements":[{"_type":"text",'+ + '"_text":"Happy"}]},'+ + '{"_type":"element",'+ + '"_name":"todo",'+ + '"_elements":[{"_type":"text",'+ + '"_text":"Work"}]},'+ + '{"_type":"element",'+ + '"_name":"todo",'+ + '"_elements":[{"_type":"text",'+ + '"_text":"Play"}]}]}]}' + expect(result1).assertEqual(str1); + done(); + }) + + it('Telephony_convertxml_ConvertXML_0400', 0, async function (done) { + var xml = + '' + + '' + + ' Happy' + + ' Work' + + ' Play' + + ''; + var convertml = new ConvertXML(); + var result1 = convertml.convert(xml, {compact: false, ignoreAttributes: true}); + var str1 = '{"_declaration":{"_attributes":{"version":"1.0",'+ + '"encoding":"utf-8"}},'+ + '"_elements":[{"_type":"element",'+ + '"_name":"note",'+ + '"_elements":[{"_type":"element",'+ + '"_name":"title",'+ + '"_elements":[{"_type":"text",'+ + '"_text":"Happy"}]},'+ + '{"_type":"element",'+ + '"_name":"todo",'+ + '"_elements":[{"_type":"text",'+ + '"_text":"Work"}]},'+ + '{"_type":"element",'+ + '"_name":"todo",'+ + '"_elements":[{"_type":"text",'+ + '"_text":"Play"}]}]}]}' + expect(result1).assertEqual(str1); + done(); + }) + + it('Telephony_convertxml_ConvertXML_0500', 0,async function (done) { + var xml = + '' + + '' + + ' '+ + ' Happy' + + ' Work' + + ' Play' + + ''; + var convertml = new ConvertXML(); + var result1 = convertml.convert(xml, {compact: false, ignoreComment: true}) + var str1 = '{"_declaration":{"_attributes":{"version":"1.0",'+ + '"encoding":"utf-8"}},'+ + '"_elements":[{"_type":"element",'+ + '"_name":"note",'+ + '"_attributes":{"importance":"high",'+ + '"logged":"true"},'+ + '"_elements":[{"_type":"element",'+ + '"_name":"title",'+ + '"_elements":[{"_type":"text",'+ + '"_text":"Happy"}]},'+ + '{"_type":"element",'+ + '"_name":"todo",'+ + '"_elements":[{"_type":"text",'+ + '"_text":"Work"}]},'+ + '{"_type":"element",'+ + '"_name":"todo",'+ + '"_elements":[{"_type":"text",'+ + '"_text":"Play"}]}]}]}' + expect(result1).assertEqual(str1); + done(); + }) + + it('Telephony_convertxml_ConvertXML_0600', 0, async function (done) { + var xml = + '' + + '' + + ' ]]>'+ + ' Happy' + + ' Work' + + ' Play' + + ''; + var convertml = new ConvertXML(); + var result1 = convertml.convert(xml, {compact: false, ignoreCDATA: true}) + var str1 = '{"_declaration":{"_attributes":{"version":"1.0",'+ + '"encoding":"utf-8"}},'+ + '"_elements":[{"_type":"element",'+ + '"_name":"note",'+ + '"_attributes":{"importance":"high",'+ + '"logged":"true"},'+ + '"_elements":[{"_type":"element",'+ + '"_name":"title",'+ + '"_elements":[{"_type":"text",'+ + '"_text":"Happy"}]},'+ + '{"_type":"element",'+ + '"_name":"todo",'+ + '"_elements":[{"_type":"text",'+ + '"_text":"Work"}]},'+ + '{"_type":"element",'+ + '"_name":"todo",'+ + '"_elements":[{"_type":"text",'+ + '"_text":"Play"}]}]}]}' + expect(result1).assertEqual(str1); + done(); + }) + + it('Telephony_convertxml_ConvertXML_0700', 0, async function (done) { + var xml = + '' + + ''+ + '' + + ' Happy' + + ' Work' + + ' Play' + + ''; + var convertml = new ConvertXML(); + var result1 = convertml.convert(xml, {compact: false, ignoreDoctype: true}) + var str1 = '{"_declaration":{"_attributes":{"version":"1.0",'+ + '"encoding":"utf-8"}},'+ + '"_elements":[{"_type":"element",'+ + '"_name":"note",'+ + '"_attributes":{"importance":"high",'+ + '"logged":"true"},'+ + '"_elements":[{"_type":"element",'+ + '"_name":"title",'+ + '"_elements":[{"_type":"text",'+ + '"_text":"Happy"}]},'+ + '{"_type":"element",'+ + '"_name":"todo",'+ + '"_elements":[{"_type":"text",'+ + '"_text":"Work"}]},'+ + '{"_type":"element",'+ + '"_name":"todo",'+ + '"_elements":[{"_type":"text",'+ + '"_text":"Play"}]}]}]}' + expect(result1).assertEqual(str1); + done(); + }) + + it('Telephony_convertxml_ConvertXML_0800', 0, async function (done) { + var xml = + '' + + '' + + ' Happy' + + ' Work' + + ' Play' + + ''; + var convertml = new ConvertXML(); + var result1 = convertml.convert(xml, {compact: false, ignoreText: true}) + var str1 = '{"_declaration":{"_attributes":{"version":"1.0",'+ + '"encoding":"utf-8"}},'+ + '"_elements":[{"_type":"element",'+ + '"_name":"note",'+ + '"_attributes":{"importance":"high",'+ + '"logged":"true"},'+ + '"_elements":[{"_type":"element",'+ + '"_name":"title"},'+ + '{"_type":"element",'+ + '"_name":"todo"},'+ + '{"_type":"element",'+ + '"_name":"todo"}]}]}' + expect(result1).assertEqual(str1); + done(); + }) + + it('Telephony_convertxml_ConvertXML_0900', 0, async function (done) { + var xml = + '' + + '' + + ' Happy' + + ' Work' + + ' Play' + + ''; + var convertml = new ConvertXML(); + var result1 = convertml.convert(xml, {compact: false, declarationKey: "123"}) + var str1 = '{"123":{"_attributes":{"version":"1.0",'+ + '"encoding":"utf-8"}},'+ + '"_elements":[{"_type":"element",'+ + '"_name":"note",'+ + '"_attributes":{"importance":"high",'+ + '"logged":"true"},'+ + '"_elements":[{"_type":"element",'+ + '"_name":"title",'+ + '"_elements":[{"_type":"text",'+ + '"_text":"Happy"}]},'+ + '{"_type":"element",'+ + '"_name":"todo",'+ + '"_elements":[{"_type":"text",'+ + '"_text":"Work"}]},'+ + '{"_type":"element",'+ + '"_name":"todo",'+ + '"_elements":[{"_type":"text",'+ + '"_text":"Play"}]}]}]}' + expect(result1).assertEqual(str1); + done(); + }) + + it('Telephony_convertxml_ConvertXML_1000', 0, async function (done) { + var xml = + '' + + '' + + ' '+ + ' Happy' + + ' Work' + + ' Play' + + ''; + var convertml = new ConvertXML(); + var result1 = convertml.convert(xml, {compact: false, instructionKey: "123"}) + var str1 = '{"_declaration":{"_attributes":{"version":"1.0",'+ + '"encoding":"utf-8"}},'+ + '"_elements":[{"_type":"element",'+ + '"_name":"note",'+ + '"_attributes":{"importance":"high",'+ + '"logged":"true"},'+ + '"_elements":[{"123":"there",'+ + '"_type":"instruction",'+ + '"_name":"go"},'+ + '{"_type":"element",'+ + '"_name":"title",'+ + '"_elements":[{"_type":"text",'+ + '"_text":"Happy"}]},'+ + '{"_type":"element",'+ + '"_name":"todo",'+ + '"_elements":[{"_type":"text",'+ + '"_text":"Work"}]},'+ + '{"_type":"element",'+ + '"_name":"todo",'+ + '"_elements":[{"_type":"text",'+ + '"_text":"Play"}]}]}]}' + expect(result1).assertEqual(str1); + done(); + }) + + it('Telephony_convertxml_ConvertXML_1100', 0, async function (done) { + var xml = + '' + + '' + + ' '+ + ' Happy' + + ' Work' + + ' Play' + + ''; + var convertml = new ConvertXML(); + var result1 = convertml.convert(xml, {compact: false, attributesKey: "123"}) + var str1 = '{"_declaration":{"123":{"version":"1.0",'+ + '"encoding":"utf-8"}},'+ + '"_elements":[{"123":{"importance":"high",'+ + '"logged":"true"},'+ + '"_type":"element",'+ + '"_name":"note",'+ + '"_elements":[{"_type":"instruction",'+ + '"_name":"go",'+ + '"_instruction":"there"},'+ + '{"_type":"element",'+ + '"_name":"title",'+ + '"_elements":[{"_type":"text",'+ + '"_text":"Happy"}]},'+ + '{"_type":"element",'+ + '"_name":"todo",'+ + '"_elements":[{"_type":"text",'+ + '"_text":"Work"}]},'+ + '{"_type":"element",'+ + '"_name":"todo",'+ + '"_elements":[{"_type":"text",'+ + '"_text":"Play"}]}]}]}' + expect(result1).assertEqual(str1); + done(); + }) + + it('Telephony_convertxml_ConvertXML_1200', 0, async function (done) { + var xml = + '' + + '' + + ' Happy' + + ' Work' + + ' Play' + + ''; + var convertml = new ConvertXML(); + var result1 = convertml.convert(xml, {compact: false, textKey: "123"}) + var str1 = '{"_declaration":{"_attributes":{"version":"1.0",'+ + '"encoding":"utf-8"}},'+ + '"_elements":[{"_type":"element",'+ + '"_name":"note",'+ + '"_attributes":{"importance":"high",'+ + '"logged":"true"},'+ + '"_elements":[{"_type":"element",'+ + '"_name":"title",'+ + '"_elements":[{"123":"Happy",'+ + '"_type":"text"}]},'+ + '{"_type":"element",'+ + '"_name":"todo",'+ + '"_elements":[{"123":"Work",'+ + '"_type":"text"}]},'+ + '{"_type":"element",'+ + '"_name":"todo",'+ + '"_elements":[{"123":"Play",'+ + '"_type":"text"}]}]}]}' + expect(result1).assertEqual(str1); + done(); + }) + + it('Telephony_convertxml_ConvertXML_1300', 0, async function (done) { + var xml = + '' + + '' + + ' '+ + ' Happy' + + ' Work' + + ' Play' + + ''; + var convertml = new ConvertXML(); + var result1 = convertml.convert(xml, {compact: false, cdataKey: "123"}) + var str1 = '{"_declaration":{"_attributes":{"version":"1.0",'+ + '"encoding":"utf-8"}},'+ + '"_elements":[{"_type":"element",'+ + '"_name":"note",'+ + '"_attributes":{"importance":"high",'+ + '"logged":"true"},'+ + '"_elements":[{"123":"1 is < 2",'+ + '"_type":"cdata"},'+ + '{"_type":"element",'+ + '"_name":"title",'+ + '"_elements":[{"_type":"text",'+ + '"_text":"Happy"}]},'+ + '{"_type":"element",'+ + '"_name":"todo",'+ + '"_elements":[{"_type":"text",'+ + '"_text":"Work"}]},'+ + '{"_type":"element",'+ + '"_name":"todo",'+ + '"_elements":[{"_type":"text",'+ + '"_text":"Play"}]}]}]}' + expect(result1).assertEqual(str1); + done(); + }) + + it('Telephony_convertxml_ConvertXML_1400', 0, async function (done) { + var xml = + '' + + ''+ + '' + + ' Happy' + + ' Work' + + ' Play' + + ''; + var convertml = new ConvertXML(); + var result1 = convertml.convert(xml, {compact: false, doctypeKey: 'doctype'}) + var str1 = '{"_declaration":{"_attributes":{"version":"1.0",'+ + '"encoding":"utf-8"}},'+ + '"_elements":[{"_type":"doctype","doctype":"foo"},'+ + '{"_type":"element",'+ + '"_name":"note",'+ + '"_attributes":{"importance":"high",'+ + '"logged":"true"},'+ + '"_elements":[{"_type":"element",'+ + '"_name":"title",'+ + '"_elements":[{"_type":"text",'+ + '"_text":"Happy"}]},'+ + '{"_type":"element",'+ + '"_name":"todo",'+ + '"_elements":[{"_type":"text",'+ + '"_text":"Work"}]},'+ + '{"_type":"element",'+ + '"_name":"todo",'+ + '"_elements":[{"_type":"text",'+ + '"_text":"Play"}]}]}]}' + expect(result1).assertEqual(str1); + done(); + }) + + it('Telephony_convertxml_ConvertXML_1500', 0, async function (done) { + var xml = + '' + + ''+ + '' + + ' Happy' + + ' Work' + + ' Play' + + ''; + var convertml = new ConvertXML(); + var result1 = convertml.convert(xml, {compact: false, commentKey: "123"}) + var str1 = '{"_declaration":{"_attributes":{"version":"1.0",'+ + '"encoding":"utf-8"}},'+ + '"_elements":[{"123":"note",'+ + '"_type":"comment"},'+ + '{"_type":"element",'+ + '"_name":"note",'+ + '"_attributes":{"importance":"high",'+ + '"logged":"true"},'+ + '"_elements":[{"_type":"element",'+ + '"_name":"title",'+ + '"_elements":[{"_type":"text",'+ + '"_text":"Happy"}]},'+ + '{"_type":"element",'+ + '"_name":"todo",'+ + '"_elements":[{"_type":"text",'+ + '"_text":"Work"}]},'+ + '{"_type":"element",'+ + '"_name":"todo",'+ + '"_elements":[{"_type":"text",'+ + '"_text":"Play"}]}]}]}' + expect(result1).assertEqual(str1); + done(); + }) + + it('Telephony_convertxml_ConvertXML_1600', 0, async function (done) { + var xml = + '' + + '' + + ' '+ + ' Happy' + + ' Work' + + ' Play' + + ''; + var convertml = new ConvertXML(); + var result1 = convertml.convert(xml, {compact: false, parentKey: "123"}) + var str1 = '{"_declaration":{"_attributes":{"version":"1.0",'+ + '"encoding":"utf-8"}},'+ + '"_elements":[{"_type":"element",'+ + '"_name":"note",'+ + '"_attributes":{"importance":"high",'+ + '"logged":"true"},'+ + '"_elements":[{"_type":"element",'+ + '"_name":"a",'+ + '"_elements":[{"_type":"element",'+ + '"_name":"b"}]},'+ + '{"_type":"element",'+ + '"_name":"title",'+ + '"_elements":[{"_type":"text",'+ + '"_text":"Happy"}]},'+ + '{"_type":"element",'+ + '"_name":"todo",'+ + '"_elements":[{"_type":"text",'+ + '"_text":"Work"}]},'+ + '{"_type":"element",'+ + '"_name":"todo",'+ + '"_elements":[{"_type":"text",'+ + '"_text":"Play"}]}]}]}' + expect(result1).assertEqual(str1); + done(); + }) + + it('Telephony_convertxml_ConvertXML_1700', 0, async function (done) { + var xml = + '' + + '' + + ' Happy' + + ' Work' + + ' Play' + + ''; + var convertml = new ConvertXML(); + var result1 = convertml.convert(xml, {compact: false, typeKey: "123"}) + var str1 = '{"_declaration":{"_attributes":{"version":"1.0",'+ + '"encoding":"utf-8"}},'+ + '"_elements":[{"123":"element",'+ + '"_name":"note",'+ + '"_attributes":{"importance":"high",'+ + '"logged":"true"},'+ + '"_elements":[{"123":"element",'+ + '"_name":"title",'+ + '"_elements":[{"123":"text",'+ + '"_text":"Happy"}]},'+ + '{"123":"element",'+ + '"_name":"todo",'+ + '"_elements":[{"123":"text",'+ + '"_text":"Work"}]},'+ + '{"123":"element",'+ + '"_name":"todo",'+ + '"_elements":[{"123":"text",'+ + '"_text":"Play"}]}]}]}' + expect(result1).assertEqual(str1); + done(); + }) + + it('Telephony_convertxml_ConvertXML_1800', 0, async function (done) { + var xml = + '' + + '' + + ' Happy' + + ' Work' + + ' Play' + + ''; + var convertml = new ConvertXML(); + var result1 = convertml.convert(xml, {compact: false, nameKey: "123"}) + var str1 = '{"_declaration":{"_attributes":{"version":"1.0",'+ + '"encoding":"utf-8"}},'+ + '"_elements":[{"123":"note",'+ + '"_type":"element",'+ + '"_attributes":{"importance":"high",'+ + '"logged":"true"},'+ + '"_elements":[{"123":"title",'+ + '"_type":"element",'+ + '"_elements":[{"_type":"text",'+ + '"_text":"Happy"}]},'+ + '{"123":"todo",'+ + '"_type":"element",'+ + '"_elements":[{"_type":"text",'+ + '"_text":"Work"}]},'+ + '{"123":"todo",'+ + '"_type":"element",'+ + '"_elements":[{"_type":"text",'+ + '"_text":"Play"}]}]}]}' + expect(result1).assertEqual(str1); + done(); + }) + + it('Telephony_convertxml_ConvertXML_1900', 0, async function (done) { + var xml = + '' + + '' + + ' Happy' + + ' Work' + + ' Play' + + ''; + var convertml = new ConvertXML(); + var result1 = convertml.convert(xml, {compact: false, elementsKey: "123"}) + var str1 = '{"123":[{"123":[{"123":[{"_type":"text",'+ + '"_text":"Happy"}],'+ + '"_type":"element",'+ + '"_name":"title"},'+ + '{"123":[{"_type":"text",'+ + '"_text":"Work"}],'+ + '"_type":"element",'+ + '"_name":"todo"},'+ + '{"123":[{"_type":"text",'+ + '"_text":"Play"}],'+ + '"_type":"element",'+ + '"_name":"todo"}],'+ + '"_type":"element",'+ + '"_name":"note",'+ + '"_attributes":{"importance":"high",'+ + '"logged":"true"}}],'+ + '"_declaration":{"_attributes":{"version":"1.0",'+ + '"encoding":"utf-8"}}}' + expect(result1).assertEqual(str1); + done(); + }) + + it('Telephony_convertxml_ConvertXML_2000', 0, async function (done) { + var xml = + '' + + '' + + ' Happy ' + + ' Work' + + ' Play' + + ''; + var convertml = new ConvertXML(); + var result1 = convertml.convert(xml, {compact: false,trim :true}) + var str1 = '{"_declaration":{"_attributes":{"version":"1.0",'+ + '"encoding":"utf-8"}},'+ + '"_elements":[{"_type":"element",'+ + '"_name":"note",'+ + '"_attributes":{"importance":"high",'+ + '"logged":"true"},'+ + '"_elements":[{"_type":"element",'+ + '"_name":"title",'+ + '"_elements":[{"_type":"text",'+ + '"_text":"Happy"}]},'+ + '{"_type":"element",'+ + '"_name":"todo",'+ + '"_elements":[{"_type":"text",'+ + '"_text":"Work"}]},'+ + '{"_type":"element",'+ + '"_name":"todo",'+ + '"_elements":[{"_type":"text",'+ + '"_text":"Play"}]}]}]}' + expect(result1).assertEqual(str1); + done(); + }) + + it('Telephony_convertxml_ConvertXML_2100', 0, async function (done) { + var xml = + '' + + '' + + ' Happy' + + ' Work' + + ' Play' + + ''; + var convertml = new ConvertXML(); + var result1 = convertml.convert(xml, {compact: false, ignoreDeclaration: true}); + var str1 = '{"_elements":[{"_type":"element",'+ + '"_name":"note",'+ + '"_attributes":{"importance":"high",'+ + '"logged":"true"},'+ + '"_elements":[{"_type":"element",'+ + '"_name":"title",'+ + '"_elements":[{"_type":"text",'+ + '"_text":"Happy"}]},'+ + '{"_type":"element",'+ + '"_name":"todo",'+ + '"_elements":[{"_type":"text",'+ + '"_text":"Work"}]},'+ + '{"_type":"element",'+ + '"_name":"todo",'+ + '"_elements":[{"_type":"text",'+ + '"_text":"Play"}]}]}]}' + expect(result1).assertEqual(str1); + done(); + }) + + it('Telephony_convertxml_ConvertXML_2200', 0,async function (done) { + var xml = + '' + + '' + + ' Happy' + + ' Work' + + ' Play' + + ''; + var convertml = new ConvertXML(); + var result1 = convertml.convert(xml, {compact: false, ignoreDeclaration: true}); + var str1 = '{"_elements":[{"_type":"element",'+ + '"_name":"note",'+ + '"_attributes":{"importance":"high",'+ + '"logged":"true"},'+ + '"_elements":[{"_type":"element",'+ + '"_name":"title",'+ + '"_elements":[{"_type":"text",'+ + '"_text":"Happy"}]},'+ + '{"_type":"element",'+ + '"_name":"todo",'+ + '"_elements":[{"_type":"text",'+ + '"_text":"Work"}]},'+ + '{"_type":"element",'+ + '"_name":"todo",'+ + '"_elements":[{"_type":"text",'+ + '"_text":"Play"}]}]}]}' + expect(result1).assertEqual(str1); + done(); + }) + + it('Telephony_convertxml_ConvertXML_2300', 0, async function (done) { + var xml = + '' + + '' + + ' Happy' + + ' Work' + + ' Play' + + ''; + var convertml = new ConvertXML(); + var result1 = convertml.convert(xml, {compact: false, ignoreAttributes: true}); + var str1 = '{"_declaration":{"_attributes":{"version":"1.0",'+ + '"encoding":"utf-8"}},'+ + '"_elements":[{"_type":"element",'+ + '"_name":"note",'+ + '"_elements":[{"_type":"element",'+ + '"_name":"title",'+ + '"_elements":[{"_type":"text",'+ + '"_text":"Happy"}]},'+ + '{"_type":"element",'+ + '"_name":"todo",'+ + '"_elements":[{"_type":"text",'+ + '"_text":"Work"}]},'+ + '{"_type":"element",'+ + '"_name":"todo",'+ + '"_elements":[{"_type":"text",'+ + '"_text":"Play"}]}]}]}' + expect(result1).assertEqual(str1); + done(); + }) + + it('Telephony_convertxml_ConvertXML_2400', 0,async function (done) { + var xml = + '' + + '' + + ' '+ + ' Happy' + + ' Work' + + ' Play' + + ''; + var convertml = new ConvertXML(); + var result1 = convertml.convert(xml, {compact: false, ignoreComment: true}) + var str1 = '{"_declaration":{"_attributes":{"version":"1.0",'+ + '"encoding":"utf-8"}},'+ + '"_elements":[{"_type":"element",'+ + '"_name":"note",'+ + '"_attributes":{"importance":"high",'+ + '"logged":"true"},'+ + '"_elements":[{"_type":"element",'+ + '"_name":"title",'+ + '"_elements":[{"_type":"text",'+ + '"_text":"Happy"}]},'+ + '{"_type":"element",'+ + '"_name":"todo",'+ + '"_elements":[{"_type":"text",'+ + '"_text":"Work"}]},'+ + '{"_type":"element",'+ + '"_name":"todo",'+ + '"_elements":[{"_type":"text",'+ + '"_text":"Play"}]}]}]}' + expect(result1).assertEqual(str1); + done(); + }) + + it('Telephony_convertxml_ConvertXML_2500', 0, async function (done) { + var xml = + '' + + '' + + ' ]]>'+ + ' Happy' + + ' Work' + + ' Play' + + ''; + var convertml = new ConvertXML(); + var result1 = convertml.convert(xml, {compact: false, ignoreCDATA: true}) + var str1 = '{"_declaration":{"_attributes":{"version":"1.0",'+ + '"encoding":"utf-8"}},'+ + '"_elements":[{"_type":"element",'+ + '"_name":"note",'+ + '"_attributes":{"importance":"high",'+ + '"logged":"true"},'+ + '"_elements":[{"_type":"element",'+ + '"_name":"title",'+ + '"_elements":[{"_type":"text",'+ + '"_text":"Happy"}]},'+ + '{"_type":"element",'+ + '"_name":"todo",'+ + '"_elements":[{"_type":"text",'+ + '"_text":"Work"}]},'+ + '{"_type":"element",'+ + '"_name":"todo",'+ + '"_elements":[{"_type":"text",'+ + '"_text":"Play"}]}]}]}' + expect(result1).assertEqual(str1); + done(); + }) + + it('Telephony_convertxml_ConvertXML_2600', 0, async function (done) { + var xml = + '' + + ''+ + '' + + ' Happy' + + ' Work' + + ' Play' + + ''; + var convertml = new ConvertXML(); + var result1 = convertml.convert(xml, {compact: false, ignoreDoctype: true}) + var str1 = '{"_declaration":{"_attributes":{"version":"1.0",'+ + '"encoding":"utf-8"}},'+ + '"_elements":[{"_type":"element",'+ + '"_name":"note",'+ + '"_attributes":{"importance":"high",'+ + '"logged":"true"},'+ + '"_elements":[{"_type":"element",'+ + '"_name":"title",'+ + '"_elements":[{"_type":"text",'+ + '"_text":"Happy"}]},'+ + '{"_type":"element",'+ + '"_name":"todo",'+ + '"_elements":[{"_type":"text",'+ + '"_text":"Work"}]},'+ + '{"_type":"element",'+ + '"_name":"todo",'+ + '"_elements":[{"_type":"text",'+ + '"_text":"Play"}]}]}]}' + expect(result1).assertEqual(str1); + done(); + }) + + it('Telephony_convertxml_ConvertXML_2700', 0, async function (done) { + var xml = + '' + + '' + + ' Happy' + + ' Work' + + ' Play' + + ''; + var convertml = new ConvertXML(); + var result1 = convertml.convert(xml, {compact: false, ignoreText: true}) + var str1 = '{"_declaration":{"_attributes":{"version":"1.0",'+ + '"encoding":"utf-8"}},'+ + '"_elements":[{"_type":"element",'+ + '"_name":"note",'+ + '"_attributes":{"importance":"high",'+ + '"logged":"true"},'+ + '"_elements":[{"_type":"element",'+ + '"_name":"title"},'+ + '{"_type":"element",'+ + '"_name":"todo"},'+ + '{"_type":"element",'+ + '"_name":"todo"}]}]}' + expect(result1).assertEqual(str1); + done(); + }) + + it('Telephony_convertxml_ConvertXML_2800', 0, async function (done) { + var xml = + '' + + '' + + ' Happy' + + ' Work' + + ' Play' + + ''; + var convertml = new ConvertXML(); + var result1 = convertml.convert(xml, {compact: false, declarationKey: "456"}) + var str1 = '{"456":{"_attributes":{"version":"1.0",'+ + '"encoding":"utf-8"}},'+ + '"_elements":[{"_type":"element",'+ + '"_name":"note",'+ + '"_attributes":{"importance":"high",'+ + '"logged":"true"},'+ + '"_elements":[{"_type":"element",'+ + '"_name":"title",'+ + '"_elements":[{"_type":"text",'+ + '"_text":"Happy"}]},'+ + '{"_type":"element",'+ + '"_name":"todo",'+ + '"_elements":[{"_type":"text",'+ + '"_text":"Work"}]},'+ + '{"_type":"element",'+ + '"_name":"todo",'+ + '"_elements":[{"_type":"text",'+ + '"_text":"Play"}]}]}]}' + expect(result1).assertEqual(str1); + done(); + }) + + it('Telephony_convertxml_ConvertXML_2900', 0, async function (done) { + var xml = + '' + + '' + + ' '+ + ' Happy' + + ' Work' + + ' Play' + + ''; + var convertml = new ConvertXML(); + var result1 = convertml.convert(xml, {compact: false, instructionKey: "456"}) + var str1 = '{"_declaration":{"_attributes":{"version":"1.0",'+ + '"encoding":"utf-8"}},'+ + '"_elements":[{"_type":"element",'+ + '"_name":"note",'+ + '"_attributes":{"importance":"high",'+ + '"logged":"true"},'+ + '"_elements":[{"456":"there",'+ + '"_type":"instruction",'+ + '"_name":"go"},'+ + '{"_type":"element",'+ + '"_name":"title",'+ + '"_elements":[{"_type":"text",'+ + '"_text":"Happy"}]},'+ + '{"_type":"element",'+ + '"_name":"todo",'+ + '"_elements":[{"_type":"text",'+ + '"_text":"Work"}]},'+ + '{"_type":"element",'+ + '"_name":"todo",'+ + '"_elements":[{"_type":"text",'+ + '"_text":"Play"}]}]}]}' + expect(result1).assertEqual(str1); + done(); + }) + + it('Telephony_convertxml_ConvertXML_3000', 0, async function (done) { + var xml = + '' + + '' + + ' '+ + ' Happy' + + ' Work' + + ' Play' + + ''; + var convertml = new ConvertXML(); + var result1 = convertml.convert(xml, {compact: false, attributesKey: "456"}) + var str1 = '{"_declaration":{"456":{"version":"1.0",'+ + '"encoding":"utf-8"}},'+ + '"_elements":[{"456":{"importance":"high",'+ + '"logged":"true"},'+ + '"_type":"element",'+ + '"_name":"note",'+ + '"_elements":[{"_type":"instruction",'+ + '"_name":"go",'+ + '"_instruction":"there"},'+ + '{"_type":"element",'+ + '"_name":"title",'+ + '"_elements":[{"_type":"text",'+ + '"_text":"Happy"}]},'+ + '{"_type":"element",'+ + '"_name":"todo",'+ + '"_elements":[{"_type":"text",'+ + '"_text":"Work"}]},'+ + '{"_type":"element",'+ + '"_name":"todo",'+ + '"_elements":[{"_type":"text",'+ + '"_text":"Play"}]}]}]}' + expect(result1).assertEqual(str1); + done(); + }) + + it('Telephony_convertxml_ConvertXML_3100', 0, async function (done) { + var xml = + '' + + '' + + ' Happy' + + ' Work' + + ' Play' + + ''; + var convertml = new ConvertXML(); + var result1 = convertml.convert(xml, {compact: false, textKey: "456"}) + var str1 = '{"_declaration":{"_attributes":{"version":"1.0",'+ + '"encoding":"utf-8"}},'+ + '"_elements":[{"_type":"element",'+ + '"_name":"note",'+ + '"_attributes":{"importance":"high",'+ + '"logged":"true"},'+ + '"_elements":[{"_type":"element",'+ + '"_name":"title",'+ + '"_elements":[{"456":"Happy",'+ + '"_type":"text"}]},'+ + '{"_type":"element",'+ + '"_name":"todo",'+ + '"_elements":[{"456":"Work",'+ + '"_type":"text"}]},'+ + '{"_type":"element",'+ + '"_name":"todo",'+ + '"_elements":[{"456":"Play",'+ + '"_type":"text"}]}]}]}' + expect(result1).assertEqual(str1); + done(); + }) + + it('Telephony_convertxml_ConvertXML_3200', 0, async function (done) { + var xml = + '' + + '' + + ' '+ + ' Happy' + + ' Work' + + ' Play' + + ''; + var convertml = new ConvertXML(); + var result1 = convertml.convert(xml, {compact: false, cdataKey: "456"}) + var str1 = '{"_declaration":{"_attributes":{"version":"1.0",'+ + '"encoding":"utf-8"}},'+ + '"_elements":[{"_type":"element",'+ + '"_name":"note",'+ + '"_attributes":{"importance":"high",'+ + '"logged":"true"},'+ + '"_elements":[{"456":"1 is < 2",'+ + '"_type":"cdata"},'+ + '{"_type":"element",'+ + '"_name":"title",'+ + '"_elements":[{"_type":"text",'+ + '"_text":"Happy"}]},'+ + '{"_type":"element",'+ + '"_name":"todo",'+ + '"_elements":[{"_type":"text",'+ + '"_text":"Work"}]},'+ + '{"_type":"element",'+ + '"_name":"todo",'+ + '"_elements":[{"_type":"text",'+ + '"_text":"Play"}]}]}]}' + expect(result1).assertEqual(str1); + done(); + }) + + it('Telephony_convertxml_ConvertXML_3300', 0, async function (done) { + var xml = + '' + + ''+ + '' + + ' Happy' + + ' Work' + + ' Play' + + ''; + var convertml = new ConvertXML(); + var result1 = convertml.convert(xml, {compact: false, doctypeKey: 'doctype_next'}) + var str1 = '{"_declaration":{"_attributes":{"version":"1.0",'+ + '"encoding":"utf-8"}},'+ + '"_elements":[{"_type":"doctype","doctype_next":"foo"},'+ + '{"_type":"element",'+ + '"_name":"note",'+ + '"_attributes":{"importance":"high",'+ + '"logged":"true"},'+ + '"_elements":[{"_type":"element",'+ + '"_name":"title",'+ + '"_elements":[{"_type":"text",'+ + '"_text":"Happy"}]},'+ + '{"_type":"element",'+ + '"_name":"todo",'+ + '"_elements":[{"_type":"text",'+ + '"_text":"Work"}]},'+ + '{"_type":"element",'+ + '"_name":"todo",'+ + '"_elements":[{"_type":"text",'+ + '"_text":"Play"}]}]}]}' + expect(result1).assertEqual(str1); + done(); + }) + + it('Telephony_convertxml_ConvertXML_3400', 0, async function (done) { + var xml = + '' + + ''+ + '' + + ' Happy' + + ' Work' + + ' Play' + + ''; + var convertml = new ConvertXML(); + var result1 = convertml.convert(xml, {compact: false, commentKey: "456"}) + var str1 = '{"_declaration":{"_attributes":{"version":"1.0",'+ + '"encoding":"utf-8"}},'+ + '"_elements":[{"456":"note",'+ + '"_type":"comment"},'+ + '{"_type":"element",'+ + '"_name":"note",'+ + '"_attributes":{"importance":"high",'+ + '"logged":"true"},'+ + '"_elements":[{"_type":"element",'+ + '"_name":"title",'+ + '"_elements":[{"_type":"text",'+ + '"_text":"Happy"}]},'+ + '{"_type":"element",'+ + '"_name":"todo",'+ + '"_elements":[{"_type":"text",'+ + '"_text":"Work"}]},'+ + '{"_type":"element",'+ + '"_name":"todo",'+ + '"_elements":[{"_type":"text",'+ + '"_text":"Play"}]}]}]}' + expect(result1).assertEqual(str1); + done(); + }) + + it('Telephony_convertxml_ConvertXML_3500', 0, async function (done) { + var xml = + '' + + '' + + ' '+ + ' Happy' + + ' Work' + + ' Play' + + ''; + var convertml = new ConvertXML(); + var result1 = convertml.convert(xml, {compact: false, parentKey: "456"}) + var str1 = '{"_declaration":{"_attributes":{"version":"1.0",'+ + '"encoding":"utf-8"}},'+ + '"_elements":[{"_type":"element",'+ + '"_name":"note",'+ + '"_attributes":{"importance":"high",'+ + '"logged":"true"},'+ + '"_elements":[{"_type":"element",'+ + '"_name":"a",'+ + '"_elements":[{"_type":"element",'+ + '"_name":"b"}]},'+ + '{"_type":"element",'+ + '"_name":"title",'+ + '"_elements":[{"_type":"text",'+ + '"_text":"Happy"}]},'+ + '{"_type":"element",'+ + '"_name":"todo",'+ + '"_elements":[{"_type":"text",'+ + '"_text":"Work"}]},'+ + '{"_type":"element",'+ + '"_name":"todo",'+ + '"_elements":[{"_type":"text",'+ + '"_text":"Play"}]}]}]}' + expect(result1).assertEqual(str1); + done(); + }) + + it('Telephony_convertxml_ConvertXML_3600', 0, async function (done) { + var xml = + '' + + '' + + ' Happy' + + ' Work' + + ' Play' + + ''; + var convertml = new ConvertXML(); + var result1 = convertml.convert(xml, {compact: false, typeKey: "123"}) + var str1 = '{"_declaration":{"_attributes":{"version":"1.0",'+ + '"encoding":"utf-8"}},'+ + '"_elements":[{"123":"element",'+ + '"_name":"note",'+ + '"_attributes":{"importance":"high",'+ + '"logged":"true"},'+ + '"_elements":[{"123":"element",'+ + '"_name":"title",'+ + '"_elements":[{"123":"text",'+ + '"_text":"Happy"}]},'+ + '{"123":"element",'+ + '"_name":"todo",'+ + '"_elements":[{"123":"text",'+ + '"_text":"Work"}]},'+ + '{"123":"element",'+ + '"_name":"todo",'+ + '"_elements":[{"123":"text",'+ + '"_text":"Play"}]}]}]}' + expect(result1).assertEqual(str1); + done(); + }) + + it('Telephony_convertxml_ConvertXML_3700', 0, async function (done) { + var xml = + '' + + '' + + ' Happy' + + ' Work' + + ' Play' + + ''; + var convertml = new ConvertXML(); + var result1 = convertml.convert(xml, {compact: false, nameKey: "123"}) + var str1 = '{"_declaration":{"_attributes":{"version":"1.0",'+ + '"encoding":"utf-8"}},'+ + '"_elements":[{"123":"note",'+ + '"_type":"element",'+ + '"_attributes":{"importance":"high",'+ + '"logged":"true"},'+ + '"_elements":[{"123":"title",'+ + '"_type":"element",'+ + '"_elements":[{"_type":"text",'+ + '"_text":"Happy"}]},'+ + '{"123":"todo",'+ + '"_type":"element",'+ + '"_elements":[{"_type":"text",'+ + '"_text":"Work"}]},'+ + '{"123":"todo",'+ + '"_type":"element",'+ + '"_elements":[{"_type":"text",'+ + '"_text":"Play"}]}]}]}' + expect(result1).assertEqual(str1); + done(); + }) + + it('Telephony_convertxml_ConvertXML_3800', 0, async function (done) { + var xml = + '' + + '' + + ' Happy' + + ' Work' + + ' Play' + + ''; + var convertml = new ConvertXML(); + var result1 = convertml.convert(xml, {compact: false, elementsKey: "123"}) + var str1 = '{"123":[{"123":[{"123":[{"_type":"text",'+ + '"_text":"Happy"}],'+ + '"_type":"element",'+ + '"_name":"title"},'+ + '{"123":[{"_type":"text",'+ + '"_text":"Work"}],'+ + '"_type":"element",'+ + '"_name":"todo"},'+ + '{"123":[{"_type":"text",'+ + '"_text":"Play"}],'+ + '"_type":"element",'+ + '"_name":"todo"}],'+ + '"_type":"element",'+ + '"_name":"note",'+ + '"_attributes":{"importance":"high",'+ + '"logged":"true"}}],'+ + '"_declaration":{"_attributes":{"version":"1.0",'+ + '"encoding":"utf-8"}}}' + expect(result1).assertEqual(str1); + done(); + }) + }) +} \ No newline at end of file diff --git a/telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/test/DataJsunit.test.ets b/telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/test/DataJsunit.test.ets new file mode 100644 index 000000000..e633a798e --- /dev/null +++ b/telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/test/DataJsunit.test.ets @@ -0,0 +1,166 @@ +/** + * 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 {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index.ets' +import data from '@ohos.telephony.data'; + + +export function toString(data) { + if (typeof data === 'object') { + return JSON.stringify(data); + } else { + return data; + } +} + +export default function dataJsunit() { + describe('dataTest', function () { + console.log("==========> data Test start ==========>"); + + + /** + * @tc.number Telephony_Data_DataFlowType_DATA_FLOW_TYPE_NONE + * @tc.name Enum DataFlowType + * @tc.desc Enum value test + */ + it("Telephony_Data_DataFlowType_DATA_FLOW_TYPE_NONE", 0, async function (done) { + let caseName = 'Telephony_Data_DataFlowType_DATA_FLOW_TYPE_NONE'; + console.log(`==========> ${caseName} Test start ==========>`); + expect(0).assertEqual(data.DataFlowType.DATA_FLOW_TYPE_NONE); + console.log(`==========> ${caseName} Test end ==========>`); + done(); + }); + + /** + * @tc.number Telephony_Data_DataFlowType_DATA_FLOW_TYPE_DOWN + * @tc.name Enum DataFlowType + * @tc.desc Enum value test + */ + it("Telephony_Data_DataFlowType_DATA_FLOW_TYPE_DOWN", 0, async function (done) { + let caseName = 'Telephony_Data_DataFlowType_DATA_FLOW_TYPE_DOWN'; + console.log(`==========> ${caseName} Test start ==========>`); + expect(1).assertEqual(data.DataFlowType.DATA_FLOW_TYPE_DOWN); + console.log(`==========> ${caseName} Test end ==========>`); + done(); + }); + + /** + * @tc.number Telephony_Data_DataFlowType_DATA_FLOW_TYPE_UP + * @tc.name Enum DataFlowType + * @tc.desc Enum value test + */ + it("Telephony_Data_DataFlowType_DATA_FLOW_TYPE_UP", 0, async function (done) { + let caseName = 'Telephony_Data_DataFlowType_DATA_FLOW_TYPE_UP'; + console.log(`==========> ${caseName} Test start ==========>`); + expect(2).assertEqual(data.DataFlowType.DATA_FLOW_TYPE_UP); + console.log(`==========> ${caseName} Test end ==========>`); + done(); + }); + + /** + * @tc.number Telephony_Data_DataFlowType_DATA_FLOW_TYPE_UP + * @tc.name Enum DataFlowType + * @tc.desc Enum value test + */ + it("Telephony_Data_DataFlowType_DATA_FLOW_TYPE_UP_DOWN", 0, async function (done) { + let caseName = 'Telephony_Data_DataFlowType_DATA_FLOW_TYPE_UP_DOWN'; + console.log(`==========> ${caseName} Test start ==========>`); + expect(3).assertEqual(data.DataFlowType.DATA_FLOW_TYPE_UP_DOWN); + console.log(`==========> ${caseName} Test end ==========>`); + done(); + }); + + /** + * @tc.number Telephony_Data_DataFlowType_DATA_FLOW_TYPE_DORMANT + * @tc.name Enum DataFlowType + * @tc.desc Enum value test + */ + it("Telephony_Data_DataFlowType_DATA_FLOW_TYPE_DORMANT", 0, async function (done) { + let caseName = 'Telephony_Data_DataFlowType_DATA_FLOW_TYPE_DORMANT'; + console.log(`==========> ${caseName} Test start ==========>`); + expect(4).assertEqual(data.DataFlowType.DATA_FLOW_TYPE_DORMANT); + console.log(`==========> ${caseName} Test end ==========>`); + done(); + }); + + /** + * @tc.number Telephony_Data_DataConnectState_DATA_STATE_UNKNOWN + * @tc.name Enum DataConnectState + * @tc.desc Enum value test + */ + it("Telephony_Data_DataConnectState_DATA_STATE_UNKNOWN", 0, async function (done) { + let caseName = 'Telephony_Data_DataConnectState_DATA_DATA_STATE_UNKNOWN'; + console.log(`==========> ${caseName} Test start ==========>`); + expect(-1).assertEqual(data.DataConnectState.DATA_STATE_UNKNOWN); + console.log(`==========> ${caseName} Test end ==========>`); + done(); + }); + + /** + * @tc.number Telephony_Data_DataConnectState_DATA_STATE_DISCONNECTED + * @tc.name Enum DataConnectState + * @tc.desc Enum value test + */ + it("Telephony_Data_DataConnectState_DATA_STATE_DISCONNECTED", 0, async function (done) { + let caseName = 'Telephony_Data_DataConnectState_DATA_DATA_STATE_DISCONNECTED'; + console.log(`==========> ${caseName} Test start ==========>`); + expect(0).assertEqual(data.DataConnectState.DATA_STATE_DISCONNECTED); + console.log(`==========> ${caseName} Test end ==========>`); + done(); + }); + + /** + * @tc.number Telephony_Data_DataConnectState_DATA_STATE_CONNECTING + * @tc.name Enum DataConnectState + * @tc.desc Enum value test + */ + it("Telephony_Data_DataConnectState_DATA_STATE_CONNECTING", 0, async function (done) { + let caseName = 'Telephony_Data_DataConnectState_DATA_STATE_CONNECTING'; + console.log(`==========> ${caseName} Test start ==========>`); + expect(1).assertEqual(data.DataConnectState.DATA_STATE_CONNECTING); + console.log(`==========> ${caseName} Test end ==========>`); + done(); + }); + + /** + * @tc.number Telephony_Data_DataConnectState_DATA_STATE_CONNECTED + * @tc.name Enum DataConnectState + * @tc.desc Enum value test + */ + it("Telephony_Data_DataConnectState_DATA_STATE_CONNECTED", 0, async function (done) { + let caseName = 'Telephony_Data_DataConnectState_DATA_STATE_CONNECTED'; + console.log(`==========> ${caseName} Test start ==========>`); + expect(2).assertEqual(data.DataConnectState.DATA_STATE_CONNECTED); + console.log(`==========> ${caseName} Test end ==========>`); + done(); + }); + + /** + * @tc.number Telephony_Data_DataConnectState_DATA_STATE_SUSPENDED + * @tc.name Enum DataConnectState + * @tc.desc Enum value test + */ + it("Telephony_Data_DataConnectState_DATA_STATE_SUSPENDED", 0, async function (done) { + let caseName = 'Telephony_Data_DataConnectState_DATA_STATE_SUSPENDED'; + console.log(`==========> ${caseName} Test start ==========>`); + expect(3).assertEqual(data.DataConnectState.DATA_STATE_SUSPENDED); + console.log(`==========> ${caseName} Test end ==========>`); + done(); + }); + + + }); +} + + diff --git a/telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/test/List.test.ets b/telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/test/List.test.ets new file mode 100644 index 000000000..5ebbc36cb --- /dev/null +++ b/telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/test/List.test.ets @@ -0,0 +1,38 @@ +/** + * 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. + */ + +//other import +import convertOptionsJsunit from './ConvertOptionsJsunit.test.ets' +import radioJsunit from './RadioJsunit.test.ets' +import radioSecondJsunit from './RadioSecondJsunit.test.ets' +import observerJsunit from './ObserverJsunit.test.ets' +import smsUiJsunit from './SmsMmsJsunit.test.ets'; +import callJsunit from './CallJsunit.test.ets'; +import dataJsunit from './DataJsunit.test.ets'; +import simJsunit from './SimJsunit.test.ets'; +import statisticsUiJsunit from './StatisticsJsunit.test.ets'; + +export default function testsuite() { + //other + dataJsunit(); + callJsunit(); + smsUiJsunit(); + convertOptionsJsunit(); + observerJsunit(); + radioJsunit(); + radioSecondJsunit(); + simJsunit(); + statisticsUiJsunit(); +} \ No newline at end of file diff --git a/telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/test/ObserverJsunit.test.ets b/telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/test/ObserverJsunit.test.ets new file mode 100644 index 000000000..7aaeec92e --- /dev/null +++ b/telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/test/ObserverJsunit.test.ets @@ -0,0 +1,766 @@ +// @ts-nocheck +/** + * 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 {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index' +import observer from '@ohos.telephony.observer' +import cellular from '@ohos.telephony.data' +import radio from '@ohos.telephony.radio' +import utils from './Utils.ets' +import {SimStateData} from '@ohos.telephony.observer' +import {LockReason} from '@ohos.telephony.observer' +import sim from "@ohos.telephony.sim" + +export default function observerJsunit() { + describe('ObserverTest', function () { + console.log("************* Observer Test start *************") + + const SLOT_0 = 0; + const SLOT_2 = -1; + + /* + * @tc.number : Telephony_observer_observer_DataConnectState_0100 + * @tc.name : DataConnectState + * @tc.desc : check the getCellularDataState callback to verify the call back data + */ + it('Telephony_observer_observer_DataConnectState_0100', 0, function (done) { + console.log("************* Telephony_observer_observer_DataConnectState_0100 Test start *************") + cellular.getCellularDataState((err, data) => { + if (!err) { + var dataConnectStateList = [cellular.DataConnectState.DATA_STATE_UNKNOWN, + cellular.DataConnectState.DATA_STATE_DISCONNECTED, + cellular.DataConnectState.DATA_STATE_CONNECTING, + cellular.DataConnectState.DATA_STATE_CONNECTED, + cellular.DataConnectState.DATA_STATE_SUSPENDED] + expect(dataConnectStateList.indexOf(data) >= 0).assertTrue() + done(); + return; + } + console.log("Telephony_CellularData_getCellularDataState_0100 end"); + done() + }) + console.log("************* Telephony_observer_observer_DataConnectState_0100 Test end *************") + }) + + /* + * @tc.number : Telephony_observer_observer_DataConnectState_0200 + * @tc.name : DataConnectState + * @tc.desc : check the getCellularDataState callback to verify the call back data + */ + it('Telephony_observer_observer_DataConnectState_0200', 0, function (done) { + console.log("************* Telephony_observer_observer_DataConnectState_0200 Test start *************") + if (utils.notCheck) { + expect(true).assertTrue() + done() + } + // console.log(observer.DataConnectState) + console.log("************* Telephony_observer_observer_DataConnectState_0200 Test end *************") + }) + + /* + * @tc.number : Telephony_observer_observer_RatType_0100 + * @tc.name : RatType + * @tc.desc : Obtains the data connect state + */ + it('Telephony_observer_observer_RatType_0100', 0, async function (done) { + console.log("************* Telephony_observer_observer_RatType_0100 Test start *************") + if (utils.notCheck) { + expect(true).assertTrue() + done() + } + // console.log(observer.RatType) + console.log("************* Telephony_observer_observer_RatType_0100 Test end *************") + done() + }) + + /* + * @tc.number : Telephony_observer_observer_on_networkStateChange_0100 + * @tc.name : on_networkStateChange + * @tc.desc : call the on method of networkStateChange + */ + it('Telephony_observer_observer_on_networkStateChange_0100', 0, async function (done) { + console.log("************* Telephony_observer_observer_on_networkStateChange_0100 Test start *************") + observer.on('networkStateChange', (networkState) => { + expect().assertFail() + done() + return + }) + setTimeout(timeout, 3000) + console.log("************* Telephony_observer_observer_on_networkStateChange_0100 Test end *************") + done() + }) + + /* + * @tc.number : Telephony_observer_observer_on_networkStateChange_0200 + * @tc.name : on_networkStateChange + * @tc.desc : call the on method of networkStateChange + */ + it('Telephony_observer_observer_on_networkStateChange_0200', 0, async function (done) { + console.log("************* Telephony_observer_observer_on_networkStateChange_0200 Test start *************") + observer.on('networkStateChange', { + slotId: SLOT_0 + }, (networkState) => { + expect().assertFail() + done() + return + }) + setTimeout(timeout, 3000) + console.log("************* Telephony_observer_observer_on_networkStateChange_0200 Test end *************") + done() + }) + + /* + * @tc.number : Telephony_observer_observer_off_networkStateChange_0100 + * @tc.name : off_networkStateChange + * @tc.desc : call the off method of networkStateChange + */ + it('Telephony_observer_observer_off_networkStateChange_0100', 0, async function (done) { + console.log("************* Telephony_observer_observer_off_networkStateChange_0100 Test start *************") + observer.off('networkStateChange', (networkState) => { + expect().assertFail() + done() + return + }) + setTimeout(timeout, 3000) + console.log("************* Telephony_observer_observer_off_networkStateChange_0100 Test end *************") + done() + }) + + /* + * @tc.number : Telephony_observer_observer_on_signalInfoChange_0100 + * @tc.name : on_signalInfoChange + * @tc.desc : call the on method of signalInfoChange + */ + it('Telephony_observer_observer_on_signalInfoChange_0100', 0, async function (done) { + console.log("************* Telephony_observer_observer_on_signalInfoChange_0100 Test start *************") + observer.on('signalInfoChange', (signalInformation) => { + expect().assertFail() + done() + return + }) + setTimeout(timeout, 3000) + console.log("************* Telephony_observer_observer_on_signalInfoChange_0100 Test end *************") + done() + }) + + /* + * @tc.number : Telephony_observer_observer_on_signalInfoChange_0200 + * @tc.name : on_signalInfoChange + * @tc.desc : call the on method of signalInfoChange + */ + it('Telephony_observer_observer_on_signalInfoChange_0200', 0, async function (done) { + console.log("************* Telephony_observer_observer_on_signalInfoChange_0200 Test start *************") + observer.on('signalInfoChange', { + slotId: SLOT_0 + }, (signalInformation) => { + expect().assertFail() + done() + return + }) + setTimeout(timeout, 3000) + console.log("************* Telephony_observer_observer_on_signalInfoChange_0200 Test end *************") + done() + }) + + /* + * @tc.number : Telephony_observer_observer_off_signalInfoChange_0100 + * @tc.name : off_signalInfoChange + * @tc.desc : call the off method of signalInfoChange + */ + it('Telephony_observer_observer_off_signalInfoChange_0100', 0, async function (done) { + console.log("************* Telephony_observer_observer_off_signalInfoChange_0100 Test start *************") + observer.off('signalInfoChange', (networkState) => { + expect().assertFail() + done() + return + }) + setTimeout(timeout, 3000) + console.log("************* Telephony_observer_observer_off_signalInfoChange_0100 Test end *************") + done() + }) + + /* + * @tc.number : Telephony_observer_observer_on_cellInfoChange_0100 + * @tc.name : on_cellInfoChange + * @tc.desc : call the on method of cellInfoChange + */ + it('Telephony_observer_observer_on_cellInfoChange_0100', 0, async function (done) { + console.log("************* Telephony_observer_observer_on_cellInfoChange_0100 Test start *************") + observer.on('cellInfoChange', (cellInformation) => { + expect().assertFail() + done() + return + }) + setTimeout(timeout, 3000) + console.log("************* Telephony_observer_observer_on_cellInfoChange_0100 Test end *************") + done() + }) + + /* + * @tc.number : Telephony_observer_observer_on_cellInfoChange_0200 + * @tc.name : on_cellInfoChange + * @tc.desc : call the on method of cellInfoChange + */ + it('Telephony_observer_observer_on_cellInfoChange_0200', 0, async function (done) { + console.log("************* Telephony_observer_observer_on_cellInfoChange_0200 Test start *************") + observer.on('cellInfoChange', { + slotId: SLOT_0 + }, (cellInformation) => { + expect().assertFail() + done() + return + }) + setTimeout(timeout, 3000) + console.log("************* Telephony_observer_observer_on_cellInfoChange_0200 Test end *************") + done() + }) + + /* + * @tc.number : Telephony_observer_observer_off_cellInfoChange_0100 + * @tc.name : off_cellInfoChange + * @tc.desc : call the off method of cellInfoChange + */ + it('Telephony_observer_observer_off_cellInfoChange_0100', 0, async function (done) { + console.log("************* Telephony_observer_observer_off_cellInfoChange_0100 Test start *************") + observer.off('cellInfoChange', (cellInformation) => { + expect().assertFail() + done() + return + }) + setTimeout(timeout, 3000) + console.log("************* Telephony_observer_observer_off_cellInfoChange_0100 Test end *************") + done() + }) + + /* + * @tc.number : Telephony_observer_observer_on_cellularDataConnectionStateChange_0100 + * @tc.name : on_cellularDataConnectionStateChange + * @tc.desc : call the on method of cellularDataConnectionStateChange + */ + it('Telephony_observer_observer_on_cellularDataConnectionStateChange_0100', 0, async function (done) { + console.log("************* Telephony_observer_observer_on_cellularDataConnectionStateChange_0100 Test start *************") + observer.on('cellularDataConnectionStateChange', (data) => { + expect().assertFail() + done() + return + }) + setTimeout(timeout, 3000) + console.log("************* Telephony_observer_observer_on_cellularDataConnectionStateChange_0100 Test end *************") + done() + }) + + /* + * @tc.number : Telephony_observer_observer_on_cellularDataConnectionStateChange_0200 + * @tc.name : on_cellularDataConnectionStateChange + * @tc.desc : call the on method of cellularDataConnectionStateChange + */ + it('Telephony_observer_observer_on_cellularDataConnectionStateChange_0200', 0, async function (done) { + console.log("************* Telephony_observer_observer_on_cellularDataConnectionStateChange_0200 Test start *************") + observer.on('cellularDataConnectionStateChange', { + slotId: SLOT_0 + }, (data) => { + expect().assertFail() + done() + return + }) + setTimeout(timeout, 3000) + console.log("************* Telephony_observer_observer_on_cellularDataConnectionStateChange_0200 Test end *************") + done() + }) + + /* + * @tc.number : Telephony_observer_observer_off_cellularDataConnectionStateChange_0100 + * @tc.name : off_cellularDataConnectionStateChange + * @tc.desc : call the off method of cellularDataConnectionStateChange + */ + it('Telephony_observer_observer_off_cellularDataConnectionStateChange_0100', 0, async function (done) { + console.log("************* Telephony_observer_observer_off_cellularDataConnectionStateChange_0100 Test start *************") + observer.off('cellularDataConnectionStateChange', (data) => { + expect().assertFail() + done() + return + }) + setTimeout(timeout, 3000) + console.log("************* Telephony_observer_observer_off_cellularDataConnectionStateChange_0100 Test end *************") + done() + }) + + /* + * @tc.number : Telephony_observer_observer_on_cellularDataFlowChange_0100 + * @tc.name : on_cellularDataFlowChange + * @tc.desc : call the on method of cellularDataFlowChange + */ + it('Telephony_observer_observer_on_cellularDataFlowChange_0100', 0, async function (done) { + console.log("************* Telephony_observer_observer_on_cellularDataFlowChange_0100 Test start *************") + observer.on('cellularDataFlowChange', (data) => { + expect().assertFail() + done() + return + }) + setTimeout(timeout, 3000) + console.log("************* Telephony_observer_observer_on_cellularDataFlowChange_0100 Test end *************") + done() + }) + + /* + * @tc.number : Telephony_observer_observer_on_cellularDataFlowChange_0200 + * @tc.name : on_cellularDataFlowChange + * @tc.desc : call the on method of cellularDataFlowChange + */ + it('Telephony_observer_observer_on_cellularDataFlowChange_0200', 0, async function (done) { + console.log("************* Telephony_observer_observer_on_cellularDataFlowChange_0200 Test start *************") + observer.on('cellularDataFlowChange', { + slotId: SLOT_0 + }, (data) => { + expect().assertFail() + done() + return + }) + setTimeout(timeout, 3000) + console.log("************* Telephony_observer_observer_on_cellularDataFlowChange_0200 Test end *************") + done() + }) + + /* + * @tc.number : Telephony_observer_observer_off_cellularDataFlowChange_0100 + * @tc.name : off_cellularDataFlowChange + * @tc.desc : call the off method of cellularDataFlowChange + */ + it('Telephony_observer_observer_off_cellularDataFlowChange_0100', 0, async function (done) { + console.log("************* Telephony_observer_observer_off_cellularDataFlowChange_0100 Test start *************") + observer.off('cellularDataFlowChange', (data) => { + expect().assertFail() + done() + return + }) + setTimeout(timeout, 3000) + console.log("************* Telephony_observer_observer_off_cellularDataFlowChange_0100 Test end *************") + done() + }) + + /* + * @tc.number : Telephony_observer_observer_on_callStateChange_0100 + * @tc.name : on_callStateChange + * @tc.desc : call the on method of callStateChange + */ + it('Telephony_observer_observer_on_callStateChange_0100', 0, async function (done) { + console.log("************* Telephony_observer_observer_on_callStateChange_0100 Test start *************") + observer.on('callStateChange', (data) => { + expect().assertFail() + done() + return + }) + setTimeout(timeout, 3000) + console.log("************* Telephony_observer_observer_on_callStateChange_0100 Test end *************") + done() + }) + + /* + * @tc.number : Telephony_observer_observer_on_callStateChange_0200 + * @tc.name : on_callStateChange + * @tc.desc : call the on method of callStateChange + */ + it('Telephony_observer_observer_on_callStateChange_0200', 0, async function (done) { + console.log("************* Telephony_observer_observer_on_callStateChange_0200 Test start *************") + observer.on('callStateChange', { + slotId: SLOT_0 + }, (data) => { + expect().assertFail() + done() + return + }) + setTimeout(timeout, 3000) + console.log("************* Telephony_observer_observer_on_callStateChange_0200 Test end *************") + done() + }) + + /* + * @tc.number : Telephony_observer_observer_off_callStateChange_0100 + * @tc.name : off_callStateChange + * @tc.desc : call the off method of callStateChange + */ + it('Telephony_observer_observer_off_callStateChange_0100', 0, async function (done) { + console.log("************* Telephony_observer_observer_off_callStateChange_0100 Test start *************") + observer.off('callStateChange', (data) => { + expect().assertFail() + done() + return + }) + setTimeout(timeout, 3000) + console.log("************* Telephony_observer_observer_off_callStateChange_0100 Test end *************") + done() + }) + + /* + * @tc.number : Telephony_observer_observer_on_simStateChange_0100 + * @tc.name : on_simStateChange + * @tc.desc : call the on method of simStateChange + */ + it('Telephony_observer_observer_on_simStateChange_0100', 0, async function (done) { + console.log("************* Telephony_observer_observer_on_simStateChange_0100 Test start *************") + observer.on('simStateChange', (data) => { + expect().assertFail() + done() + return + }) + setTimeout(timeout, 3000) + console.log("************* Telephony_observer_observer_on_simStateChange_0100 Test end *************") + done() + }) + + /* + * @tc.number : Telephony_observer_observer_on_simStateChange_0200 + * @tc.name : on_simStateChange + * @tc.desc : call the on method of simStateChange + */ + it('Telephony_observer_observer_on_simStateChange_0200', 0, async function (done) { + console.log("************* Telephony_observer_observer_on_simStateChange_0200 Test start *************") + observer.on('simStateChange', { + slotId: SLOT_0 + }, (data) => { + expect().assertFail() + done() + return + }) + setTimeout(timeout, 3000) + console.log("************* Telephony_observer_observer_on_simStateChange_0200 Test end *************") + done() + }) + + /* + * @tc.number : Telephony_observer_observer_off_simStateChange_0100 + * @tc.name : off_simStateChange + * @tc.desc : call the off method of simStateChange + */ + it('Telephony_observer_observer_off_simStateChange_0100', 0, async function (done) { + console.log("************* Telephony_observer_observer_off_simStateChange_0100 Test start *************") + observer.off('simStateChange', (data) => { + expect().assertFail() + done() + return + }) + setTimeout(timeout, 3000) + console.log("************* Telephony_observer_observer_off_simStateChange_0100 Test end *************") + done() + }) + + /* + * @tc.number : Telephony_observer_SimStateData_type_0100 + * @tc.name : type + * @tc.desc : check the type value of SimStateData object + */ + it('Telephony_observer_SimStateData_type_0100', 0, function (done) { + console.log("************* Telephony_observer_SimStateData_type_0100 Test start *************") + const unknown: SimStateData = { + type: sim.CardType.UNKNOWN_CARD + } + expect(-1).assertEqual(unknown.type) + + const singleMode: SimStateData = { + type: sim.CardType.SINGLE_MODE_SIM_CARD + } + expect(10).assertEqual(singleMode.type) + + const singleModeUSim: SimStateData = { + type: sim.CardType.SINGLE_MODE_USIM_CARD + } + expect(20).assertEqual(singleModeUSim.type) + done() + console.log("************* Telephony_observer_SimStateData_type_0100 Test end *************") + }) + + /* + * @tc.number : Telephony_observer_SimStateData_type_0200 + * @tc.name : type + * @tc.desc : check the type value of SimStateData object + */ + it('Telephony_observer_SimStateData_type_0200', 0, function (done) { + console.log("************* Telephony_observer_SimStateData_type_0200 Test start *************") + const singleModeRUim: SimStateData = { + type: sim.CardType.SINGLE_MODE_RUIM_CARD + } + expect(30).assertEqual(singleModeRUim.type) + + const dualModeCG: SimStateData = { + type: sim.CardType.DUAL_MODE_CG_CARD + } + expect(40).assertEqual(dualModeCG.type) + + const ctNationalRoaming: SimStateData = { + type: sim.CardType.CT_NATIONAL_ROAMING_CARD + } + expect(41).assertEqual(ctNationalRoaming.type) + done() + console.log("************* Telephony_observer_SimStateData_type_0200 Test end *************") + }) + + /* + * @tc.number : Telephony_observer_SimStateData_type_0300 + * @tc.name : type + * @tc.desc : check the type value of SimStateData object + */ + it('Telephony_observer_SimStateData_type_0300', 0, function (done) { + console.log("************* Telephony_observer_SimStateData_type_0300 Test start *************") + const cuDualMode: SimStateData = { + type: sim.CardType.CU_DUAL_MODE_CARD + } + expect(42).assertEqual(cuDualMode.type) + + const dualModeTelecomLte: SimStateData = { + type: sim.CardType.DUAL_MODE_TELECOM_LTE_CARD + } + expect(43).assertEqual(dualModeTelecomLte.type) + + const dualModeUg: SimStateData = { + type: sim.CardType.DUAL_MODE_UG_CARD + } + expect(50).assertEqual(dualModeUg.type) + + const singleModeIsim: SimStateData = { + type: sim.CardType.SINGLE_MODE_ISIM_CARD + } + expect(60).assertEqual(singleModeIsim.type) + done() + console.log("************* Telephony_observer_SimStateData_type_0300 Test end *************") + }) + + /* + * @tc.number : Telephony_observer_SimStateData_state_0100 + * @tc.name : state + * @tc.desc : check the state value of SimStateData object + */ + it('Telephony_observer_SimStateData_state_0100', 0, function (done) { + console.log("************* Telephony_observer_SimStateData_state_0100 Test start *************") + const unknown: SimStateData = { + state: sim.SimState.SIM_STATE_UNKNOWN + } + expect(0).assertEqual(unknown.state) + const notPresent: SimStateData = { + state: sim.SimState.SIM_STATE_NOT_PRESENT + } + expect(1).assertEqual(notPresent.state) + done() + console.log("************* Telephony_observer_SimStateData_state_0100 Test end *************") + }) + + /* + * @tc.number : Telephony_observer_SimStateData_state_0200 + * @tc.name : state + * @tc.desc : check the state value of SimStateData object + */ + it('Telephony_observer_SimStateData_state_0200', 0, function (done) { + console.log("************* Telephony_observer_SimStateData_state_0200 Test start *************") + const locked: SimStateData = { + state: sim.SimState.SIM_STATE_LOCKED + } + expect(2).assertEqual(locked.state) + const notReady: SimStateData = { + state: sim.SimState.SIM_STATE_NOT_READY + } + expect(3).assertEqual(notReady.state) + done() + console.log("************* Telephony_observer_SimStateData_state_0200 Test end *************") + }) + + /* + * @tc.number : Telephony_observer_SimStateData_state_0300 + * @tc.name : state + * @tc.desc : check the state value of SimStateData object + */ + it('Telephony_observer_SimStateData_state_0300', 0, function (done) { + console.log("************* Telephony_observer_SimStateData_state_0300 Test start *************") + const ready: SimStateData = { + state: sim.SimState.SIM_STATE_READY + } + expect(4).assertEqual(ready.state) + const loaded: SimStateData = { + state: sim.SimState.SIM_STATE_LOADED + } + expect(5).assertEqual(loaded.state) + done() + console.log("************* Telephony_observer_SimStateData_state_0300 Test end *************") + }) + + /* + * @tc.number : Telephony_observer_LockReason_SIM_NONE_0100 + * @tc.name : SIM_NONE + * @tc.desc : check the SIM_NONE property of LockReason + */ + it('Telephony_observer_LockReason_SIM_NONE_0100', 0, function (done) { + console.log("************* Telephony_observer_LockReason_SIM_NONE_0100 Test start *************") + if (utils.notCheck) { + expect(true).assertTrue() + done() + } + // expect(0).assertEqual(LockReason.SIM_NONE) + done() + console.log("************* Telephony_observer_LockReason_SIM_NONE_0100 Test end *************") + }) + + /* + * @tc.number : Telephony_observer_LockReason_SIM_PN_PUK_0100 + * @tc.name : SIM_PN_PUK + * @tc.desc : check the SIM_PN_PUK property of LockReason + */ + it('Telephony_observer_LockReason_SIM_PN_PUK_0100', 0, function (done) { + console.log("************* Telephony_observer_LockReason_SIM_PN_PUK_0100 Test start *************") + if (utils.notCheck) { + expect(true).assertTrue() + done() + } + // expect(4).assertEqual(LockReason.SIM_PN_PUK) + done() + console.log("************* Telephony_observer_LockReason_SIM_PN_PUK_0100 Test end *************") + }) + + /* + * @tc.number : Telephony_observer_LockReason_SIM_PU_PIN_0100 + * @tc.name : SIM_PU_PIN + * @tc.desc : check the SIM_PU_PIN property of LockReason + */ + it('Telephony_observer_LockReason_SIM_PU_PIN_0100', 0, function (done) { + console.log("************* Telephony_observer_LockReason_SIM_PU_PIN_0100 Test start *************") + if (utils.notCheck) { + expect(true).assertTrue() + done() + } + // expect(5).assertEqual(LockReason.SIM_PU_PIN) + done() + console.log("************* Telephony_observer_LockReason_SIM_PU_PIN_0100 Test end *************") + }) + + /* + * @tc.number : Telephony_observer_LockReason_SIM_PU_PUK_0100 + * @tc.name : SIM_PU_PUK + * @tc.desc : check the SIM_PU_PUK property of LockReason + */ + it('Telephony_observer_LockReason_SIM_PU_PUK_0100', 0, function (done) { + console.log("************* Telephony_observer_LockReason_SIM_PU_PUK_0100 Test start *************") + if (utils.notCheck) { + expect(true).assertTrue() + done() + } + // expect(6).assertEqual(LockReason.SIM_PU_PUK) + done() + console.log("************* Telephony_observer_LockReason_SIM_PU_PUK_0100 Test end *************") + }) + + /* + * @tc.number : Telephony_observer_LockReason_SIM_PP_PIN_0100 + * @tc.name : SIM_PP_PIN + * @tc.desc : check the SIM_PP_PIN property of LockReason + */ + it('Telephony_observer_LockReason_SIM_PP_PIN_0100', 0, function (done) { + console.log("************* Telephony_observer_LockReason_SIM_PP_PIN_0100 Test start *************") + if (utils.notCheck) { + expect(true).assertTrue() + done() + } + // expect(7).assertEqual(LockReason.SIM_PP_PIN) + done() + console.log("************* Telephony_observer_LockReason_SIM_PP_PIN_0100 Test end *************") + }) + + /* + * @tc.number : Telephony_observer_LockReason_SIM_PP_PUK_0100 + * @tc.name : SIM_PP_PUK + * @tc.desc : check the SIM_PP_PUK property of LockReason + */ + it('Telephony_observer_LockReason_SIM_PP_PUK_0100', 0, function (done) { + console.log("************* Telephony_observer_LockReason_SIM_PP_PUK_0100 Test start *************") + if (utils.notCheck) { + expect(true).assertTrue() + done() + } + // expect(8).assertEqual(LockReason.SIM_PP_PUK) + done() + console.log("************* Telephony_observer_LockReason_SIM_PP_PUK_0100 Test end *************") + }) + + /* + * @tc.number : Telephony_observer_LockReason_SIM_PC_PIN_0100 + * @tc.name : SIM_PC_PIN + * @tc.desc : check the SIM_PC_PIN property of LockReason + */ + it('Telephony_observer_LockReason_SIM_PC_PIN_0100', 0, function (done) { + console.log("************* Telephony_observer_LockReason_SIM_PC_PIN_0100 Test start *************") + if (utils.notCheck) { + expect(true).assertTrue() + done() + } + // expect(9).assertEqual(LockReason.SIM_PC_PIN) + done() + console.log("************* Telephony_observer_LockReason_SIM_PC_PIN_0100 Test end *************") + }) + + /* + * @tc.number : Telephony_observer_LockReason_SIM_PC_PUK_0100 + * @tc.name : SIM_PC_PUK + * @tc.desc : check the SIM_PC_PUK property of LockReason + */ + it('Telephony_observer_LockReason_SIM_PC_PUK_0100', 0, function (done) { + console.log("************* Telephony_observer_LockReason_SIM_PC_PUK_0100 Test start *************") + if (utils.notCheck) { + expect(true).assertTrue() + done() + } + // expect(10).assertEqual(LockReason.SIM_PC_PUK) + done() + console.log("************* Telephony_observer_LockReason_SIM_PC_PUK_0100 Test end *************") + }) + + /* + * @tc.number : Telephony_observer_LockReason_SIM_SIM_PIN_0100 + * @tc.name : SIM_SIM_PIN + * @tc.desc : check the SIM_SIM_PIN property of LockReason + */ + it('Telephony_observer_LockReason_SIM_SIM_PIN_0100', 0, function (done) { + console.log("************* Telephony_observer_LockReason_SIM_SIM_PIN_0100 Test start *************") + if (utils.notCheck) { + expect(true).assertTrue() + done() + } + // expect(11).assertEqual(LockReason.SIM_SIM_PIN) + done() + console.log("************* Telephony_observer_LockReason_SIM_SIM_PIN_0100 Test end *************") + }) + + /* + * @tc.number : Telephony_observer_LockReason_SIM_SIM_PUK_0100 + * @tc.name : SIM_SIM_PUK + * @tc.desc : check the SIM_SIM_PUK property of LockReason + */ + it('Telephony_observer_LockReason_SIM_SIM_PUK_0100', 0, function (done) { + console.log("************* Telephony_observer_LockReason_SIM_SIM_PUK_0100 Test start *************") + if (utils.notCheck) { + expect(true).assertTrue() + done() + } + // expect(12).assertEqual(LockReason.SIM_SIM_PUK) + done() + console.log("************* Telephony_observer_LockReason_SIM_SIM_PUK_0100 Test end *************") + }) + + function timeout(done) { + expect(true).assertTrue() + console.debug('Observer Test=========timeout========'); + done() + } + + console.log("************* Observer Test end *************") + }) +} + + + diff --git a/telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/test/RadioJsunit.test.ets b/telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/test/RadioJsunit.test.ets new file mode 100644 index 000000000..a6222c025 --- /dev/null +++ b/telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/test/RadioJsunit.test.ets @@ -0,0 +1,302 @@ +// @ts-nocheck +/** + * 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 {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index' +import radio from '@ohos.telephony.radio'; +import utils from './Utils.ets' + +export default function radioJsunit() { + describe('ActsNetworkSearchTest',function () { + + const SLOT_2 = -1; + const SLOT_0 = 0; + + /** + * @tc.number Telephony_NetworkSearch_getMEID_Async_0100 + * @tc.name Test getMEID(-1) to view the callback result + * @tc.desc Function test + */ + it('Telephony_NetworkSearch_getMEID_Async_0100', 0, async function (done) { + if(utils.notCheck){ + done(); + return; + } + radio.getMEID(SLOT_2, (err, data) => { + if (err) { + console.log(`Telephony_NetworkSearch_getMEID_Async_0100 fail: ${err}`); + expect().assertFail(); + done(); + return; + } + console.log(`Telephony_NetworkSearch_getMEID_Async_0100 end data: ${data}`); + expect(data === '').assertTrue(); + done(); + }); + }); + + /** + * @tc.number Telephony_NetworkSearch_getMEID_Promise_0100 + * @tc.name Test getMEID(-1) to check the callback result + * @tc.desc FunctigetMEIDon test + */ + it('Telephony_NetworkSearch_getMEID_Promise_0100', 0, async function (done) { + if(utils.notCheck){ + done(); + return; + } + radio.getMEID(SLOT_2).then(data => { + console.log(`Telephony_NetworkSearch_getMEID_Promise_0100 end data: ${data}`); + expect(data === '').assertTrue(); + done(); + }).catch(err => { + console.log(`Telephony_NetworkSearch_getMEID_Promise_0100 fail: ${err}`); + expect().assertFail(); + done(); + }) + }); + + /** + * @tc.number Telephony_NetworkSearch_getPrimarySlotId_Async_0200 + * @tc.name Test getPrimarySlotId(-1) to check the callback result + * @tc.desc Function test + */ + it('Telephony_NetworkSearch_getPrimarySlotId_Async_0200', 0, async function (done) { + if(utils.notCheck){ + done(); + return; + } + radio.getPrimarySlotId((err, data) => { + if (err) { + console.log(`Telephony_NetworkSearch_getPrimarySlotId_Async_0200 fail: ${err}`); + expect(data === undefined).assertTrue(); + done(); + return; + } + console.log(`Telephony_NetworkSearch_getPrimarySlotId_Async_0200 end data: ${data}`); + expect(data === '').assertTrue(); + done(); + }); + }); + + /** + * @tc.number Telephony_NetworkSearch_setPrimarySlotId_Async_0300 + * @tc.name Test The function setPrimarySlotId(0) + * @tc.desc Function test + */ + it('Telephony_NetworkSearch_setPrimarySlotId_Async_0300', 0, async function (done) { + if(utils.notCheck){ + done(); + return; + } + radio.setPrimarySlotId(SLOT_0, (err, data) => { + if (err) { + console.log(`Telephony_NetworkSearch_setPrimarySlotId_Async_0300 fail: ${err}`); + expect(data === undefined).assertTrue(); + done(); + return; + } + console.log(`Telephony_NetworkSearch_setPrimarySlotId_Async_0300 end data: ${data}`); + expect(data === '').assertTrue(); + done(); + }); + }); + + /** + * @tc.number Telephony_NetworkSearch_setPrimarySlotId_Async_0300 + * @tc.name Test The function setPrimarySlotId(0) + * @tc.desc Function test + */ + it('Telephony_NetworkSearch_setPrimarySlotId_Promise_0300', 0, async function (done) { + if(utils.notCheck){ + done(); + return; + } + try { + await radio.setPrimarySlotId(SLOT_0); + console.log('Telephony_NetworkSearch_setPrimarySlotId_Promise_0300 success'); + done(); + } catch (err) { + console.log(`Telephony_NetworkSearch_setPrimarySlotId_Promiss_0300 fail ${err}`); + done(); + } + }); + + /** + * @tc.number Telephony_NetworkSearch_isNrSupported_Promise_0400 + * @tc.name Test The function setPrimarySlotId(0) + * @tc.desc Function test + */ + it('Telephony_NetworkSearch_isNrSupported_Promise_0400', 0, async function (done) { + if(utils.notCheck){ + done(); + return; + } + try { + await radio.isNrSupported(SLOT_0); + console.log('radio.isNrSupported(SLOT_0) = ' + radio.isNrSupported(SLOT_0)); + console.log('Telephony_NetworkSearch_isNrSupported_Promise_0400 success'); + done(); + } catch (err) { + console.log(`Telephony_NetworkSearch_isNrSupported_Promise_0400 fail ${err}`); + done(); + } + }); + + /** + * @tc.number Telephony_radio_PreferredNetworkMode_0500 + * @tc.name Test The PreferredNetworkMode enum + * @tc.desc Function test + */ + it('Telephony_radio_PreferredNetworkMode_0500', 0, async function (done) { + console.info("Telephony_radio_PreferredNetworkMode_0500 start") + if(utils.notCheck){ + done(); + return; + } + expect(PreferredNetworkMode.PREFERRED_NETWORK_MODE_WCDMA === 2).assertTrue(); + expect(PreferredNetworkMode.PREFERRED_NETWORK_MODE_LTE === 3).assertTrue(); + expect(PreferredNetworkMode.PREFERRED_NETWORK_MODE_LTE_WCDMA === 4).assertTrue(); + expect(PreferredNetworkMode.PREFERRED_NETWORK_MODE_LTE_WCDMA_GSM === 5).assertTrue(); + expect(PreferredNetworkMode.PREFERRED_NETWORK_MODE_WCDMA_GSM === 6).assertTrue(); + console.info("Telephony_radio_PreferredNetworkMode_0500 end") + done(); + }); + + /** + * @tc.number Telephony_radio_PreferredNetworkMode_0600 + * @tc.name Test The PreferredNetworkMode enum + * @tc.desc Function test + */ + it('Telephony_radio_PreferredNetworkMode_0600', 0, async function (done) { + if(utils.notCheck){ + done(); + return; + } + console.info("Telephony_radio_PreferredNetworkMode_0600 start") + expect(PreferredNetworkMode.PREFERRED_NETWORK_MODE_CDMA === 7).assertTrue(); + expect(PreferredNetworkMode.PREFERRED_NETWORK_MODE_EVDO === 8).assertTrue(); + expect(PreferredNetworkMode.PREFERRED_NETWORK_MODE_EVDO_CDMA === 9).assertTrue(); + expect(PreferredNetworkMode.PREFERRED_NETWORK_MODE_WCDMA_GSM_EVDO_CDMA === 10).assertTrue(); + expect(PreferredNetworkMode.PREFERRED_NETWORK_MODE_LTE_EVDO_CDMA === 11).assertTrue(); + console.info("Telephony_radio_PreferredNetworkMode_0600 end") + done(); + }); + + /** + * @tc.number Telephony_radio_PreferredNetworkMode_0700 + * @tc.name Test The PreferredNetworkMode enum + * @tc.desc Function test + */ + it('Telephony_radio_PreferredNetworkMode_0700', 0, async function (done) { + if(utils.notCheck){ + done(); + return; + } + console.info("Telephony_radio_PreferredNetworkMode_0700 start") + expect(PreferredNetworkMode.PREFERRED_NETWORK_MODE_LTE_WCDMA_GSM_EVDO_CDMA === 12).assertTrue(); + expect(PreferredNetworkMode.PREFERRED_NETWORK_MODE_TDSCDMA === 13).assertTrue(); + expect(PreferredNetworkMode.PREFERRED_NETWORK_MODE_TDSCDMA_GSM === 14).assertTrue(); + expect(PreferredNetworkMode.PREFERRED_NETWORK_MODE_TDSCDMA_WCDMA === 15).assertTrue(); + expect(PreferredNetworkMode.PREFERRED_NETWORK_MODE_TDSCDMA_WCDMA_GSM === 16).assertTrue(); + console.info("Telephony_radio_PreferredNetworkMode_0700 end") + done(); + }); + + /** + * @tc.number Telephony_radio_PreferredNetworkMode_0800 + * @tc.name Test The PreferredNetworkMode enum + * @tc.desc Function test + */ + it('Telephony_radio_PreferredNetworkMode_0800', 0, async function (done) { + if(utils.notCheck){ + done(); + return; + } + console.info("Telephony_radio_PreferredNetworkMode_0800 start") + expect(PreferredNetworkMode.PREFERRED_NETWORK_MODE_LTE_TDSCDMA === 17).assertTrue(); + expect(PreferredNetworkMode.PREFERRED_NETWORK_MODE_LTE_TDSCDMA_GSM === 18).assertTrue(); + expect(PreferredNetworkMode.PREFERRED_NETWORK_MODE_LTE_TDSCDMA_WCDMA === 19).assertTrue(); + expect(PreferredNetworkMode.PREFERRED_NETWORK_MODE_LTE_TDSCDMA_WCDMA_GSM === 20).assertTrue(); + expect(PreferredNetworkMode.PREFERRED_NETWORK_MODE_TDSCDMA_WCDMA_GSM_EVDO_CDMA ===21).assertTrue(); + console.info("Telephony_radio_PreferredNetworkMode_0800 end") + done(); + }); + + /** + * @tc.number Telephony_radio_PreferredNetworkMode_0900 + * @tc.name Test The PreferredNetworkMode enum + * @tc.desc Function test + */ + it('Telephony_radio_PreferredNetworkMode_0900', 0, async function (done) { + if(utils.notCheck){ + done(); + return; + } + console.info("Telephony_radio_PreferredNetworkMode_0900 start") + expect(PreferredNetworkMode.PREFERRED_NETWORK_MODE_LTE_TDSCDMA === 17).assertTrue(); + expect(PreferredNetworkMode.PREFERRED_NETWORK_MODE_LTE_TDSCDMA_GSM === 18).assertTrue(); + expect(PreferredNetworkMode.PREFERRED_NETWORK_MODE_LTE_TDSCDMA_WCDMA === 19).assertTrue(); + expect(PreferredNetworkMode.PREFERRED_NETWORK_MODE_LTE_TDSCDMA_WCDMA_GSM === 20).assertTrue(); + expect(PreferredNetworkMode.PREFERRED_NETWORK_MODE_TDSCDMA_WCDMA_GSM_EVDO_CDMA ===21).assertTrue(); + console.info("Telephony_radio_PreferredNetworkMode_0900 end") + done(); + }); + + /** + * @tc.number Telephony_radio_PreferredNetworkMode_1000 + * @tc.name Test The PreferredNetworkMode enum + * @tc.desc Function test + */ + it('Telephony_radio_PreferredNetworkMode_1000', 0, async function (done) { + if(utils.notCheck){ + done(); + return; + } + console.info("Telephony_radio_PreferredNetworkMode_1000 start") + expect(PreferredNetworkMode.PREFERRED_NETWORK_MODE_LTE_TDSCDMA_WCDMA_GSM_EVDO_CDMA === 22).assertTrue(); + expect(PreferredNetworkMode.PREFERRED_NETWORK_MODE_NR === 31).assertTrue(); + expect(PreferredNetworkMode.PREFERRED_NETWORK_MODE_NR_LTE === 32).assertTrue(); + expect(PreferredNetworkMode.PREFERRED_NETWORK_MODE_NR_LTE_WCDMA === 33).assertTrue(); + expect(PreferredNetworkMode.PREFERRED_NETWORK_MODE_NR_LTE_WCDMA_GSM ===34).assertTrue(); + console.info("Telephony_radio_PreferredNetworkMode_1000 end") + done(); + }); + + /** + * @tc.number Telephony_radio_PreferredNetworkMode_1100 + * @tc.name Test The PreferredNetworkMode enum + * @tc.desc Function test + */ + it('Telephony_radio_PreferredNetworkMode_1100', 0, async function (done) { + if(utils.notCheck){ + done(); + return; + } + console.info("Telephony_radio_PreferredNetworkMode_1100 start") + expect(PreferredNetworkMode.PREFERRED_NETWORK_MODE_NR_LTE_EVDO_CDMA === 35).assertTrue(); + expect(PreferredNetworkMode.PREFERRED_NETWORK_MODE_NR_LTE_WCDMA_GSM_EVDO_CDMA === 36).assertTrue(); + expect(PreferredNetworkMode.PREFERRED_NETWORK_MODE_NR_LTE_TDSCDMA === 37).assertTrue(); + expect(PreferredNetworkMode.PREFERRED_NETWORK_MODE_NR_LTE_TDSCDMA_GSM === 38).assertTrue(); + expect(PreferredNetworkMode.PREFERRED_NETWORK_MODE_NR_LTE_TDSCDMA_WCDMA ===39).assertTrue(); + expect(PreferredNetworkMode.PREFERRED_NETWORK_MODE_NR_LTE_TDSCDMA_WCDMA_GSM === 40).assertTrue(); + expect(PreferredNetworkMode.PREFERRED_NETWORK_MODE_NR_LTE_TDSCDMA_WCDMA_GSM_EVDO_CDMA === 41).assertTrue(); + expect(PreferredNetworkMode.PREFERRED_NETWORK_MODE_MAX_VALUE === 99).assertTrue(); + console.info("Telephony_radio_PreferredNetworkMode_1100 end") + done(); + }); + + }) +} \ No newline at end of file diff --git a/telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/test/RadioSecondJsunit.test.ets b/telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/test/RadioSecondJsunit.test.ets new file mode 100644 index 000000000..d1de270b2 --- /dev/null +++ b/telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/test/RadioSecondJsunit.test.ets @@ -0,0 +1,209 @@ +// @ts-nocheck +/** + * 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 {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "deccjsunit/index.ets"; +import radio from '@ohos.telephony.radio'; +import utils from './Utils.ets' + +export default function radioSecondJsunit() { + describe('radioSecondTest', function () { + const NROPTION_MODE = [ + radio.NR_OPTION_UNKNOWN, + radio.NR_OPTION_NSA_ONLY, + radio.NR_OPTION_SA_ONLY, + radio.NR_OPTION_NSA_AND_SA + ]; + //Network status + let garrNetworkState = [ + radio.NETWORK_UNKNOWN, + radio.NETWORK_AVAILABLE, + radio.NETWORK_CURRENT, + radio.NETWORK_FORBIDDEN, + ]; + //NetworkRadioTech + let garrNetworkRadioTech = [ + 'UNKNOWN', 'GSM', '1XRTT', 'WCDMA', + 'HSPA', 'HSPAP', 'TD_SCDMA', 'EVDO', + 'EHRPD', 'LTE', 'LTE_CA', 'IWLAN', 'NR']; + + const SLOT_0 = 0; + const SLOT_1 = 5; + const SLOT_2 = 2; + const SLOT_3 = -1; + const NETWORK_TYPES = [ + radio.NETWORK_TYPE_UNKNOWN, + radio.NETWORK_TYPE_GSM, + radio.NETWORK_TYPE_CDMA, + radio.NETWORK_TYPE_WCDMA, + radio.NETWORK_TYPE_TDSCDMA, + radio.NETWORK_TYPE_LTE, + radio.NETWORK_TYPE_NR, + ]; + const NETWORK_SIGNAL = [0, 1, 2, 3, 4, 5]; + const CELL_LAC_TAC_MAX = 0xffff; + const CELL_CELLID_MAX = 0xfffffff; + const CELL_GSM_CELLID_MAX = 0xffff; + const CELL_ARFCN_MAX = 1023; + const CELL_EARFCN_MAX = 41589; + const CELL_BSIC_MAX = 63; + const CELL_PSC_MAX = 511; + const CELL_PCI_MAX = 503; + const CELL_MCC = 460; + const CELL_MNC_MAX = 20; + const CELL_INFO_MIN = 0; + const TIME_RADIO_TURNON = 10000; + console.log("************* radio Test start*************"); + it('Telephony_NetworkSearch_getCellInformation_Async_0100', 0, async function (done) { + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + radio.getCellInformation((err, data) => { + if (err) { + console.log(`Telephony_NetworkSearch_getCellInformation_Async_0100 fail: ${err}`); + expect().assertFail(); + done(); + return; + } + console.log(`Telephony_NetworkSearch_getCellInformation_Async_0100 end data: ${JSON.stringify(data)}`); + if (true) { + console.log(`Telephony_NetworkSearch_getCellInformation_Async_0100 1`); + expect(true).assertTrue(); + done(); + return; + } else { + assertCellInformation(data); + done(); + } + }); + }); + + /** + * @tc.number Telephony_NetworkSearch_getNrOptionMode_Async_0100 + * @tc.name Test getNrOptionMode() to check the callback result + * @tc.desc Function test + */ + it('Telephony_NetworkSearch_getNrOptionMode_Async_0100', 0, async function (done) { + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + radio.getNrOptionMode((err, data) => { + if (err) { + console.log(`Telephony_NetworkSearch_getNrOptionMode_Async_0100 get fail err: ${err}`); + expect().assertFail(); + done(); + return; + } + console.log(`Telephony_NetworkSearch_getNrOptionMode_Async_0100 end data: ${JSON.stringify(data)}`); + if (true) { + console.log(`Telephony_NetworkSearch_getNrOptionMode_Async_0100 1`); + expect(true).assertTrue(); + done(); + return; + } else { + expect(NROPTION_MODE).assertContain(data); + done(); + } + }); + }) + + /** + * @tc.number Telephony_NetworkSearch_getNetworkSearchInformation_Async_0100 + * @tc.name Test the getNetworkSearchInformation() query function and set the slotId parameter input to 0, + * test the return value isNetworkSearchSuccess is true and specific operator information + * @tc.desc Function test + */ + it('Telephony_NetworkSearch_getNetworkSearchInformation_Async_0100', 0, async function (done) { + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + radio.getNetworkSearchInformation(SLOT_0, (err, data) => { + if (err) { + console.log(`Telephony_NetworkSearch_getNetworkSearchInformation_Async_0100 fail err: ${err}`); + expect().assertFail(); + done(); + return; + } + if (true){ + console.log(`Telephony_NetworkSearch_getNetworkSearchInformation_Async_0100 1`); + expect(true).assertTrue(); + done(); + return; + } + expect(data != null && data != undefined).assertTrue(); + if (data.networkSearchResult.length === 0) { + console.log('Telephony_NetworkSearch_getNetworkSearchInformation_Async_0100 fail'); + expect().assertFail(); + done(); + return; + } + console.log( + `Telephony_NetworkSearch_getNetworkSearchInformation_Async_0100 finish data: ${JSON.stringify(data)}`); + expect(data.isNetworkSearchSuccess).assertTrue(); + expect( + data.networkSearchResult[0].operatorName != undefined && + data.networkSearchResult[0].operatorName != '' && + data.networkSearchResult[0].operatorName != null + ).assertTrue(); + expect(garrNetworkState).assertContain(data.networkSearchResult[0].state); + expect(garrNetworkRadioTech).assertContain(data.networkSearchResult[0].radioTech); + expect(data.networkSearchResult[0].operatorNumeric.substr(0, 3) === '460').assertTrue(); + done(); + }); + }); + console.log("************* radio Test end*************"); + function assertCellInformation(data) { + expect(data !== '' && data != undefined && data != null).assertTrue(); + expect(data.length).assertLarger(0); + for (let i = 0; i < data.length; i++) { + expect(NETWORK_TYPES).assertContain(data[i].networkType); + expect(data[i].isCamped).assertTrue(); + expect(data[i].timeStamp).assertLarger(0); + expect(NETWORK_TYPES).assertContain(data[i].signalInformation.signalType); + expect(NETWORK_SIGNAL).assertContain(data[i].signalInformation.signalLevel); + expect(data[i].data != undefined && data[i].data != '' && data[i].data != null).assertTrue(); + if (data[0].networkType === radio.NETWORK_TYPE_LTE) { + expect(data[i].data.tac >= CELL_INFO_MIN && data[i].data.tac <= CELL_LAC_TAC_MAX).assertTrue(); + expect(data[i].data.cgi >= CELL_INFO_MIN && data[i].data.cgi <= CELL_CELLID_MAX).assertTrue(); + expect(data[i].data.earfcn >= CELL_INFO_MIN && data[i].data.earfcn <= CELL_EARFCN_MAX).assertTrue(); + expect(data[i].data.pci >= CELL_INFO_MIN && data[i].data.pci <= CELL_PCI_MAX).assertTrue(); + expect(data[i].data.mnc >= CELL_INFO_MIN && data[i].data.mnc <= CELL_MNC_MAX).assertTrue(); + expect(data[i].data.mcc).assertEqual(CELL_MCC); + } else if (data[i].networkType === radio.NETWORK_TYPE_WCDMA) { + expect(data[i].data.lac >= CELL_INFO_MIN && data[i].data.lac <= CELL_LAC_TAC_MAX).assertTrue(); + expect(data[i].data.cellId >= CELL_INFO_MIN && data[i].data.cellId <= CELL_CELLID_MAX).assertTrue(); + expect(data[i].data.uarfcn >= CELL_INFO_MIN && data[i].data.uarfcn <= CELL_ARFCN_MAX).assertTrue(); + expect(data[i].data.psc >= CELL_INFO_MIN && data[i].data.psc <= CELL_PSC_MAX).assertTrue(); + expect(data[i].data.mnc >= CELL_INFO_MIN && data[i].data.mnc <= CELL_MNC_MAX).assertTrue(); + expect(data[i].data.mcc).assertEqual(CELL_MCC); + } else if (data[i].networkType === radio.NETWORK_TYPE_GSM) { + expect(data[i].data.lac >= CELL_INFO_MIN && data[i].data.lac <= CELL_LAC_TAC_MAX).assertTrue(); + expect(data[i].data.cellId >= CELL_INFO_MIN && data[i].data.cellId <= CELL_GSM_CELLID_MAX).assertTrue(); + expect(data[i].data.arfcn >= CELL_INFO_MIN && data[i].data.arfcn <= CELL_ARFCN_MAX).assertTrue(); + expect(data[i].data.bsic >= CELL_INFO_MIN && data[i].data.bsic <= CELL_BSIC_MAX).assertTrue(); + expect(data[i].data.mnc >= CELL_INFO_MIN && data[i].data.mnc <= CELL_MNC_MAX).assertTrue(); + expect(data[i].data.mcc).assertEqual(CELL_MCC); + } else { + expect().assertFail(); + } + } + } + }) +} diff --git a/telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/test/SimJsunit.test.ets b/telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/test/SimJsunit.test.ets new file mode 100644 index 000000000..7707cc9d7 --- /dev/null +++ b/telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/test/SimJsunit.test.ets @@ -0,0 +1,164 @@ +// @ts-nocheck +/** + * 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 {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "deccjsunit/index.ets"; +import sim from '@ohos.telephony.sim'; +import * as env from './lib/Const.js'; +import utils from './Utils.ets' +export default function simJsunit() { + describe('appInfoTest', function () { + console.log("************* sim Test start*************"); + /** + * @tc.number Telephony_Sim_getOperatorConfigs_Async_0100 + * @tc.name The slotId parameter is 0 and the OperatorConfig structure is not expected to be empty + * @tc.desc Function test + */ + it('Telephony_Sim_getOperatorConfigs_Async_0100', 0, async function (done) { + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + console.log('Telephony_Sim_getOperatorConfigs_Async_0100 start'); + let containerIsEmpty = 0; + sim.getOperatorConfigs(env.DEFAULT_SLOTID, (err, data) => { + console.log('Telephony_Sim_getOperatorConfigs_Async_0100 result'); + if (err) { + console.log(`Telephony_Sim_getOperatorConfigs_Async_0100 fail, err : ${err.message}`); + done(); + return; + } + expect(Object.keys(data).length !== containerIsEmpty).assertTrue(); + console.log('Telephony_Sim_getOperatorConfigs_Async_0100 finish'); + done(); + }); + }); + + /** + * @tc.number Telephony_Sim_getSimAccountInfo_Async_0100 + * @tc.name Get the return value by calling the GetSimAccountInfo interface SIM ID input parameter 0. + * @tc.desc Function test + */ + it('Telephony_Sim_getSimAccountInfo_Async_0100', 0, async function (done) { + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + const CASE_NAME = 'Telephony_Sim_getSimAccountInfo_Async_0100'; + let iccIdValue; + sim.getSimAccountInfo(env.DEFAULT_SLOTID, (err, info) => { + if (err) { + console.log(`${CASE_NAME} fail ,err : ${err.message}`); + done(); + return; + } + console.log(`${CASE_NAME} getSimAccountInfo: ${JSON.stringify(info)}`); + expect(info.slotIndex === env.DEFAULT_SLOTID + && info.isEsim === false + && info.isActive === true + && info.iccId === iccIdValue + && info.showName === env.SIM_SLOT_NAME + && info.showNumber === env.SIM_SLOT_NUMBER + ).assertTrue(); + console.log(`${CASE_NAME} finish`); + done(); + }); + }); + /** + * @tc.number Telephony_Sim_unlockPin_Async_0100 + * @tc.name Test the unlockPin interface when the card status is ready state. + * @tc.desc Function test + */ + it('Telephony_Sim_unlockPin_Async_0100', 0, async function (done) { + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + let PIN = '1234'; + sim.unlockPin(env.DEFAULT_SLOTID, PIN, (err, data) => { + if (err) { + console.log(`Telephony_Sim_unlockPin_Async_0100 fail, err: ${err.message}`); + done(); + return; + } + expect(data.result === env.OTHER_ABNORMAL).assertTrue(); + console.log('Telephony_Sim_unlockPin_Async_0100 finish'); + done(); + }); + }); + /** + * @tc.number Telephony_Sim_addIccDiallingNumbers_Async_0100 + * @tc.name Test sim.addIccDiallingNumbers(soltId: -1, type: 1, diallingNumbers: + * {recordNumber: 1, alphaTag: 'test', number: '12345678', pin2: '123@#ABCD'}, + * callback: AsyncCallback) async callback interface, expect enter error. + * @tc.desc Function test + */ + const CONTACT_INFO = { 'recordNumber': 1, 'alphaTag': 'test', 'number': '12345678' }; + const GENERAL_CONTACT_INFO = Object.assign({}, { 'pin2': env.INCORRECT_PIN2 }, CONTACT_INFO); + it('Telephony_Sim_addIccDiallingNumbers_Async_0100', 0, async function (done) { + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + const CASE_NAME = 'Telephony_Sim_addIccDiallingNumbers_Async_0100'; + sim.addIccDiallingNumbers(env.SLOTID_MINUS1, + sim.GENERAL_CONTACT, + GENERAL_CONTACT_INFO, + error => { + if (error) { + console.log(`${CASE_NAME} expect error: ${error.message}`); + console.log(`${CASE_NAME} finish.`); + } else { + console.log(`${CASE_NAME} test fail.`); + expect().assertFail(); + } + done(); + }); + }); + /** + * @tc.number Telephony_Sim_SetLockState_Async_0100 + * @tc.name Test the SetLockState async callback interface to open the PIN lock and check the callback value + * @tc.desc Function test + */ + it('Telephony_Sim_SetLockState_Async_0100', 0, async function (done) { + const CASE_NAME = 'Telephony_Sim_SetLockState_Async_0100'; + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + const lockInfo = { lockType: sim.PIN_LOCK, state: sim.LOCK_ON, password: env.CORRECT_PIN }; + await setPinLockState(sim.LOCK_OFF); + sim.setLockState(env.DEFAULT_SLOTID, lockInfo, (error, lockStatusResponse) => { + if (error) { + console.log(`${CASE_NAME} setLockState error: ${error.message}`); + expect().assertFail(); + done(); + return; + } + if (lockStatusResponse.result !== env.LOCK_RESULT.SUCCESS) { + console.log(`${CASE_NAME} setLockState failure, lock status response: ${lockStatusResponse.result}`); + expect().assertFail(); + done(); + return; + } + }); + }); + console.log("************* sim Test end*************"); + }) +} diff --git a/telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/test/SmsMmsJsunit.test.ets b/telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/test/SmsMmsJsunit.test.ets new file mode 100644 index 000000000..70df080ef --- /dev/null +++ b/telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/test/SmsMmsJsunit.test.ets @@ -0,0 +1,892 @@ +// @ts-nocheck +/** + * 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 {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "deccjsunit/index.ets"; +import mms from '@ohos.telephony.sms'; +import utils from './Utils.ets' +export default function smsUiJsunit() { + describe('appInfoTest', function () { + /** + * @tc.number Telephony_SmsMms_encodeMms_Async_0100 + * @tc.name SendReq type MMS, encoding after decoding, the content after decoding and coding before the same + * @tc.desc Function test + */ + it('Telephony_SmsMms_encodeMms_Async_0100', 0, async function (done) { + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + let mmsType = { + "from": { + address: '+861381234****/TYPE=PLMN', charset: mms.UTF_8 + }, + to: [{ + address: '+861388888****/TYPE=PLMN', charset: mms.UTF_8 + }], + transactionId: '2077.1427358451410', + version: mms.MMS_VERSION_1_2, + date: 1639378126, + cc: [{ + address: "+861381111****/TYPE=PLMN", charset: mms.UTF_8 + }], + bcc: [{ + address: "+861382222****/TYPE=PLMN", charset: mms.UTF_8 + }], + subject: "Test mms", + messageClass: 130, + expiry: 1639378126, + priority: mms.MMS_LOW, + senderVisibility: 129, + deliveryReport: 128, + readReport: 129, + contentType: "application/vnd.wap.multipart.related", + }; + let attachment = [ + { + path: '/data/telephony/enSrc/content.text', + fileName: 'content.text', + contentId: '', + contentLocation: 'content.text', + contentDisposition: mms.FROM_DATA, + contentTransferEncoding: 'base64', + contentType: 'text/plain', + isSmil: false, + inBuff: [], + charset: mms.UTF_8 + }, + { + path: '/data/telephony/enSrc/618C0A89.smil', + fileName: '618C0A89.smil', + contentId: '<0000>', + contentLocation: '618C0A89.smil', + contentDisposition: mms.ATTACHMENT, + contentTransferEncoding: 'base64', + contentType: 'application/smil', + isSmil: true, + inBuff: [], + charset: mms.UTF_8 + }, + { + path: '/data/telephony/enSrc/picture.gif', + fileName: 'picture.gif', + contentId: '', + contentLocation: 'picture.gif', + contentDisposition: mms.INLINE, + contentTransferEncoding: 'base64', + contentType: 'image/gif', + isSmil: false, + inBuff: [], + charset: mms.UTF_8 + }]; + + mms.encodeMms({ + messageType: mms.TYPE_MMS_SEND_REQ, mmsType, attachment + }, (err, encodeData) => { + if (err) { + console.log('Telephony_SmsMms_encodeMms_Async_0100 encodeMms fail'); + done(); + return; + } + console.log('Telephony_SmsMms_encodeMms_Async_0100 encodeMms finish'); + mms.decodeMms(encodeData, (err, data) => { + if (err) { + console.log('Telephony_SmsMms_encodeMms_Async_0100 fail'); + done(); + return; + } + expect(data.messageType === mms.TYPE_MMS_SEND_REQ).assertTrue(); + expect(data.mmsType.from.address === '+861381234****/TYPE=PLMN').assertTrue(); + expect(data.mmsType.from.charset === mms.UTF_8).assertTrue(); + expect(data.mmsType.to.length > 0).assertTrue(); + expect(data.mmsType.to[0].address === '+861388888****/TYPE=PLMN').assertTrue(); + expect(data.mmsType.to[0].charset === mms.UTF_8).assertTrue(); + expect(data.mmsType.transactionId === '2077.1427358451410').assertTrue(); + expect(data.mmsType.version === mms.MMS_VERSION_1_2).assertTrue(); + expect(data.mmsType.date > 0).assertTrue(); + expect(data.mmsType.cc.length > 0).assertTrue(); + expect(data.mmsType.cc[0].address === '+861381111****/TYPE=PLMN').assertTrue(); + expect(data.mmsType.cc[0].charset === mms.UTF_8).assertTrue(); + expect(data.mmsType.bcc.length > 0).assertTrue(); + expect(data.mmsType.bcc[0].address === '+861382222****/TYPE=PLMN').assertTrue(); + expect(data.mmsType.bcc[0].charset === mms.UTF_8).assertTrue(); + expect(data.mmsType.subject === 'Test mms').assertTrue(); + expect(data.mmsType.messageClass === 130).assertTrue(); + expect(data.mmsType.expiry !== 0).assertTrue(); + expect(data.mmsType.priority === mms.MMS_LOW).assertTrue(); + expect(data.mmsType.senderVisibility === 129).assertTrue(); + expect(data.mmsType.deliveryReport === 128).assertTrue(); + expect(data.mmsType.readReport === 129).assertTrue(); + expect(data.mmsType.contentType === 'application/vnd.wap.multipart.related').assertTrue(); + if (data.attachment != null) { + expect(data.attachment.length > 0).assertTrue(); + expect(data.attachment[0].path === '').assertTrue(); + expect(data.attachment[0].fileName === '618C0A89.smil').assertTrue(); + expect(data.attachment[0].contentId === '<0000>').assertTrue(); + expect(data.attachment[0].contentLocation === '618C0A89.smil').assertTrue(); + expect(data.attachment[0].contentDisposition === mms.ATTACHMENT).assertTrue(); + expect(data.attachment[0].contentTransferEncoding === 'base64').assertTrue(); + expect(data.attachment[0].contentType === 'application/smil').assertTrue(); + expect(data.attachment[0].isSmil).assertTrue(); + expect(data.attachment[0].inBuff.length > 0).assertTrue(); + expect(data.attachment[0].charset === mms.UTF_8).assertTrue(); + expect(data.attachment[1].path === '').assertTrue(); + expect(data.attachment[1].fileName === 'content.text').assertTrue(); + expect(data.attachment[1].contentId === '').assertTrue(); + expect(data.attachment[1].contentLocation === 'content.text').assertTrue(); + expect(data.attachment[1].contentDisposition === mms.FROM_DATA).assertTrue(); + expect(data.attachment[1].contentTransferEncoding === 'base64').assertTrue(); + expect(data.attachment[1].contentType === 'text/plain').assertTrue(); + expect(data.attachment[1].isSmil).assertFalse(); + expect(data.attachment[1].inBuff.length > 0).assertTrue(); + expect(data.attachment[1].charset === mms.UTF_8).assertTrue(); + expect(data.attachment[2].path === '').assertTrue(); + expect(data.attachment[2].fileName === 'picture.gif').assertTrue(); + expect(data.attachment[2].contentId === '').assertTrue(); + expect(data.attachment[2].contentLocation === 'picture.gif').assertTrue(); + expect(data.attachment[2].contentDisposition === mms.INLINE).assertTrue(); + expect(data.attachment[2].contentTransferEncoding === 'base64').assertTrue(); + expect(data.attachment[2].contentType === 'image/gif').assertTrue(); + expect(data.attachment[2].isSmil).assertFalse(); + expect(data.attachment[2].inBuff.length > 0).assertTrue(); + expect(data.attachment[2].charset === mms.UTF_8).assertTrue(); + console.log('Telephony_SmsMms_encodeMms_Async_0100 finish'); + } + done(); + }); + }); + }); + + /** + * @tc.number Telephony_SmsMms_encodeMms_Async_0200 + * @tc.name SendConf type MMS, encoding after decoding, the content after decoding and coding before the same + * @tc.desc Function test + */ + it('Telephony_SmsMms_encodeMms_Async_0200', 0, async function (done) { + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + let mmsType = { + responseState: 128, + transactionId: '2077.1427358451410', + version: mms.MMS_VERSION_1_1, + messageId: '0001', + }; + mms.encodeMms({ + messageType: mms.TYPE_MMS_SEND_CONF, mmsType + }, (err, encodeData) => { + if (err) { + console.log('Telephony_SmsMms_encodeMms_Async_0200 encodeMms fail'); + done(); + return; + } + console.log('Telephony_SmsMms_encodeMms_Async_0200 encodeMms finish'); + mms.decodeMms(encodeData, (err, data) => { + if (err) { + console.log('Telephony_SmsMms_encodeMms_Async_0200 fail'); + done(); + return; + } + expect(data.messageType === mms.TYPE_MMS_SEND_CONF).assertTrue(); + expect(data.mmsType.responseState === 128).assertTrue(); + expect(data.mmsType.transactionId === '2077.1427358451410').assertTrue(); + expect(data.mmsType.version === mms.MMS_VERSION_1_1).assertTrue(); + expect(data.mmsType.messageId === '0001').assertTrue(); + console.log('Telephony_SmsMms_encodeMms_Async_0200 finish'); + done(); + }); + }); + }); + + /** + * @tc.number Telephony_SmsMms_encodeMms_Async_0300 + * @tc.name NotificationInd type MMS, encoding after decoding, + * the content after decoding and coding before the same + * @tc.desc Function test + */ + it('Telephony_SmsMms_encodeMms_Async_0300', 0, async function (done) { + let mmsType = { + transactionId: "2080.142730", + messageClass: 128, + messageSize: 12345678, + expiry: 1639378126, + version: mms.MMS_VERSION_1_3, + "from": { + address: '+861381234****/TYPE=PLMN', charset: mms.UTF_8 + }, + subject: "Test mms", + deliveryReport: 128, + contentLocation: "Test", + contentClass: 128, + }; + mms.encodeMms({ + messageType: mms.TYPE_MMS_NOTIFICATION_IND, mmsType + }, (err, encodeData) => { + if (err) { + console.log('Telephony_SmsMms_encodeMms_Async_0300 encodeMms fail'); + done(); + return; + } + console.log('Telephony_SmsMms_encodeMms_Async_0300 encodeMms finish'); + mms.decodeMms(encodeData, (err, data) => { + if (err) { + console.log('Telephony_SmsMms_encodeMms_Async_0300 fail'); + done(); + return; + } + expect(data.messageType === mms.TYPE_MMS_NOTIFICATION_IND).assertTrue(); + expect(data.mmsType.transactionId === '2080.142730').assertTrue(); + expect(data.mmsType.messageClass === 128).assertTrue(); + expect(data.mmsType.messageSize === 12345678).assertTrue(); + expect(data.mmsType.expiry !== 0).assertTrue(); + expect(data.mmsType.version === mms.MMS_VERSION_1_3).assertTrue(); + expect(data.mmsType.from.address.length > 0).assertTrue(); + expect(data.mmsType.from.charset === mms.UTF_8).assertTrue(); + expect(data.mmsType.subject === 'Test mms').assertTrue(); + expect(data.mmsType.deliveryReport === 128).assertTrue(); + expect(data.mmsType.contentLocation === 'Test').assertTrue(); + expect(data.mmsType.contentClass === 128).assertTrue(); + console.log('Telephony_SmsMms_encodeMms_Async_0300 finish'); + done(); + }); + }); + }); + + /** + * @tc.number Telephony_SmsMms_encodeMms_Async_0400 + * @tc.name NotifyRespInd type MMS, encoding after decoding,the content after decoding and coding before the same + * @tc.desc Function test + */ + it('Telephony_SmsMms_encodeMms_Async_0400', 0, async function (done) { + let mmsType = { + transactionId: '2920.1410', + status: 128, + version: mms.MMS_VERSION_1_0, + reportAllowed: mms.MMS_YES, + }; + mms.encodeMms({ + messageType: mms.TYPE_MMS_RESP_IND, mmsType + }, (err, encodeData) => { + if (err) { + console.log('Telephony_SmsMms_encodeMms_Async_0400 encodeMms fail'); + done(); + return; + } + console.log('Telephony_SmsMms_encodeMms_Async_0400 encodeMms finish'); + mms.decodeMms(encodeData, (err, data) => { + if (err) { + console.log('Telephony_SmsMms_encodeMms_Async_0400 fail'); + done(); + return; + } + expect(data.messageType === mms.TYPE_MMS_RESP_IND).assertTrue(); + expect(data.mmsType.transactionId === '2920.1410').assertTrue(); + expect(data.mmsType.status === 128).assertTrue(); + expect(data.mmsType.version === mms.MMS_VERSION_1_0).assertTrue(); + expect(data.mmsType.reportAllowed === mms.MMS_YES).assertTrue(); + console.log('Telephony_SmsMms_encodeMms_Async_0400 finish'); + done(); + }); + }); + }); + + /** + * @tc.number Telephony_SmsMms_encodeMms_Async_0500 + * @tc.name RetrieveConf type MMS, encoding after decoding, the content after decoding and coding before the same + * @tc.desc Function test + */ + it('Telephony_SmsMms_encodeMms_Async_0500', 0, async function (done) { + let mmsType = { + transactionId: "3077.142410", + messageId: "0001", + date: 1639378126, + version: mms.MMS_VERSION_1_2, + to: [{ + address: "+861388888****/TYPE=PLMN", charset: mms.UTF_8 + }], + "from": { + address: '+861381234****/TYPE=PLMN', charset: mms.UTF_8 + }, + cc: [{ + address: '+861381111****/TYPE=PLMN', charset: mms.UTF_8 + }], + subject: "Test mms", + priority: mms.MMS_HIGH, + deliveryReport: 128, + readReport: 128, + retrieveStatus: 128, + retrieveText: "0002", + contentType: "application/vnd.wap.multipart.related", + }; + mms.encodeMms({ + messageType: mms.TYPE_MMS_RETRIEVE_CONF, mmsType + }, (err, encodeData) => { + if (err) { + console.log('Telephony_SmsMms_encodeMms_Async_0500 encodeMms fail'); + done(); + return; + } + console.log('Telephony_SmsMms_encodeMms_Async_0500 encodeMms finish'); + mms.decodeMms(encodeData, (err, data) => { + if (err) { + console.log('Telephony_SmsMms_encodeMms_Async_0500 fail'); + done(); + return; + } + expect(data.messageType === mms.TYPE_MMS_RETRIEVE_CONF).assertTrue(); + expect(data.mmsType.transactionId === '3077.142410').assertTrue(); + expect(data.mmsType.messageId === '0001').assertTrue(); + expect(data.mmsType.date > 0).assertTrue(); + expect(data.mmsType.version === mms.MMS_VERSION_1_2).assertTrue(); + expect(data.mmsType.to.length > 0).assertTrue(); + expect(data.mmsType.to[0].address.length > 0).assertTrue(); + expect(data.mmsType.to[0].charset === mms.UTF_8).assertTrue(); + expect(data.mmsType.from.address.length > 0).assertTrue(); + expect(data.mmsType.from.charset === mms.UTF_8).assertTrue(); + expect(data.mmsType.cc.length > 0).assertTrue(); + expect(data.mmsType.cc[0].address.length > 0).assertTrue(); + expect(data.mmsType.cc[0].charset == mms.UTF_8).assertTrue(); + expect(data.mmsType.subject === 'Test mms').assertTrue(); + expect(data.mmsType.priority === mms.MMS_HIGH).assertTrue(); + expect(data.mmsType.deliveryReport === 128).assertTrue(); + expect(data.mmsType.readReport === 128).assertTrue(); + expect(data.mmsType.retrieveStatus === 128).assertTrue(); + expect(data.mmsType.retrieveText === '0002').assertTrue(); + expect(data.mmsType.contentType === 'application/vnd.wap.multipart.related').assertTrue(); + console.log('Telephony_SmsMms_encodeMms_Async_0500 finish'); + done(); + }); + }); + }); + + /** + * @tc.number Telephony_SmsMms_encodeMms_Async_0600 + * @tc.name AcknowledgeInd type MMS, encoding after decoding, + * the content after decoding and coding before the same + * @tc.desc Function test + */ + it('Telephony_SmsMms_encodeMms_Async_0600', 0, async function (done) { + let mmsType = { + transactionId: "27.14210", + version: mms.MMS_VERSION_1_2, + reportAllowed: mms.MMS_NO, + }; + mms.encodeMms({ + messageType: mms.TYPE_MMS_ACKNOWLEDGE_IND, mmsType + }, (err, encodeData) => { + if (err) { + console.log('Telephony_SmsMms_encodeMms_Async_0600 encodeMms fail'); + done(); + return; + } + console.log('Telephony_SmsMms_encodeMms_Async_0600 encodeMms finish'); + mms.decodeMms(encodeData, (err, data) => { + if (err) { + console.log('Telephony_SmsMms_encodeMms_Async_0600 fail'); + done(); + return; + } + expect(data.messageType === mms.TYPE_MMS_ACKNOWLEDGE_IND).assertTrue(); + expect(data.mmsType.transactionId === '27.14210').assertTrue(); + expect(data.mmsType.version === mms.MMS_VERSION_1_2).assertTrue(); + expect(data.mmsType.reportAllowed === mms.MMS_NO).assertTrue(); + console.log('Telephony_SmsMms_encodeMms_Async_0600 finish'); + done(); + }); + }); + }); + + /** + * @tc.number Telephony_SmsMms_encodeMms_Async_0700 + * @tc.name DeliveryInd type MMS, encoding after decoding, the content after decoding and coding before the same + * @tc.desc Function test + */ + it('Telephony_SmsMms_encodeMms_Async_0700', 0, async function (done) { + let mmsType = { + messageId: "0001", + date: 1639378126, + to: [{ + address: "+861388888****/TYPE=PLMN", charset: mms.UTF_8 + }], + status: 134, + version: mms.MMS_VERSION_1_2, + }; + mms.encodeMms({ + messageType: mms.TYPE_MMS_DELIVERY_IND, mmsType + }, (err, encodeData) => { + if (err) { + console.log('Telephony_SmsMms_encodeMms_Async_0700 encodeMms fail'); + done(); + return; + } + console.log('Telephony_SmsMms_encodeMms_Async_0700 encodeMms finish'); + mms.decodeMms(encodeData, (err, data) => { + if (err) { + console.log('Telephony_SmsMms_encodeMms_Async_0700 fail'); + done(); + return; + } + expect(data.messageType === mms.TYPE_MMS_DELIVERY_IND).assertTrue(); + expect(data.mmsType.messageId === '0001').assertTrue(); + expect(data.mmsType.date > 0).assertTrue(); + expect(data.mmsType.to.length > 0).assertTrue(); + expect(data.mmsType.to[0].address.length > 0).assertTrue(); + expect(data.mmsType.to[0].charset === mms.UTF_8).assertTrue(); + expect(data.mmsType.status === 134).assertTrue(); + expect(data.mmsType.version === mms.MMS_VERSION_1_2).assertTrue(); + console.log('Telephony_SmsMms_encodeMms_Async_0700 finish'); + done(); + }); + }); + }); + + /** + * @tc.number Telephony_SmsMms_encodeMms_Async_0800 + * @tc.name ReadRecInd type MMS, encoding after decoding, the content after decoding and coding before the same + * @tc.desc Function test + */ + it('Telephony_SmsMms_encodeMms_Async_0800', 0, async function (done) { + let mmsType = { + version: mms.MMS_VERSION_1_0, + messageId: "0001", + to: [{ + address: "+861388888****/TYPE=PLMN", charset: mms.UTF_8 + }], + "from": { + address: "+861381234****/TYPE=PLMN", charset: mms.UTF_8 + }, + date: 1639378126, + readStatus: 128, + }; + mms.encodeMms({ + messageType: mms.TYPE_MMS_READ_REC_IND, mmsType + }, (err, encodeData) => { + if (err) { + console.log('Telephony_SmsMms_encodeMms_Async_0800 encodeMms fail'); + done(); + return; + } + console.log('Telephony_SmsMms_encodeMms_Async_0800 encodeMms finish'); + mms.decodeMms(encodeData, (err, data) => { + if (err) { + console.log('Telephony_SmsMms_encodeMms_Async_0800 fail'); + done(); + return; + } + expect(data.messageType === mms.TYPE_MMS_READ_REC_IND).assertTrue(); + expect(data.mmsType.version === mms.MMS_VERSION_1_0).assertTrue(); + expect(data.mmsType.messageId === '0001').assertTrue(); + expect(data.mmsType.to.length > 0).assertTrue(); + expect(data.mmsType.to[0].address.length > 0).assertTrue(); + expect(data.mmsType.to[0].charset === mms.UTF_8).assertTrue(); + expect(data.mmsType.from.address.length > 0).assertTrue(); + expect(data.mmsType.from.charset === mms.UTF_8).assertTrue(); + expect(data.mmsType.readStatus === 128).assertTrue(); + expect(data.mmsType.date > 0).assertTrue(); + console.log('Telephony_SmsMms_encodeMms_Async_0800 finish'); + done(); + }); + }); + }); + + /** + * @tc.number Telephony_SmsMms_encodeMms_Async_0900 + * @tc.name ReadOrigInd type MMS, encoding after decoding, the content after decoding and coding before the same + * @tc.desc Function test + */ + it('Telephony_SmsMms_encodeMms_Async_0900', 0, async function (done) { + let mmsType = { + version: mms.MMS_VERSION_1_1, + messageId: "0001", + to: [{ + address: "+861388888****/TYPE=PLMN", charset: mms.UTF_8 + }], + "from": { + address: "+861381234****/TYPE=PLMN", charset: mms.UTF_8 + }, + readStatus: 129, + date: 1639378126, + }; + mms.encodeMms({ + messageType: mms.TYPE_MMS_READ_ORIG_IND, mmsType + }, (err, encodeData) => { + if (err) { + console.log('Telephony_SmsMms_encodeMms_Async_0900 encodeMms fail'); + done(); + return; + } + console.log('Telephony_SmsMms_encodeMms_Async_0900 encodeMms finish'); + mms.decodeMms(encodeData, (err, data) => { + if (err) { + console.log('Telephony_SmsMms_encodeMms_Async_0900 fail'); + done(); + return; + } + expect(data.messageType === mms.TYPE_MMS_READ_ORIG_IND).assertTrue(); + expect(data.mmsType.version === mms.MMS_VERSION_1_1).assertTrue(); + expect(data.mmsType.messageId === '0001').assertTrue(); + expect(data.mmsType.to.length > 0).assertTrue(); + expect(data.mmsType.to[0].address.length > 0).assertTrue(); + expect(data.mmsType.to[0].charset === mms.UTF_8).assertTrue(); + expect(data.mmsType.from.address.length > 0).assertTrue(); + expect(data.mmsType.from.charset === mms.UTF_8).assertTrue(); + expect(data.mmsType.date > 0).assertTrue(); + expect(data.mmsType.readStatus === 129).assertTrue(); + console.log('Telephony_SmsMms_encodeMms_Async_0900 finish'); + done(); + }); + }); + }); + /** + * @tc.number Telephony_SmsMms_encodeMms_Async_0900 + * @tc.name RetrieveConf type MMS, encoding after decoding, the content after decoding and coding before the same + * @tc.desc Function test + */ + it('Telephony_SmsMms_encodeMms_Async_0900', 0, async function (done) { + let mmsType = { + transactionId: "3077.142410", + messageId: "0001", + date: 1639378126, + version: mms.MMS_VERSION_1_2, + to: [{ + address: "+861388888****/TYPE=PLMN", charset: mms.UTF_8 + }], + "from": { + address: '+861381234****/TYPE=PLMN', charset: mms.UTF_8 + }, + cc: [{ + address: '+861381111****/TYPE=PLMN', charset: mms.UTF_8 + }], + subject: "Test mms", + priority: mms.MMS_NORMAL, + deliveryReport: 128, + readReport: 128, + retrieveStatus: 128, + retrieveText: "0002", + contentType: "application/vnd.wap.multipart.related", + }; + mms.encodeMms({ + messageType: mms.TYPE_MMS_RETRIEVE_CONF, mmsType + }, (err, encodeData) => { + if (err) { + console.log('Telephony_SmsMms_encodeMms_Async_0900 encodeMms fail'); + done(); + return; + } + console.log('Telephony_SmsMms_encodeMms_Async_0900 encodeMms finish'); + mms.decodeMms(encodeData, (err, data) => { + if (err) { + console.log('Telephony_SmsMms_encodeMms_Async_0500 fail'); + done(); + return; + } + expect(data.messageType === mms.TYPE_MMS_RETRIEVE_CONF).assertTrue(); + expect(data.mmsType.transactionId === '3077.142410').assertTrue(); + expect(data.mmsType.messageId === '0001').assertTrue(); + expect(data.mmsType.date > 0).assertTrue(); + expect(data.mmsType.version === mms.MMS_VERSION_1_2).assertTrue(); + expect(data.mmsType.to.length > 0).assertTrue(); + expect(data.mmsType.to[0].address.length > 0).assertTrue(); + expect(data.mmsType.to[0].charset === mms.UTF_8).assertTrue(); + expect(data.mmsType.from.address.length > 0).assertTrue(); + expect(data.mmsType.from.charset === mms.UTF_8).assertTrue(); + expect(data.mmsType.cc.length > 0).assertTrue(); + expect(data.mmsType.cc[0].address.length > 0).assertTrue(); + expect(data.mmsType.cc[0].charset == mms.UTF_8).assertTrue(); + expect(data.mmsType.subject === 'Test mms').assertTrue(); + expect(data.mmsType.priority === mms.MMS_NORMAL).assertTrue(); + expect(data.mmsType.deliveryReport === 128).assertTrue(); + expect(data.mmsType.readReport === 128).assertTrue(); + expect(data.mmsType.retrieveStatus === 128).assertTrue(); + expect(data.mmsType.retrieveText === '0002').assertTrue(); + expect(data.mmsType.contentType === 'application/vnd.wap.multipart.related').assertTrue(); + console.log('Telephony_SmsMms_encodeMms_Async_0500 finish'); + done(); + }); + }); + }); + + const SMS_SEND_DST_NUMBER = ''; + const TRUE_SLOT_ID = 0; + const FALSE_SLOT_ID = 9; + const OTHER_SLOT_ID = 1; + const SECOND_SLOT_ID = 2; + const IDENTIFIER_MIN = 0; + const IDENTIFIER_MAX = 0xFFFF; + const RANTYPE_GSM = 1; + const RANTYPE_CDMA = 2; + const RANTYPE_ERROR = 3; + var rawArray = [ + 0x08, 0x91, 0x68, 0x31, 0x08, 0x20, 0x00, 0x75, 0xF4, 0x24, 0x0D, 0x91, + 0x68, 0x81, 0x29, 0x56, 0x29, 0x83, 0xF6, 0x00, 0x00, 0x12, 0x40, 0x80, + 0x01, 0x02, 0x14, 0x23, 0x02, 0xC1, 0x30 + ] + /** + * @tc.number Telephony_SmsMms_setCBConfig_Async_0100 + * @tc.name Set "StartMessageld" to minimum(0x0000) and "EndMessageld" to minimum(0x0000) for cell broadcast, + * Configure a cell broadcast for an identity. + * @tc.desc Function test + */ + it('Telephony_SmsMms_setCBConfig_Async_0100', 0, async function (done) { + if (true) { + expect(true).assertTrue(); + done(); + return; + } + let data = { + slotId: TRUE_SLOT_ID, + enable: true, + startMessageId: IDENTIFIER_MIN, + endMessageId: IDENTIFIER_MIN, + ranType: RANTYPE_GSM + }; + sms.setCBConfig(data, (err) => { + if (err) { + expect().assertFail(); + console.log('Telephony_SmsMms_setCBConfig_Async_0100 fail'); + done(); + return; + } + console.log('Telephony_SmsMms_setCBConfig_Async_0100 finish'); + done(); + }); + }); + + /** + * @tc.number Telephony_SmsMms_getAllSimMessages_CDMA_Async_0100 + * @tc.name When SLOTID is the correct value,Query all SMS records of the SIM card. + * @tc.desc Function test + */ + it('Telephony_SmsMms_getAllSimMessages_CDMA_Async_0100', 0, async function (done) { + if (true) { + expect(true).assertTrue(); + done(); + return; + } + let data = { + slotId: TRUE_SLOT_ID, + smsc: '', + pdu: CORRECT_SMS_PDU, + status: sms.SIM_MESSAGE_STATUS_SENT + }; + sms.addSimMessage(data, (adderr) => { + if (adderr) { + expect().assertFail(); + console.log('Telephony_SmsMms_getAllSimMessages_CDMA_Async_0100 add fail'); + done(); + return; + } + console.log('Telephony_SmsMms_getAllSimMessages_CDMA_Async_0100 finish '); + sms.getAllSimMessages(TRUE_SLOT_ID, (geterr, getresult) => { + if (geterr) { + expect().assertFail(); + console.log('Telephony_SmsMms_getAllSimMessages_CDMA_Async_0100 get fail'); + done(); + return; + } + expect(getresult.length > 0).assertTrue(); + let addOfPdu = interceptionPdu(getresult[0].shortMessage.pdu); + let isAdd = (addOfPdu === CORRECT_SMS_PDU && + getresult[0].simMessageStatus === sms.SIM_MESSAGE_STATUS_SENT); + expect(isAdd).assertTrue(); + console.log('Telephony_SmsMms_getAllSimMessages_CDMA_Async_0100 getAllSimMessages cur finish'); + sms.delSimMessage(TRUE_SLOT_ID, getresult[0].indexOnSim, (delerr) => { + if (delerr) { + expect().assertFail(); + console.log('Telephony_SmsMms_getAllSimMessages_CDMA_Async_0100 del fail'); + done(); + return; + } + console.log('Telephony_SmsMms_getAllSimMessages_CDMA_Async_0100 delSimMessage finish'); + sms.getAllSimMessages(TRUE_SLOT_ID, (geterr, getresult) => { + if (geterr) { + expect().assertFail(); + console.log('Telephony_SmsMms_getAllSimMessages_CDMA_Async_0100 get 2 fail'); + done(); + return; + } + expect(getresult.length === 0).assertTrue(); + console.log('Telephony_SmsMms_getAllSimMessages_CDMA_Async_0100 getAllSimMessages cur finish'); + done(); + }); + }); + }); + }); + }); + /* + * @tc.number Telephony_SmsMms_createMessage_Async_0100 + * @tc.name Call interface CreateMessage, + * pass in the PDU(rawArray) in line with the coding specification, the specification is 3GPP, + * shortMessage Don't empty + * @tc.desc Function test + */ + it('Telephony_SmsMms_createMessage_Async_0100', 0, async function (done) { + if (true) { + expect(true).assertTrue(); + done(); + return; + } + sms.createMessage(rawArray, '3gpp', (err, shortMessage) => { + if (err) { + expect().assertFail(); + console.log('Telephony_SmsMms_createMessage_Async_0100 fail'); + done(); + return; + } + expect(shortMessage.visibleMessageBody === MESSAGEBODY).assertTrue(); + expect(shortMessage.visibleRawAddress.length === ADDR_LENGTH).assertTrue(); + expect(shortMessage.messageClass === sms.FORWARD_MESSAGE).assertTrue(); + expect(shortMessage.protocolId === 0).assertTrue(); + expect(shortMessage.scAddress.length === ADDR_LENGTH).assertTrue(); + expect(shortMessage.scTimestamp === SC_TIMESTAMP).assertTrue(); + expect(shortMessage.isReplaceMessage).assertFalse(); + expect(shortMessage.hasReplyPath).assertFalse(); + expect(shortMessage.pdu.length > 0).assertTrue(); + expect(shortMessage.status === 0).assertTrue(); + expect(shortMessage.isSmsStatusReportMessage).assertTrue(); + console.log('Telephony_SmsMms_createMessage_Async_0100 finish'); + done(); + }); + }); + + /* + * @tc.number Telephony_SmsMms_sendMessage_0100 + * @tc.name Call the interface sendMessage, set the card slot parameter "slotId" to 1, + * and send SMS successfully + * @tc.desc Function test + */ + it('Telephony_SmsMms_sendMessage_0100', 0, async function (done) { + if (true) { + expect(true).assertTrue(); + done(); + return; + } + sms.sendMessage({ + slotId: TRUE_SLOT_ID, + destinationHost: SMS_SEND_DST_NUMBER, + content: '111111', + sendCallback: (err, value) => { + if (err) { + expect().assertFail(); + console.log('Telephony_SmsMms_sendMessage_0100 sendCallback fail'); + done(); + return; + } + expect(value.result === sms.SEND_SMS_SUCCESS).assertTrue(); + console.log('Telephony_SmsMms_sendMessage_0100 sendCallback finish'); + done() + }, + deliveryCallback: (err, value) => { + if (err) { + expect().assertFail(); + console.log('Telephony_SmsMms_sendMessage_0100 deliveryCallback fail'); + done(); + return; + } + expect(value.pdu.length !== 0).assertTrue(); + console.log('Telephony_SmsMms_sendMessage_0100 deliveryCallback finish'); + done(); + } + }); + }); + /* + * @tc.number Telephony_SmsMms_getSmsSegmentsInfo_Async_0100 + * @tc.name set message to plain Chinese with a length of MAX_CHINESE_MESSAGE_LENTH(63) characters, + * and view the result + * @tc.desc Function test + */ + it('Telephony_SmsMms_getSmsSegmentsInfo_Async_0100', 0, async function (done) { + if (true) { + expect(true).assertTrue(); + done(); + return; + } + let message = ''; + for (let index = 0;index < MAX_CHINESE_MESSAGE_LENTH; index++) { + message += '中'; + } + let force7BitCode = true; + sms.getSmsSegmentsInfo(TRUE_SLOT_ID, message, force7BitCode, (error, result) => { + if (error) { + console.log("Telephony_SmsMms_getSmsSegmentsInfo_Async_0100 getSmsSegmentsInfoon error " + error.message); + console.log('Telephony_SmsMms_getSmsSegmentsInfo_Async_0100 fail'); + expect().assertFail(); + } else { + console.log("Telephony_SmsMms_getSmsSegmentsInfo_Async_0100 splitCount " + result.splitCount); + console.log("Telephony_SmsMms_getSmsSegmentsInfo_Async_0100 encodeCount " + result.encodeCount); + console.log("Telephony_SmsMms_getSmsSegmentsInfo_Async_0100 encodeCountRemaining " + + result.encodeCountRemaining); + console.log("Telephony_SmsMms_getSmsSegmentsInfo_Async_0100 scheme " + result.scheme); + + expect(result.splitCount === DIVIDE_MESSAGE_INTO_1).assertTrue(); + expect(result.encodeCount === MAX_CHINESE_MESSAGE_LENTH).assertTrue(); + let remaining = result.splitCount * MAX_CHAR_MESSAGE_LENTH - result.encodeCount; + console.log("Telephony_SmsMms_getSmsSegmentsInfo_Async_0100 remaining " + remaining); + expect(result.encodeCountRemaining === remaining).assertTrue(); + expect(result.scheme === sms.SMS_ENCODING_7BIT).assertTrue(); + console.log('Telephony_SmsMms_getSmsSegmentsInfo_Async_0100 finish'); + } + done(); + }); + }); + /* + * @tc.number Telephony_SmsMms_getSmsEncodingScheme_Async_0100 + * @tc.name + * @tc.desc Function test + */ + it('Telephony_SmsMms_getSmsEncodingScheme_Async_0100', 0, async function (done) { + if (true) { + expect(true).assertTrue(); + done(); + return; + } + expect(sms.SmsEncodingScheme == 0).assertTrue(); + expect(sms.SMS_ENCODING_7BIT == 1).assertTrue(); + expect(sms.SMS_ENCODING_8BIT == 2).assertTrue(); + expect(sms.SMS_ENCODING_16BIT == 3).assertTrue(); + done(); + }); + + /* + * @tc.number Telephony_SmsMms_getMmsCharSets_Async_0100 + * @tc.name + * @tc.desc Function test + */ + it('Telephony_SmsMms_getMmsCharSets_Async_0100', 0, async function (done) { + if (true) { + expect(true).assertTrue(); + done(); + return; + } + expect(sms.BIG5 == 0X07EA).assertTrue(); + expect(sms.ISO_10646_UCS_2 == 0X03E8).assertTrue(); + expect(sms.ISO_8859_1 == 0X04).assertTrue(); + expect(sms.ISO_8859_2 == 0X05).assertTrue(); + expect(sms.ISO_8859_3 == 0X06).assertTrue(); + expect(sms.ISO_8859_4 == 0X07).assertTrue(); + expect(sms.ISO_8859_5 == 0X08).assertTrue(); + expect(sms.ISO_8859_6 == 0X09).assertTrue(); + expect(sms.ISO_8859_7 == 0X10).assertTrue(); + expect(sms.ISO_8859_8 == 0X12).assertTrue(); + expect(sms.ISO_8859_9 == 0X13).assertTrue(); + expect(sms.SHIFT_JIS == 0X11).assertTrue(); + expect(sms.US_ASCII == 0X03).assertTrue(); + expect(sms.UTF_8 == 0X6A).assertTrue(); + done(); + }); + }) +} diff --git a/telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/test/StatisticsJsunit.test.ets b/telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/test/StatisticsJsunit.test.ets new file mode 100644 index 000000000..1e8992107 --- /dev/null +++ b/telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/test/StatisticsJsunit.test.ets @@ -0,0 +1,1383 @@ +// @ts-nocheck +/** + * 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 {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "deccjsunit/index.ets"; +import statistics from '@ohos.net.statistics'; +import utils from './Utils.ets' +export default function statisticsUiJsunit() { + describe('appInfoTest', function () { + const DATA_0 = 0; + + /** + * @tc.number Telephony_statistics_getCellularRxBytes_Async_0100 + * @tc.name The APP calls getCellularRxBytes() and gets traffic successfully (>=DATA_0). + * @tc.desc Function test + */ + it('Telephony_statistics_getCellularRxBytes_Async_0100', 0, async function (done) { + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + let caseName = 'Telephony_statistics_getCellularRxBytes_Async_0100'; + console.log(`${caseName} done`); + statistics.getCellularRxBytes((err, data) => { + if (err) { + console.log(`${caseName} get data fail: ${err.message} ${err.code}`); + done(); + } + console.log(`${caseName} get data: ${data.message} + ${data.code}`); + expect(data.code >= DATA_0).assertTrue(); + done(); + }); + }); + + /** + * @tc.number Telephony_statistics_getCellularRxBytes_Promise_0100 + * @tc.name The APP calls getCellularRxBytes() and gets traffic successfully (>=DATA_0). + * @tc.desc Function test + */ + it('Telephony_statistics_getCellularRxBytes_Promise_0100', 0, async function (done) { + let caseName = 'Telephony_statistics_getCellularRxBytes_Promise_0100'; + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + statistics.getCellularRxBytes().then((data) => { + console.log(`${caseName} get data = ${data.message}:${ data.code}`); + expect(data.code >= DATA_0).assertTrue(); + done(); + }).catch((err) => { + console.log(`${caseName} get data fail: ${err.message} ${err.code}`); + done(); + }); + }); + + /** + * @tc.number Telephony_statistics_getCellularTxBytes_Async_0100 + * @tc.name The APP calls getCellularTxBytes() and gets traffic successfully (>=DATA_0). + * @tc.desc Function test + */ + it('Telephony_statistics_getCellularTxBytes_Async_0100', 0, async function (done) { + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + let caseName = 'Telephony_statistics_getCellularTxBytes_Async_0100'; + statistics.getCellularTxBytes((err, data) => { + if (err) { + console.log(`${caseName} get data fail: ${err.message} ${err.code}`); + done(); + } + console.log(`${caseName} get data: ${data.message} + ${data.code}`); + expect(data.code >= DATA_0).assertTrue(); + done(); + }); + }); + + /** + * @tc.number Telephony_statistics_getCellularTxBytes_Promise_0100 + * @tc.name The APP calls getCellularTxBytes() and gets traffic successfully (>=DATA_0). + * @tc.desc Function test + */ + it('Telephony_statistics_getCellularTxBytes_Promise_0100', 0, async function (done) { + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + let caseName = 'Telephony_statistics_getCellularTxBytes_Promise_0100'; + statistics.getCellularTxBytes().then((data) => { + console.log(`${caseName} get data: ${data.message} + ${data.code}`); + expect(data.code >= DATA_0).assertTrue(); + done(); + }).catch((err) => { + console.log(`${caseName} get data fail: ${err.message} ${err.code}`); + done(); + }); + }); + + /** + * @tc.number Telephony_statistics_getUidRxBytes_Async_0100 + * @tc.name The APP calls getUidRxBytes() and gets traffic successfully (>=DATA_0). + * @tc.desc Function test + */ + it('Telephony_statistics_getUidRxBytes_Async_0100', 0, async function (done) { + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + let caseName = 'Telephony_statistics_getUidRxBytess_Async_0100'; + statistics.getUidRxBytes(1,(err, data) => { + if (err) { + console.log(`${caseName} get data fail: ${err.message} ${err.code}`); + done(); + } + console.log(`${caseName} get data: ${data.message} + ${data.code}`); + expect(data.message == 'successful').assertTrue(); + done(); + }); + }); + + /** + * @tc.number Telephony_statistics_getUidRxBytes_Promise_0100 + * @tc.name The APP calls getUidRxBytes() and gets traffic successfully (>=DATA_0). + * @tc.desc Function test + */ + it('Telephony_statistics_getUidRxBytes_Promise_0100', 0, async function (done) { + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + let caseName = 'Telephony_statistics_getUidRxBytes_Promise_0100'; + statistics.getUidRxBytes(1).then((data) => { + console.log(`${caseName} get data: ${data.message} + ${data.code}`); + expect(data.message == 'successful').assertTrue(); + done(); + }).catch((err) => { + console.log(`${caseName} get data fail: ${err.message} ${err.code}`); + done(); + }); + }); + + /** + * @tc.number Telephony_statistics_getUidTxBytes_Async_0100 + * @tc.name The APP calls getUidTxBytes and gets traffic successfully (>=DATA_0). + * @tc.desc Function test + */ + it('Telephony_statistics_getUidTxBytes_Async_0100', 0, async function (done) { + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + let caseName = 'Telephony_statistics_getUidTxBytes_Async_0100'; + statistics.getUidTxBytes(1,(err, data) => { + if (err) { + console.log(`${caseName} get data fail: ${err.message} ${err.code}`); + done(); + } + console.log(`${caseName} get data: ${data.message} + ${data.code}`); + expect(data.message == 'successful').assertTrue(); + done(); + }); + }); + /** + * @tc.number Telephony_statistics_getUidTxBytess_Promise_0100 + * @tc.name The APP calls getUidTxBytes() and gets traffic successfully (>=DATA_0). + * @tc.desc Function test + */ + it('Telephony_statistics_getUidTxBytes_Promise_0100', 0, async function (done) { + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + let caseName = 'Telephony_statistics_getUidTxBytes_Promise_0100'; + statistics.getUidTxBytes(1).then((data) => { + console.log(`${caseName} get data: ${data.message} + ${data.code}`); + expect(data.message == 'successful').assertTrue(); + done(); + }).catch((err) => { + console.log(`${caseName} get data fail: ${err.message} ${err.code}`); + done(); + }); + }); + + + /** + * @tc.number Telephony_statistics_getIfaceRxBytes_Async_0100 + * @tc.name Set the network interface to cellular, + * call getIfaceRxBytes() and get the traffic value successfully (>=DATA_0). + * @tc.desc Function test + */ + it('Telephony_statistics_getIfaceRxBytes_Async_0100', 0, async function (done) { + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + let caseName = 'Telephony_statistics_getIfaceRxBytes_Async_0100'; + let ifaceName = "usb0"; + statistics.getIfaceRxBytes(ifaceName, (err, data) => { + if (err) { + console.log(`${caseName} get data fail: ${err.message} ${err.code}`); + done(); + } + console.log(`${caseName} get data: ${data.message} + ${data.code}`); + expect(data.code >= DATA_0).assertTrue(); + done(); + }); + }); + + /** + * @tc.number Telephony_statistics_getIfaceRxBytes_Async_0200 + * @tc.name Set network interface to WIFI network interface, + * call getIfaceRxBytes(), successfully obtain traffic value (>=DATA_0) + * @tc.desc Function test + */ + it('Telephony_statistics_getIfaceRxBytes_Async_0200', 0, async function (done) { + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + let caseName = 'Telephony_statistics_getIfaceRxBytes_Async_0200'; + let ifaceName = "wlan0"; + statistics.getIfaceRxBytes(ifaceName, (err, data) => { + if (err) { + console.log(`${caseName} get data fail: ${err.message} ${err.code}`); + done(); + } + console.log(`${caseName} get data: ${data.message} + ${data.code}`); + expect(data.code >= DATA_0).assertTrue(); + done(); + }); + }); + + /** + * @tc.number Telephony_statistics_getIfaceRxBytes_Async_0300 + * @tc.name Set the network interface to an Ethernet interface, + * call getIfaceRxBytes(), and get the traffic value successfully (>=DATA_0). + * @tc.desc Function test + */ + it('Telephony_statistics_getIfaceRxBytes_Async_0300', 0, async function (done) { + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + let caseName = 'Telephony_statistics_getIfaceRxBytes_Async_0300'; + let ifaceName = "eth0"; + statistics.getIfaceRxBytes(ifaceName, (err, data) => { + if (err) { + console.log(`${caseName} get data fail: ${err.message} ${err.code}`); + done(); + } + console.log(`${caseName} get data: ${data.message} + ${data.code}`); + expect(data.code >= DATA_0).assertTrue(); + done(); + }); + }); + + /** + * @tc.number Telephony_statistics_getIfaceRxBytes_Async_0400 + * @tc.name Set the network interface to a nonexistent one, call getIfaceRxBytes(), + * and get a traffic value of DATA_0 + * @tc.desc Function test + */ + it('Telephony_statistics_getIfaceRxBytes_Async_0400', 0, async function (done) { + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + let caseName = 'Telephony_statistics_getIfaceRxBytes_Async_0400'; + let ifaceName = "xlan0"; + statistics.getIfaceRxBytes(ifaceName, (err, data) => { + if (err) { + console.log(`${caseName} get data fail: ${err.message} ${err.code}`); + done(); + } + console.log(`${caseName} get data: ${data.message} + ${data.code}`); + expect(data.code == DATA_0).assertTrue(); + done(); + }); + }); + + /** + * @tc.number Telephony_statistics_getIfaceRxBytes_Promise_0100 + * @tc.name Set the network interface to cellular, + * call getIfaceRxBytes() and get the traffic value successfully (>=DATA_0). + * @tc.desc Function test + */ + it('Telephony_statistics_getIfaceRxBytes_Promise_0100', 0, async function (done) { + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + let caseName = 'Telephony_statistics_getIfaceRxBytes_Promise_0100'; + let ifaceName = "usb0"; + statistics.getIfaceRxBytes(ifaceName).then((data) => { + console.log(`${caseName} get data: ${data.message} + ${data.code}`); + expect(data.code >= DATA_0).assertTrue(); + done(); + }).catch((err) => { + console.log(`${caseName} get data fail: ${err.message} ${err.code}`); + done(); + }); + }); + + /** + * @tc.number Telephony_statistics_getIfaceRxBytes_Promise_0200 + * @tc.name Set network interface to WIFI network interface, + * call getIfaceRxBytes(), successfully obtain traffic value (>=DATA_0) + * @tc.desc Function test + */ + it('Telephony_statistics_getIfaceRxBytes_Promise_0200', 0, async function (done) { + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + let caseName = 'Telephony_statistics_getIfaceRxBytes_Promise_0200'; + let ifaceName = "wlan0"; + statistics.getIfaceRxBytes(ifaceName).then((data) => { + console.log(`${caseName} get data: ${data.message} + ${data.code}`); + expect(data.code >= DATA_0).assertTrue(); + done(); + }).catch((err) => { + console.log(`${caseName} get data fail: ${err.message} ${err.code}`); + done(); + }); + }); + + /** + * @tc.number Telephony_statistics_getIfaceRxBytes_Promise_0300 + * @tc.name Set the network interface to an Ethernet interface, + * call getIfaceRxBytes(), and get the traffic value successfully (>=DATA_0). + * @tc.desc Function test + */ + it('Telephony_statistics_getIfaceRxBytes_Promise_0300', 0, async function (done) { + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + let caseName = 'Telephony_statistics_getIfaceRxBytes_Promise_0300'; + let ifaceName = "eth0"; + statistics.getIfaceRxBytes(ifaceName).then((data) => { + console.log(`${caseName} get data: ${data.message} + ${data.code}`); + expect(data.code >= DATA_0).assertTrue(); + done(); + }).catch((err) => { + console.log(`${caseName} get data fail: ${err.message} ${err.code}`); + done(); + }); + }); + + /** + * @tc.number Telephony_statistics_getIfaceRxBytes_Promise_0400 + * @tc.name Set the network interface to a nonexistent one, call getIfaceRxBytes(), + * and get a traffic value of DATA_0 + * @tc.desc Function test + */ + it('Telephony_statistics_getIfaceRxBytes_Promise_0400', 0, async function (done) { + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + let caseName = 'Telephony_statistics_getIfaceRxBytes_Promise_0400'; + let ifaceName = "xlan0"; + statistics.getIfaceRxBytes(ifaceName).then((data) => { + console.log(`${caseName} get data: ${data.message} + ${data.code}`); + expect(data.code == DATA_0).assertTrue(); + done(); + }).catch((err) => { + console.log(`${caseName} get data fail: ${err.message} ${err.code}`); + done(); + }); + }); + + /** + * @tc.number Telephony_statistics_getIfaceTxBytes_Async_0100 + * @tc.name Set the network interface to cellular, + * call getIfaceTxBytes() and get the traffic value successfully (>=DATA_0). + * @tc.desc Function test + */ + it('Telephony_statistics_getIfaceTxBytes_Async_0100', 0, async function (done) { + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + let caseName = 'Telephony_statistics_getIfaceTxBytes_Async_0100'; + let ifaceName = "usb0"; + statistics.getIfaceTxBytes(ifaceName, (err, data) => { + if (err) { + console.log(`${caseName} get data fail: ${err.message} ${err.code}`); + done(); + } + console.log(`${caseName} get data: ${data.message} + ${data.code}`); + expect(data.code >= DATA_0).assertTrue(); + done(); + }); + }); + + /** + * @tc.number Telephony_statistics_getIfaceTxBytes_Async_0200 + * @tc.name Set network interface to WIFI network interface, + * call getIfaceTxBytes(), successfully obtain traffic value (>=DATA_0) + * @tc.desc Function test + */ + it('Telephony_statistics_getIfaceTxBytes_Async_0200', 0, async function (done) { + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + let caseName = 'Telephony_statistics_getIfaceTxBytes_Async_0200'; + let ifaceName = "wlan0"; + statistics.getIfaceTxBytes(ifaceName, (err, data) => { + if (err) { + console.log(`${caseName} get data fail: ${err.message} ${err.code}`); + done(); + } + console.log(`${caseName} get data: ${data.message} + ${data.code}`); + expect(data.code >= DATA_0).assertTrue(); + done(); + }); + }); + + /** + * @tc.number Telephony_statistics_getIfaceTxBytes_Async_0300 + * @tc.name Set the network interface to an Ethernet interface, + * call getIfaceTxBytes(), and get the traffic value successfully (>=DATA_0). + * @tc.desc Function test + */ + it('Telephony_statistics_getIfaceTxBytes_Async_0300', 0, async function (done) { + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + let caseName = 'Telephony_statistics_getIfaceTxBytes_Async_0300'; + let ifaceName = "eth0"; + statistics.getIfaceTxBytes(ifaceName, (err, data) => { + if (err) { + console.log(`${caseName} get data fail: ${err.message} ${err.code}`); + done(); + } + console.log(`${caseName} get data: ${data.message} + ${data.code}`); + expect(data.code >= DATA_0).assertTrue(); + done(); + }); + }); + + /** + * @tc.number Telephony_statistics_getIfaceTxBytes_Async_0400 + * @tc.name Set the network interface to a nonexistent one, call getIfaceTxBytes(), + * and get a traffic value of DATA_0 + * @tc.desc Function test + */ + it('Telephony_statistics_getIfaceTxBytes_Async_0400', 0, async function (done) { + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + let caseName = 'Telephony_statistics_getIfaceTxBytes_Async_0400'; + let ifaceName = "xlan0"; + statistics.getIfaceTxBytes(ifaceName, (err, data) => { + if (err) { + console.log(`${caseName} get data fail: ${err.message} ${err.code}`); + done(); + } + console.log(`${caseName} get data: ${data.message} + ${data.code}`); + expect(data.code == DATA_0).assertTrue(); + done(); + }); + }); + + /** + * @tc.number Telephony_statistics_getIfaceTxBytes_Promise_0100 + * @tc.name Set the network interface to cellular, + * call getIfaceTxBytes() and get the traffic value successfully (>=DATA_0). + * @tc.desc Function test + */ + it('Telephony_statistics_getIfaceTxBytes_Promise_0100', 0, async function (done) { + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + let caseName = 'Telephony_statistics_getIfaceTxBytes_Promise_0100'; + let ifaceName = "usb0"; + statistics.getIfaceTxBytes(ifaceName).then((data) => { + console.log(`${caseName} get data: ${data.message} + ${data.code}`); + expect(data.code >= DATA_0).assertTrue(); + done(); + }).catch((err) => { + console.log(`${caseName} get data fail: ${err.message} ${err.code}`); + done(); + }); + }); + + /** + * @tc.number Telephony_statistics_getIfaceTxBytes_Promise_0200 + * @tc.name Set network interface to WIFI network interface, + * call getIfaceTxBytes(), successfully obtain traffic value (>=DATA_0) + * @tc.desc Function test + */ + it('Telephony_statistics_getIfaceTxBytes_Promise_0200', 0, async function (done) { + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + let caseName = 'Telephony_statistics_getIfaceTxBytes_Promise_0200'; + let ifaceName = "wlan0"; + statistics.getIfaceTxBytes(ifaceName).then((data) => { + console.log(`${caseName} get data: ${data.message} + ${data.code}`); + expect(data.code >= DATA_0).assertTrue(); + done(); + }).catch((err) => { + console.log(`${caseName} get data fail: ${err.message} ${err.code}`); + done(); + }); + }); + + /** + * @tc.number Telephony_statistics_getIfaceTxBytes_Promise_0300 + * @tc.name Set the network interface to an Ethernet interface, + * call getIfaceTxBytes(), and get the traffic value successfully (>=DATA_0). + * @tc.desc Function test + */ + it('Telephony_statistics_getIfaceTxBytes_Promise_0300', 0, async function (done) { + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + let caseName = 'Telephony_statistics_getIfaceTxBytes_Promise_0300'; + let ifaceName = "eth0"; + statistics.getIfaceTxBytes(ifaceName).then((data) => { + console.log(`${caseName} get data: ${data.message} + ${data.code}`); + expect(data.code >= DATA_0).assertTrue(); + done(); + }).catch((err) => { + console.log(`${caseName} get data fail: ${err.message} ${err.code}`); + done(); + }); + }); + + /** + * @tc.number Telephony_statistics_getIfaceTxBytes_Promise_0400 + * @tc.name Set the network interface to a nonexistent one, call getIfaceTxBytes(), + * and get a traffic value of DATA_0 + * @tc.desc Function test + */ + it('Telephony_statistics_getIfaceTxBytes_Promise_0400', 0, async function (done) { + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + let caseName = 'Telephony_statistics_getIfaceTxBytes_Promise_0400'; + let ifaceName = "xlan0"; + statistics.getIfaceTxBytes(ifaceName).then((data) => { + console.log(`${caseName} get data: ${data.message} + ${data.code}`); + expect(data.code == DATA_0).assertTrue(); + done(); + }).catch((err) => { + console.log(`${caseName} get data fail: ${err.message} ${err.code}`); + done(); + }); + }); + + /** + * @tc.number Telephony_statistics_getAllRxBytes_Async_0100 + * @tc.name Call getAllRxBytes() and get traffic successfully (>=DATA_0) + * @tc.desc Function test + */ + it('Telephony_statistics_getAllRxBytes_Async_0100', 0, async function (done) { + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + let caseName = 'Telephony_statistics_getAllRxBytes_Async_0100'; + statistics.getAllRxBytes((err, data) => { + if (err) { + console.log(`${caseName} get data fail: ${err.message} ${err.code}`); + done(); + } + console.log(`${caseName} get data: ${data.message} + ${data.code}`); + expect(data.code >= DATA_0).assertTrue(); + done(); + }); + }); + + /** + * @tc.number Telephony_statistics_getAllRxBytes_Promise_0100 + * @tc.name Call getAllRxBytes() and get traffic successfully (>=DATA_0) + * @tc.desc Function test + */ + it('Telephony_statistics_getAllRxBytes_Promise_0100', 0, async function (done) { + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + let caseName = 'Telephony_statistics_getAllRxBytes_Promise_0100'; + statistics.getAllRxBytes().then((data) => { + console.log(`${caseName} get data = ${data.message} + ${data.code}`); + expect(data.code >= DATA_0).assertTrue(); + done(); + }).catch((err) => { + console.log(`${caseName} get erro = ` + err); + console.log(`${caseName} get data fail: ${err.message} ${err.code}`); + done(); + }); + }); + + /** + * @tc.number Telephony_statistics_getAllRxBytes_Async_0100 + * @tc.name Call getAllTxBytes() and get traffic successfully (>=DATA_0) + * @tc.desc Function test + */ + it('Telephony_statistics_getAllTxBytes_Async_0100', 0, async function (done) { + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + let caseName = 'Telephony_statistics_getAllTxBytes_Async_0100'; + statistics.getAllTxBytes((err, data) => { + if (err) { + console.log(`${caseName} get data fail: ${err.message} ${err.code}`); + done(); + + } + console.log(`${caseName} get data: ${data.message} + ${data.code}`); + expect(data.code >= DATA_0).assertTrue(); + done(); + }); + }); + + /** + * @tc.number Telephony_statistics_getAllTxBytes_Promise_0100 + * @tc.name Call getAllTxBytes() and get traffic successfully (>=DATA_0) + * @tc.desc Function test + */ + it('Telephony_statistics_getAllTxBytes_Promise_0100', 0, async function (done) { + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + let caseName = 'Telephony_statistics_getAllTxBytes_Promise_0100'; + statistics.getAllTxBytes().then((data) => { + console.log(`${caseName} get data: ${data.message} + ${data.code}`); + expect(data.code >= DATA_0).assertTrue(); + done(); + }).catch((err) => { + console.log(`${caseName} get data fail: ${err.message} ${err.code}`); + done(); + }); + }); + + /** + * @tc.number Telephony_statistics_statistics_on_0100 + * @tc.name Test on() to check the callback result + * @tc.desc Function test + */ + it('Telephony_statistics_statistics_on_0100', 0, async function (done) { + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + let caseName = 'Telephony_statistics_statistics_on_0100'; + statistics.on('netStatsChange', (data) => { + console.log(`${caseName} on data: ${JSON.stringify(data)}`); + expect(data).assertUndefined(); + done(); + }); + done(); + }); + + /** + * @tc.number Telephony_statistics_statistics_off_0100 + * @tc.name Test off() to check the callback result + * @tc.desc Function test + */ + it('Telephony_statistics_statistics_off_0100', 0, async function (done) { + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + let caseName = 'Telephony_statistics_statistics_off_0100'; + statistics.off('netStatsChange', (data) => { + console.log(`${caseName} off data: ${JSON.stringify(data)}`); + expect(data).assertUndefined(); + done(); + }); + done(); + }); + /** + * @tc.number Telephony_statistics_getIfaceStatsDetail_Async_0100 + * @tc.name Test getIfaceStatsDetail() to check the callback result when iface is test + * @tc.desc Function test + */ + it('Telephony_statistics_getIfaceStatsDetail_Async_0100', 0, async function (done) { + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + let caseName = 'Telephony_statistics_getIfaceStatsDetail_Async_0100'; + let ifaceInfo = { + "iface": "test", + "startTime": Date.now() - 60 * 60, + "endTime": Date.now() + }; + statistics.getIfaceStatsDetail(ifaceInfo, (err, data) => { + if (err) { + console.log(`${caseName} getIfaceStatsDetail fail: ${JSON.stringify(err)}`); + done(); + return; + } + console.log(`${caseName} getIfaceStatsDetail data: ${JSON.stringify(data)}`); + expect().assertFail(); + done(); + }); + }); + + /** + * @tc.number Telephony_statistics_getIfaceStatsDetail_Async_0200 + * @tc.name Test getIfaceStatsDetail() to check the callback result when endTime more than the statTime + * @tc.desc Function test + */ + it('Telephony_statistics_getIfaceStatsDetail_Async_0200', 0, async function (done) { + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + let caseName = 'Telephony_statistics_getIfaceStatsDetail_Async_0200'; + let ifaceInfo = { + "iface": "eth0", + "startTime": Date.now(), + "endTime": Date.now() - 60 * 60 + }; + statistics.getIfaceStatsDetail(ifaceInfo, (err, data) => { + if (err) { + console.log(`${caseName} getIfaceStatsDetail fail: ${JSON.stringify(err)}`); + done(); + return; + } + console.log(`${caseName} getIfaceStatsDetail data: ${JSON.stringify(data)}`); + expect().assertFail(); + done(); + }); + }); + + /** + * @tc.number Telephony_statistics_getIfaceStatsDetail_Async_0500 + * @tc.name Test getIfaceStatsDetail() to check the callback result when endTime equal statTime + * @tc.desc Function test + */ + it('Telephony_statistics_getIfaceStatsDetail_Async_0500', 0, async function (done) { + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + let caseName = 'Telephony_statistics_getIfaceStatsDetail_Async_0500'; + let time = Date.now(); + let ifaceInfo = { + "iface": "eth0", + "startTime": time, + "endTime": time + }; + statistics.getIfaceStatsDetail(ifaceInfo, (err, data) => { + if (err) { + console.log(`${caseName} getIfaceStatsDetail fail: ${JSON.stringify(err)}`); + done(); + return; + } + console.log(`${caseName} getIfaceStatsDetail data: ${JSON.stringify(data)}`); + expect().assertFail(); + done(); + }); + }); + + /** + * @tc.number Telephony_statistics_getIfaceStatsDetail_Async_0600 + * @tc.name Test getIfaceStatsDetail() to check the callback result when endTime and statTime before system time + * @tc.desc Function test + */ + it('Telephony_statistics_getIfaceStatsDetail_Async_0600', 0, async function (done) { + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + let caseName = 'Telephony_statistics_getIfaceStatsDetail_Async_0600'; + let ifaceInfo = { + "iface": "eth0", + "startTime": 1, + "endTime": 2 + }; + statistics.getIfaceStatsDetail(ifaceInfo, (err, data) => { + if (err) { + console.log(`${caseName} getIfaceStatsDetail fail: ${JSON.stringify(err)}`); + done(); + return; + } + console.log(`${caseName} getIfaceStatsDetail data: ${JSON.stringify(data)}`); + expect().assertFail(); + done(); + }); + }); + + /** + * @tc.number Telephony_statistics_getIfaceStatsDetail_Async_0700 + * @tc.name Test getIfaceStatsDetail() to check the callback result when endTime and statTime after system time + * @tc.desc Function test + */ + it('Telephony_statistics_getIfaceStatsDetail_Async_0700', 0, async function (done) { + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + let caseName = 'Telephony_statistics_getIfaceStatsDetail_Async_0700'; + let ifaceInfo = { + "iface": "eth0", + "startTime": 1981080000, + "endTime": 1981083600 + }; + statistics.getIfaceStatsDetail(ifaceInfo, (err, data) => { + if (err) { + console.log(`${caseName} getIfaceStatsDetail fail: ${JSON.stringify(err)}`); + done(); + return; + } + console.log(`${caseName} getIfaceStatsDetail data: ${JSON.stringify(data)}`); + expect().assertFail(); + done(); + }); + }); + + /** + * @tc.number Telephony_statistics_getIfaceStatsDetail_Promise_0100 + * @tc.name Test getIfaceStatsDetail() to check the callback result when iface is test + * @tc.desc Function test + */ + it('Telephony_statistics_getIfaceStatsDetail_Promise_0100', 0, async function (done) { + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + let caseName = 'Telephony_statistics_getIfaceStatsDetail_Promise_0100'; + let ifaceInfo = { + "iface": "test", + "startTime": Date.now() - 60 * 60, + "endTime": Date.now() + }; + statistics.getIfaceStatsDetail(ifaceInfo).then(data => { + console.log(`${caseName} getIfaceStatsDetail data: ${JSON.stringify(data)}`); + expect().assertFail(); + done(); + }).catch(err => { + console.log(`${caseName} getIfaceStatsDetail fail: ${JSON.stringify(err)}`); + done(); + }) + }); + + /** + * @tc.number Telephony_statistics_getIfaceStatsDetail_Promise_0200 + * @tc.name Test getIfaceStatsDetail() to check the callback result when endTime more than the statTime + * @tc.desc Function test + */ + it('Telephony_statistics_getIfaceStatsDetail_Promise_0200', 0, async function (done) { + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + let caseName = 'Telephony_statistics_getIfaceStatsDetail_Promise_0200'; + let ifaceInfo = { + "iface": "eth0", + "startTime": Date.now(), + "endTime": Date.now() - 60 * 60 + }; + statistics.getIfaceStatsDetail(ifaceInfo).then(data => { + console.log(`${caseName} getIfaceStatsDetail data: ${JSON.stringify(data)}`); + expect().assertFail(); + done(); + }).catch(err => { + console.log(`${caseName} getIfaceStatsDetail fail: ${JSON.stringify(err)}`); + done(); + }) + }); + + /** + * @tc.number Telephony_statistics_getIfaceStatsDetail_Promise_0500 + * @tc.name Test getIfaceStatsDetail() to check the callback result when endTime equal statTime + * @tc.desc Function test + */ + it('Telephony_statistics_getIfaceStatsDetail_Promise_0500', 0, async function (done) { + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + let caseName = 'Telephony_statistics_getIfaceStatsDetail_Promise_0500'; + let time = Date.now(); + let ifaceInfo = { + "iface": "eth0", + "startTime": time, + "endTime": time + }; + statistics.getIfaceStatsDetail(ifaceInfo).then(data => { + console.log(`${caseName} getIfaceStatsDetail data: ${JSON.stringify(data)}`); + expect().assertFail(); + done(); + }).catch(err => { + console.log(`${caseName} getIfaceStatsDetail fail: ${JSON.stringify(err)}`); + done(); + }) + }); + + /** + * @tc.number Telephony_statistics_getIfaceStatsDetail_Promise_0600 + * @tc.name Test getIfaceStatsDetail() to check the callback result when endTime and statTime before system time + * @tc.desc Function test + */ + it('Telephony_statistics_getIfaceStatsDetail_Promise_0600', 0, async function (done) { + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + let caseName = 'Telephony_statistics_getIfaceStatsDetail_Promise_0600'; + let ifaceInfo = { + "iface": "eth0", + "startTime": 1, + "endTime": 2 + }; + statistics.getIfaceStatsDetail(ifaceInfo).then(data => { + console.log(`${caseName} getIfaceStatsDetail data: ${JSON.stringify(data)}`); + expect().assertFail(); + done(); + }).catch(err => { + console.log(`${caseName} getIfaceStatsDetail fail: ${JSON.stringify(err)}`); + done(); + }) + }); + + /** + * @tc.number Telephony_statistics_getIfaceStatsDetail_Promise_0700 + * @tc.name Test getIfaceStatsDetail() to check the callback result when endTime and statTime after system time + * @tc.desc Function test + */ + it('Telephony_statistics_getIfaceStatsDetail_Promise_0700', 0, async function (done) { + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + let caseName = 'Telephony_statistics_getIfaceStatsDetail_Promise_0700'; + let ifaceInfo = { + "iface": "eth0", + "startTime": 1981080000, + "endTime": 1981083600 + }; + statistics.getIfaceStatsDetail(ifaceInfo).then(data => { + console.log(`${caseName} getIfaceStatsDetail data: ${JSON.stringify(data)}`); + expect().assertFail(); + done(); + }).catch(err => { + console.log(`${caseName} getIfaceStatsDetail fail: ${JSON.stringify(err)}`); + done(); + }) + }); + + /** + * @tc.number Telephony_statistics_getUidStatsDetail_Async_0100 + * @tc.name Test getUidStatsDetail() to check the callback result when iface is test + * @tc.desc Function test + */ + it('Telephony_statistics_getUidStatsDetail_Async_0100', 0, async function (done) { + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + let caseName = 'Telephony_statistics_getUidStatsDetail_Async_0100'; + let uidInfo = { + "ifaceInfo": { + "iface": "test", + "startTime": Date.now() - 60 * 60, + "endTime": Date.now() + }, + "uid": 1001 + }; + statistics.getUidStatsDetail(uidInfo, (err, data) => { + if (err) { + console.log(`${caseName} getUidStatsDetail fail: ${JSON.stringify(err)}`); + done(); + return; + } + console.log(`${caseName} getUidStatsDetail data: ${JSON.stringify(data)}`); + expect().assertFail(); + done(); + }); + }); + + /** + * @tc.number Telephony_statistics_getUidStatsDetail_Async_0200 + * @tc.name Test getUidStatsDetail() to check the callback result when endTime more than the statTime + * @tc.desc Function test + */ + it('Telephony_statistics_getUidStatsDetail_Async_0200', 0, async function (done) { + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + let caseName = 'Telephony_statistics_getUidStatsDetail_Async_0200'; + let uidInfo = { + "ifaceInfo": { + "iface": "eth0", + "startTime": Date.now(), + "endTime": Date.now() - 60 * 60 + }, + "uid": 1001 + }; + statistics.getUidStatsDetail(uidInfo, (err, data) => { + if (err) { + console.log(`${caseName} getUidStatsDetail fail: ${JSON.stringify(err)}`); + done(); + return; + } + console.log(`${caseName} getUidStatsDetail data: ${JSON.stringify(data)}`); + expect().assertFail(); + done(); + }); + }); + + /** + * @tc.number Telephony_statistics_getUidStatsDetail_Async_0500 + * @tc.name Test getUidStatsDetail() to check the callback result when endTime equal statTime + * @tc.desc Function test + */ + it('Telephony_statistics_getUidStatsDetail_Async_0500', 0, async function (done) { + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + let caseName = 'Telephony_statistics_getUidStatsDetail_Async_0500'; + let time = Date.now(); + let uidInfo = { + "ifaceInfo": { + "iface": "eth0", + "startTime": time, + "endTime": time + }, + "uid": 1001 + }; + statistics.getUidStatsDetail(uidInfo, (err, data) => { + if (err) { + console.log(`${caseName} getUidStatsDetail fail: ${JSON.stringify(err)}`); + done(); + return; + } + console.log(`${caseName} getUidStatsDetail data: ${JSON.stringify(data)}`); + expect().assertFail(); + done(); + }); + }); + + /** + * @tc.number Telephony_statistics_getUidStatsDetail_Async_0600 + * @tc.name Test getUidStatsDetail() to check the callback result when uid is 0 + * @tc.desc Function test + */ + it('Telephony_statistics_getUidStatsDetail_Async_0600', 0, async function (done) { + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + let caseName = 'Telephony_statistics_getUidStatsDetail_Async_0600'; + let uidInfo = { + "ifaceInfo": { + "iface": "eth0", + "startTime": Date.now() - 60 * 60, + "endTime": Date.now() + }, + "uid": 0 + }; + statistics.getUidStatsDetail(uidInfo, (err, data) => { + if (err) { + console.log(`${caseName} getUidStatsDetail fail: ${JSON.stringify(err)}`); + done(); + return; + } + console.log(`${caseName} getUidStatsDetail data: ${JSON.stringify(data)}`); + expect().assertFail(); + done(); + }); + }); + + /** + * @tc.number Telephony_statistics_getUidStatsDetail_Async_0700 + * @tc.name Test getUidStatsDetail() to check the callback result when endTime and statTime before system time + * @tc.desc Function test + */ + it('Telephony_statistics_getUidStatsDetail_Async_0700', 0, async function (done) { + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + let caseName = 'Telephony_statistics_getUidStatsDetail_Async_0700'; + let uidInfo = { + "ifaceInfo": { + "iface": "eth0", + "startTime": 1, + "endTime": 2 + }, + "uid": 1001 + }; + statistics.getUidStatsDetail(uidInfo, (err, data) => { + if (err) { + console.log(`${caseName} getUidStatsDetail fail: ${JSON.stringify(err)}`); + done(); + return; + } + console.log(`${caseName} getUidStatsDetail data: ${JSON.stringify(data)}`); + expect().assertFail(); + done(); + }); + }); + + /** + * @tc.number Telephony_statistics_getUidStatsDetail_Async_0800 + * @tc.name Test getUidStatsDetail() to check the callback result when endTime and statTime after system time + * @tc.desc Function test + */ + it('Telephony_statistics_getUidStatsDetail_Async_0800', 0, async function (done) { + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + let caseName = 'Telephony_statistics_getUidStatsDetail_Async_0800'; + let uidInfo = { + "ifaceInfo": { + "iface": "eth0", + "startTime": 1981080000, + "endTime": 1981083600 + }, + "uid": 1001 + }; + statistics.getUidStatsDetail(uidInfo, (err, data) => { + if (err) { + console.log(`${caseName} getUidStatsDetail fail: ${JSON.stringify(err)}`); + done(); + return; + } + console.log(`${caseName} getUidStatsDetail data: ${JSON.stringify(data)}`); + expect().assertFail(); + done(); + }); + }); + + /** + * @tc.number Telephony_statistics_getUidStatsDetail_Promise_0100 + * @tc.name Test getUidStatsDetail() to check the callback result when iface is test + * @tc.desc Function test + */ + it('Telephony_statistics_getUidStatsDetail_Promise_0100', 0, async function (done) { + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + let caseName = 'Telephony_statistics_getUidStatsDetail_Promise_0100'; + let uidInfo = { + "ifaceInfo": { + "iface": "test", + "startTime": Date.now() - 60 * 60, + "endTime": Date.now() + }, + "uid": 1001 + }; + statistics.getUidStatsDetail(uidInfo).then(data => { + console.log(`${caseName} getUidStatsDetail data: ${JSON.stringify(data)}`); + expect().assertFail(); + done(); + }).catch(err => { + console.log(`${caseName} getUidStatsDetail fail: ${JSON.stringify(err)}`); + done(); + }) + }); + + /** + * @tc.number Telephony_statistics_getUidStatsDetail_Promise_0200 + * @tc.name Test getUidStatsDetail() to check the callback result when endTime more than the statTime + * @tc.desc Function test + */ + it('Telephony_statistics_getUidStatsDetail_Promise_0200', 0, async function (done) { + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + let caseName = 'Telephony_statistics_getUidStatsDetail_Promise_0200'; + let uidInfo = { + "ifaceInfo": { + "iface": "eth0", + "startTime": Date.now(), + "endTime": Date.now() - 60 * 60 + }, + "uid": 1001 + }; + statistics.getUidStatsDetail(uidInfo).then(data => { + console.log(`${caseName} getUidStatsDetail data: ${JSON.stringify(data)}`); + expect().assertFail(); + done(); + }).catch(err => { + console.log(`${caseName} getUidStatsDetail fail: ${JSON.stringify(err)}`); + done(); + }) + }); + + /** + * @tc.number Telephony_statistics_getUidStatsDetail_Promise_0500 + * @tc.name Test getUidStatsDetail() to check the callback result when endTime equal statTime + * @tc.desc Function test + */ + it('Telephony_statistics_getUidStatsDetail_Promise_0500', 0, async function (done) { + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + let caseName = 'Telephony_statistics_getUidStatsDetail_Promise_0500'; + let time = Date.now(); + let uidInfo = { + "ifaceInfo": { + "iface": "eth0", + "startTime": time, + "endTime": time + }, + "uid": 1001 + }; + statistics.getUidStatsDetail(uidInfo).then(data => { + console.log(`${caseName} getUidStatsDetail data: ${JSON.stringify(data)}`); + expect().assertFail(); + done(); + }).catch(err => { + console.log(`${caseName} getUidStatsDetail fail: ${JSON.stringify(err)}`); + done(); + }) + }); + + /** + * @tc.number Telephony_statistics_getUidStatsDetail_Promise_0600 + * @tc.name Test getUidStatsDetail() to check the callback result when uid is 0 + * @tc.desc Function test + */ + it('Telephony_statistics_getUidStatsDetail_Promise_0600', 0, async function (done) { + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + let caseName = 'Telephony_statistics_getUidStatsDetail_Promise_0600'; + let uidInfo = { + "ifaceInfo": { + "iface": "eth0", + "startTime": Date.now() - 60 * 60, + "endTime": Date.now() + }, + "uid": 0 + }; + statistics.getUidStatsDetail(uidInfo).then(data => { + console.log(`${caseName} getUidStatsDetail data: ${JSON.stringify(data)}`); + expect().assertFail(); + done(); + }).catch(err => { + console.log(`${caseName} getUidStatsDetail fail: ${JSON.stringify(err)}`); + done(); + }) + }); + + /** + * @tc.number Telephony_statistics_getUidStatsDetail_Promise_0700 + * @tc.name Test getUidStatsDetail() to check the callback result when endTime and statTime before system time + * @tc.desc Function test + */ + it('Telephony_statistics_getUidStatsDetail_Promise_0700', 0, async function (done) { + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + let caseName = 'Telephony_statistics_getUidStatsDetail_Promise_0700'; + let uidInfo = { + "ifaceInfo": { + "iface": "eth0", + "startTime": 1, + "endTime": 2 + }, + "uid": 1001 + }; + statistics.getUidStatsDetail(uidInfo).then(data => { + console.log(`${caseName} getUidStatsDetail data: ${JSON.stringify(data)}`); + expect().assertFail(); + done(); + }).catch(err => { + console.log(`${caseName} getUidStatsDetail fail: ${JSON.stringify(err)}`); + done(); + }) + }); + + /** + * @tc.number Telephony_statistics_getUidStatsDetail_Promise_0800 + * @tc.name Test getUidStatsDetail() to check the callback result when endTime and statTime after system time + * @tc.desc Function test + */ + it('Telephony_statistics_getUidStatsDetail_Promise_0800', 0, async function (done) { + if (utils.notCheck) { + expect(true).assertTrue(); + done(); + return; + } + let caseName = 'Telephony_statistics_getUidStatsDetail_Promise_0800'; + let uidInfo = { + "ifaceInfo": { + "iface": "eth0", + "startTime": 1981080000, + "endTime": 1981083600 + }, + "uid": 1001 + }; + statistics.getUidStatsDetail(uidInfo).then(data => { + console.log(`${caseName} getUidStatsDetail data: ${JSON.stringify(data)}`); + expect().assertFail(); + done(); + }).catch(err => { + console.log(`${caseName} getUidStatsDetail fail: ${JSON.stringify(err)}`); + done(); + }) + }); + }) +} diff --git a/telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/test/Utils.ets b/telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/test/Utils.ets new file mode 100644 index 000000000..65f70088d --- /dev/null +++ b/telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/test/Utils.ets @@ -0,0 +1,119 @@ +// @ts-nocheck +/** + * 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 class Utils { + static rect_left; + static rect_top; + static rect_right; + static rect_bottom; + static rect_value; + static notCheck = true; + + static sleep(time) { + return new Promise((resolve, reject) => { + setTimeout(() => { + resolve() + }, time) + }).then(() => { + console.info(`sleep ${time} over...`) + }) + } + + static getComponentRect(key) { + let strJson = getInspectorByKey(key); + let obj = JSON.parse(strJson); + console.info("[getInspectorByKey] current component obj is: " + JSON.stringify(obj)); + let rectInfo = JSON.parse('[' + obj.$rect + ']') + console.info("[getInspectorByKey] rectInfo is: " + rectInfo); + this.rect_left = JSON.parse('[' + rectInfo[0] + ']')[0] + this.rect_top = JSON.parse('[' + rectInfo[0] + ']')[1] + this.rect_right = JSON.parse('[' + rectInfo[1] + ']')[0] + this.rect_bottom = JSON.parse('[' + rectInfo[1] + ']')[1] + return this.rect_value = { + "left": this.rect_left, "top": this.rect_top, "right": this.rect_right, "bottom": this.rect_bottom + } + } + + static async swipe(downX, downY, upX, upY, steps) { + console.info('start to swipe') + this.drags(downX, downY, upX, upY, steps, false) + } + + static async drag(downX, downY, upX, upY, steps) { + console.info('start to drag') + this.drags(downX, downY, upX, upY, steps, true) + } + + static async drags(downX, downY, upX, upY, steps, drag) { + var xStep; + var yStep; + var swipeSteps; + var ret; + xStep = 0; + yStep = 0; + ret = false; + swipeSteps = steps; + if (swipeSteps == 0) { + swipeSteps = 1; + } + xStep = (upX - downX) / swipeSteps; + yStep = (upY - downY) / swipeSteps; + console.info('move step is: ' + 'xStep: ' + xStep + ' yStep: ' + yStep) + var downPonit: TouchObject = { + id: 1, + x: downX, + y: downY, + type: TouchType.Down, + } + console.info('down touch started: ' + JSON.stringify(downPonit)) + sendTouchEvent(downPonit); + console.info('start to move') + if (drag) { + await this.sleep(500) + } + for (var i = 1;i <= swipeSteps; i++) { + var movePoint: TouchObject = { + id: 1, + x: downX + (xStep * i), + y: downY + (yStep * i), + type: TouchType.Move + } + console.info('move touch started: ' + JSON.stringify(movePoint)) + ret = sendTouchEvent(movePoint) + if (ret == false) { + break; + } + await this.sleep(5) + } + console.info('start to up') + if (drag) { + await this.sleep(100) + } + var upPoint: TouchObject = { + id: 1, + x: upX, + y: upY, + type: TouchType.Up, + } + console.info('up touch started: ' + JSON.stringify(upPoint)) + sendTouchEvent(upPoint) + await this.sleep(500) + } +} + + + + diff --git a/telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/test/lib/Const.js b/telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/test/lib/Const.js new file mode 100644 index 000000000..f9263cd46 --- /dev/null +++ b/telephony/telephonyjstest/new_add/entry/src/main/ets/MainAbility/test/lib/Const.js @@ -0,0 +1,36 @@ +/** + * 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. + */ + +// sim slot id +export const DEFAULT_SLOTID = 0; +export const SLOTID3 = 3; +export const SLOTID2 = 2; +export const SLOTID_MINUS1 = -1; + +// sim correct password +export const CORRECT_PIN = '1234'; +export const CORRECT_PIN2 = '18099014'; + +// sim incorrect password +export const INCORRECT_PIN = '134679'; +export const INCORRECT_PIN_LEN3 = '123'; +export const INCORRECT_PUK = '134679'; +export const INCORRECT_PIN2 = '134679'; +export const INCORRECT_PIN2_LEN3 = '123'; +export const INCORRECT_PIN2_LEN9 = '123456789'; +export const INCORRECT_PUK2 = '134679'; + +// lock status response +export const LOCK_RESULT = { SUCCESS: 0, FAILURE: -1, EXCEPTION: -2 }; \ No newline at end of file diff --git a/telephony/telephonyjstest/new_add/entry/src/main/resources/base/element/string.json b/telephony/telephonyjstest/new_add/entry/src/main/resources/base/element/string.json new file mode 100644 index 000000000..03b8532c5 --- /dev/null +++ b/telephony/telephonyjstest/new_add/entry/src/main/resources/base/element/string.json @@ -0,0 +1,12 @@ +{ + "string": [ + { + "name": "entry_MainAbility", + "value": "entry_MainAbility" + }, + { + "name": "description_mainability", + "value": "ETS_Empty Ability" + } + ] +} \ No newline at end of file diff --git a/telephony/telephonyjstest/new_add/entry/src/main/resources/base/media/icon.png b/telephony/telephonyjstest/new_add/entry/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_xkAI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LL3aH zpi;lr6%&X;C%SVM=P%MJ6(}KH>m0w_WKuWy{X2p4!2Pqrwm;>=<2o}Dhu*bisL!?5 z)6?@AU&4YWUN)^*jr!Ozt&JdTDOw)?fw~F17S(d{|7GG(G(KeJZ0N2`FVv?5 NG*q?mAC)bG{|A+36q*14 literal 0 HcmV?d00001 diff --git a/telephony/telephonyjstest/new_add/entry/src/main/resources/rawfile/star-1-2.png b/telephony/telephonyjstest/new_add/entry/src/main/resources/rawfile/star-1-2.png new file mode 100644 index 0000000000000000000000000000000000000000..450c3dd3ca68bf601bd08e5f41797d376e20d00d GIT binary patch literal 8295 zcma)iby!qi)GiDI3@ITfJq#cs(xo6VIK9g0Is58cut9YYAhAky89NJ&c$4N6Nm zw8Wj?_uaqmbN@K!?C070th3LGz1Mo*9j&FIL_x|(iid|s0au1;Ejqu(x%6MX}UcP^pVq^MKx?9Z3<6HZSZ(YTWwl+ z4})r2h&L?_5Z3xL9JTpl$1We;HwOfV*U2Dd;4VathABE2mL~&90=s!A z17A=j029Bxgn&sP{lPFWGr*0ABr?l!nhT^H>H*JtEAfpTOhQ8`F<+vJ8@ZDt_v2l} zOF0@&=65xE>0mI)Bv(k<5_x1Wr}DE!>r#HG91U6(z}Lz^i4RY3X&Tfw3&nM%1C5a) z%(ySExg?jj0C8QEq$g*CpQ*Xk7yhNiNn@bzJnMOrz${d^ZW9+zK}FP6Wt)@*prd*F z(rz`Qjq{pA&L7Hx1K?P`{_=|>e3O_&^n>(;eRI>{gq^xXjKN& z@MCLic)gQH^`1Je&lNP6cFPmo@#}YJ&*-b0%L%rIiIEC%K9b2VMf24JMlrxCU;4bM9NM`z%7*&=MO^=(k?eYD|N0NSRUq1vD*l*s- z4;5;mae9K07G>0^3_eR`n2mvtsZw7^GmKor6U4O}T!EZW#(u#BA_V$L+A#=JNj^p8 zMo$u9AUc@@o>+Zc_I+>hn*oW`p*FU_>v9MlGJsQZG`UKU!kSII&(iR9spGPLK_?dv zH62cSuh@C=`WqBAh*E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