From ae118be23ed739b49a790071646a3419849f0e8b Mon Sep 17 00:00:00 2001 From: DoHyun Pyun Date: Tue, 8 Oct 2019 08:56:17 +0900 Subject: [PATCH] [Bluetooth][Non-ACR] Add pre-condition logic in socket TCs This patchset resolves TFDF-5922 issue on the emulator image Change-Id: I39ccfbd849dd5b5e78650702b9570f30c70ef159 --- .../testcase/TSIBluetoothClientSocket.cs | 16 +++++++++ .../testcase/TSIBluetoothServerSocket.cs | 40 ++++++++++++++++++++++ .../testcase/TSSocketConnection.cs | 32 +++++++++++++++++ .../TSSocketConnectionStateChangedEventArgs.cs | 24 +++++++++++++ .../testcase/TSSocketData.cs | 24 +++++++++++++ .../testcase/TSSocketDataReceivedEventArgs.cs | 8 +++++ 6 files changed, 144 insertions(+) diff --git a/tct-suite-vs/Tizen.Bluetooth.Manual.Tests/testcase/TSIBluetoothClientSocket.cs b/tct-suite-vs/Tizen.Bluetooth.Manual.Tests/testcase/TSIBluetoothClientSocket.cs index cbcbc9a..33c0ef9 100755 --- a/tct-suite-vs/Tizen.Bluetooth.Manual.Tests/testcase/TSIBluetoothClientSocket.cs +++ b/tct-suite-vs/Tizen.Bluetooth.Manual.Tests/testcase/TSIBluetoothClientSocket.cs @@ -44,6 +44,14 @@ namespace Tizen.Network.Bluetooth.Tests public async Task Connect_SOCKET_CONNECTION_TEST() { try { + /* We can't occupy the precondition, if BT feature is not supported in Manual TC */ + if (_isBluetoothSupported == false) + { + BluetoothHelper.DisplayLabel("Connect_SOCKET_CONNECTION_TEST"); + await ManualTest.WaitForConfirm(); + return; + } + BluetoothSetup.CreateClientSocketUtil(); if (BluetoothSetup.Client == null) { @@ -104,6 +112,14 @@ namespace Tizen.Network.Bluetooth.Tests public async Task Disconnect_SOCKET_DISCONNECTION_TEST() { try { + /* We can't occupy the precondition, if BT feature is not supported in Manual TC */ + if (_isBluetoothSupported == false) + { + BluetoothHelper.DisplayLabel("Disconnect_SOCKET_DISCONNECTION_TEST"); + await ManualTest.WaitForConfirm(); + return; + } + BluetoothSetup.CreateClientSocketUtil(); if (BluetoothSetup.Client == null) { diff --git a/tct-suite-vs/Tizen.Bluetooth.Manual.Tests/testcase/TSIBluetoothServerSocket.cs b/tct-suite-vs/Tizen.Bluetooth.Manual.Tests/testcase/TSIBluetoothServerSocket.cs index 4843edc..a52a38b 100755 --- a/tct-suite-vs/Tizen.Bluetooth.Manual.Tests/testcase/TSIBluetoothServerSocket.cs +++ b/tct-suite-vs/Tizen.Bluetooth.Manual.Tests/testcase/TSIBluetoothServerSocket.cs @@ -46,6 +46,14 @@ namespace Tizen.Network.Bluetooth.Tests { try { + /* We can't occupy the precondition, if BT feature is not supported in Manual TC */ + if (_isBluetoothSupported == false) + { + BluetoothHelper.DisplayLabel("ConnectionStateChanged_EVENT"); + await ManualTest.WaitForConfirm(); + return; + } + BluetoothSetup.CreateClientSocketUtil(); if (BluetoothSetup.Client == null) { @@ -104,6 +112,14 @@ namespace Tizen.Network.Bluetooth.Tests { int writtenLength; + /* We can't occupy the precondition, if BT feature is not supported in Manual TC */ + if (_isBluetoothSupported == false) + { + BluetoothHelper.DisplayLabel("SendData_SEND_DATA_TEST_SERVER"); + await ManualTest.WaitForConfirm(); + return; + } + BluetoothSetup.CreateServerSocketUtil(); await BluetoothSetup.AcceptSocketUtil(); await Task.Delay(2000); @@ -156,6 +172,14 @@ namespace Tizen.Network.Bluetooth.Tests { int writtenLength; + /* We can't occupy the precondition, if BT feature is not supported in Manual TC */ + if (_isBluetoothSupported == false) + { + BluetoothHelper.DisplayLabel("SendData_SEND_DATA_TEST_CLIENT"); + await ManualTest.WaitForConfirm(); + return; + } + BluetoothSetup.CreateClientSocketUtil(); if (BluetoothSetup.Client == null) { @@ -214,6 +238,14 @@ namespace Tizen.Network.Bluetooth.Tests { try { + /* We can't occupy the precondition, if BT feature is not supported in Manual TC */ + if (_isBluetoothSupported == false) + { + BluetoothHelper.DisplayLabel("DataReceived_SERVER_EVENT"); + await ManualTest.WaitForConfirm(); + return; + } + BluetoothSetup.CreateServerSocketUtil(); await BluetoothSetup.AcceptSocketUtil(); BluetoothSetup.Socket.DataReceived += (sender, args) => @@ -272,6 +304,14 @@ namespace Tizen.Network.Bluetooth.Tests { try { + /* We can't occupy the precondition, if BT feature is not supported in Manual TC */ + if (_isBluetoothSupported == false) + { + BluetoothHelper.DisplayLabel("DataReceived_CLIENT_EVENT"); + await ManualTest.WaitForConfirm(); + return; + } + BluetoothSetup.CreateClientSocketUtil(); if (BluetoothSetup.Client == null) { diff --git a/tct-suite-vs/Tizen.Bluetooth.Manual.Tests/testcase/TSSocketConnection.cs b/tct-suite-vs/Tizen.Bluetooth.Manual.Tests/testcase/TSSocketConnection.cs index 5f81d7f..1a507c5 100644 --- a/tct-suite-vs/Tizen.Bluetooth.Manual.Tests/testcase/TSSocketConnection.cs +++ b/tct-suite-vs/Tizen.Bluetooth.Manual.Tests/testcase/TSSocketConnection.cs @@ -45,6 +45,14 @@ namespace Tizen.Network.Bluetooth.Tests { try { + /* We can't occupy the precondition, if BT feature is not supported in Manual TC */ + if (_isBluetoothSupported == false) + { + BluetoothHelper.DisplayLabel("SocketFd_READ_ONLY"); + await ManualTest.WaitForConfirm(); + return; + } + BluetoothSetup.CreateClientSocketUtil(); if (BluetoothSetup.Client == null) { @@ -106,6 +114,14 @@ namespace Tizen.Network.Bluetooth.Tests { try { + /* We can't occupy the precondition, if BT feature is not supported in Manual TC */ + if (_isBluetoothSupported == false) + { + BluetoothHelper.DisplayLabel("Address_READ_ONLY"); + await ManualTest.WaitForConfirm(); + return; + } + BluetoothSetup.CreateClientSocketUtil(); if (BluetoothSetup.Client == null) { @@ -168,6 +184,14 @@ namespace Tizen.Network.Bluetooth.Tests { try { + /* We can't occupy the precondition, if BT feature is not supported in Manual TC */ + if (_isBluetoothSupported == false) + { + BluetoothHelper.DisplayLabel("ServiceUuid_READ_ONLY"); + await ManualTest.WaitForConfirm(); + return; + } + BluetoothSetup.CreateClientSocketUtil(); if (BluetoothSetup.Client == null) { @@ -230,6 +254,14 @@ namespace Tizen.Network.Bluetooth.Tests { try { + /* We can't occupy the precondition, if BT feature is not supported in Manual TC */ + if (_isBluetoothSupported == false) + { + BluetoothHelper.DisplayLabel("Client_READ_ONLY"); + await ManualTest.WaitForConfirm(); + return; + } + BluetoothSetup.CreateClientSocketUtil(); if (BluetoothSetup.Client == null) { diff --git a/tct-suite-vs/Tizen.Bluetooth.Manual.Tests/testcase/TSSocketConnectionStateChangedEventArgs.cs b/tct-suite-vs/Tizen.Bluetooth.Manual.Tests/testcase/TSSocketConnectionStateChangedEventArgs.cs index 2b5f4dc..3acd30c 100755 --- a/tct-suite-vs/Tizen.Bluetooth.Manual.Tests/testcase/TSSocketConnectionStateChangedEventArgs.cs +++ b/tct-suite-vs/Tizen.Bluetooth.Manual.Tests/testcase/TSSocketConnectionStateChangedEventArgs.cs @@ -45,6 +45,14 @@ namespace Tizen.Network.Bluetooth.Tests { try { + /* We can't occupy the precondition, if BT feature is not supported in Manual TC */ + if (_isBluetoothSupported == false) + { + BluetoothHelper.DisplayLabel("Connection_READ_ONLY"); + await ManualTest.WaitForConfirm(); + return; + } + BluetoothSetup.CreateClientSocketUtil(); if (BluetoothSetup.Client == null) { @@ -100,6 +108,14 @@ namespace Tizen.Network.Bluetooth.Tests { try { + /* We can't occupy the precondition, if BT feature is not supported in Manual TC */ + if (_isBluetoothSupported == false) + { + BluetoothHelper.DisplayLabel("Result_READ_ONLY"); + await ManualTest.WaitForConfirm(); + return; + } + BluetoothSetup.CreateClientSocketUtil(); if (BluetoothSetup.Client == null) { @@ -154,6 +170,14 @@ namespace Tizen.Network.Bluetooth.Tests { try { + /* We can't occupy the precondition, if BT feature is not supported in Manual TC */ + if (_isBluetoothSupported == false) + { + BluetoothHelper.DisplayLabel("State_READ_ONLY"); + await ManualTest.WaitForConfirm(); + return; + } + BluetoothSetup.CreateClientSocketUtil(); if (BluetoothSetup.Client == null) { diff --git a/tct-suite-vs/Tizen.Bluetooth.Manual.Tests/testcase/TSSocketData.cs b/tct-suite-vs/Tizen.Bluetooth.Manual.Tests/testcase/TSSocketData.cs index 63dd8c1..1aa4a00 100755 --- a/tct-suite-vs/Tizen.Bluetooth.Manual.Tests/testcase/TSSocketData.cs +++ b/tct-suite-vs/Tizen.Bluetooth.Manual.Tests/testcase/TSSocketData.cs @@ -69,6 +69,14 @@ namespace Tizen.Network.Bluetooth.Tests { try { + /* We can't occupy the precondition, if BT feature is not supported in Manual TC */ + if (_isBluetoothSupported == false) + { + BluetoothHelper.DisplayLabel("SocketFd_READ_ONLY"); + await ManualTest.WaitForConfirm(); + return; + } + BluetoothSetup.CreateClientSocketUtil(); if (BluetoothSetup.Client == null) { @@ -129,6 +137,14 @@ namespace Tizen.Network.Bluetooth.Tests { try { + /* We can't occupy the precondition, if BT feature is not supported in Manual TC */ + if (_isBluetoothSupported == false) + { + BluetoothHelper.DisplayLabel("DataSize_READ_ONLY"); + await ManualTest.WaitForConfirm(); + return; + } + BluetoothSetup.CreateClientSocketUtil(); if (BluetoothSetup.Client == null) { @@ -188,6 +204,14 @@ namespace Tizen.Network.Bluetooth.Tests { try { + /* We can't occupy the precondition, if BT feature is not supported in Manual TC */ + if (_isBluetoothSupported == false) + { + BluetoothHelper.DisplayLabel("Data_READ_ONLY"); + await ManualTest.WaitForConfirm(); + return; + } + BluetoothSetup.CreateClientSocketUtil(); if (BluetoothSetup.Client == null) { diff --git a/tct-suite-vs/Tizen.Bluetooth.Manual.Tests/testcase/TSSocketDataReceivedEventArgs.cs b/tct-suite-vs/Tizen.Bluetooth.Manual.Tests/testcase/TSSocketDataReceivedEventArgs.cs index 278a952..68de987 100755 --- a/tct-suite-vs/Tizen.Bluetooth.Manual.Tests/testcase/TSSocketDataReceivedEventArgs.cs +++ b/tct-suite-vs/Tizen.Bluetooth.Manual.Tests/testcase/TSSocketDataReceivedEventArgs.cs @@ -68,6 +68,14 @@ namespace Tizen.Network.Bluetooth.Tests { try { + /* We can't occupy the precondition, if BT feature is not supported in Manual TC */ + if (_isBluetoothSupported == false) + { + BluetoothHelper.DisplayLabel("Data_READ_ONLY_CLIENT"); + await ManualTest.WaitForConfirm(); + return; + } + BluetoothSetup.CreateClientSocketUtil(); if (BluetoothSetup.Client == null) { -- 2.7.4