[Bluetooth][TCSACR-207] Add new TC for SocketConnection property 55/196755/3
authorWootak Jung <wootak.jung@samsung.com>
Fri, 4 Jan 2019 05:54:07 +0000 (14:54 +0900)
committerWootak Jung <wootak.jung@samsung.com>
Mon, 7 Jan 2019 06:33:53 +0000 (15:33 +0900)
Change-Id: I8645498328a9a022897180f9865b4beee8b51c99

tct-suite-vs/Tizen.Bluetooth.Manual.Tests/testcase/TSBluetoothServerSocket.cs [changed mode: 0755->0644]
tct-suite-vs/Tizen.Bluetooth.Manual.Tests/testcase/TSSocketConnection.cs [changed mode: 0755->0644]

old mode 100755 (executable)
new mode 100644 (file)
index 01a977c..e638830
@@ -154,7 +154,7 @@ namespace Tizen.Network.Bluetooth.Tests
         [Precondition(2, "Run this only on test device which acts as server")]
         [Step(1, "Tap the Run button")]
         [Postcondition(1, "Close the terminal")]
-        public static async Task Dispose_CHECK_NO_EXCEPTION()
+        public async Task Dispose_CHECK_NO_EXCEPTION()
         {
             BluetoothServerSocket Server = null;
             string ServiceUuid = "00001101-0000-1000-8000-00805F9B7777";
@@ -163,7 +163,6 @@ namespace Tizen.Network.Bluetooth.Tests
                 Server = BluetoothAdapter.CreateServerSocket(ServiceUuid);
                 Assert.IsNotNull(Server, "PRECONDITION: Failed to get server socket for testing");
                 Server.Dispose();
-                BluetoothAdapter.DestroyServerSocket(Server);
             }
             catch (NotSupportedException)
             {
@@ -176,7 +175,7 @@ namespace Tizen.Network.Bluetooth.Tests
             catch (TypeInitializationException e)
             {
                 if (isBluetoothSupported == false && e.InnerException.GetType() == typeof(NotSupportedException))
-                               {
+                {
                     BluetoothHelper.DisplayLabel("AcceptStateChanged_EVENT");
                     await ManualTest.WaitForConfirm();
                 }
old mode 100755 (executable)
new mode 100644 (file)
index 55244ee..aa3b224
@@ -190,5 +190,56 @@ namespace Tizen.Network.Bluetooth.Tests
                 Assert.True(false, "Exception occurs. Msg : " + ex.ToString());
             }
         }
+
+        [Test]
+        [Category("P1")]
+        [Description("Test Client. Check whether Client is valid")]
+        [Property("SPEC", "Tizen.Network.Bluetooth.SocketConnection.Client A")]
+        [Property("SPEC_URL", "-")]
+        [Property("CRITERIA", "PRO")]
+        [Property("AUTHOR", "Adhavan, adhavan.m@samsung.com")]
+        [Precondition(1, "Turn on the bluetooth")]
+        [Precondition(2, "Run this only on test device which acts as client")]
+        [Precondition(3, "Test device(client) should be paired only with the server device")]
+        [Precondition(4, "Should run this only after the TC BluetoothServerSocketTests.Listen_ACCEPT_CLIENT_CONNECTION_TEST is started")]
+        [Step(1, "Tap the Run button")]
+        [Step(2, "When permission request popup appears, tap accept on server device.")]
+        [Postcondition(1, "Unpair the server device")]
+        public async Task Client_READ_ONLY()
+        {
+            try
+            {
+                await BluetoothSetup.CreateClientSocketUtil();
+                await BluetoothSetup.ConnectSocketUtil();
+                Assert.IsNotNull(BluetoothSetup.ClientConnection, "Connection data is null");
+                Assert.IsNotNull(BluetoothSetup.ClientConnection.Client, "Client is null");
+                Assert.IsInstanceOf<IBluetoothServerSocket>(BluetoothSetup.ClientConnection.Client, "Client is not proper");
+
+                BluetoothHelper.DisplayPassLabel("Client_READ_ONLY");
+                await ManualTest.WaitForConfirm();
+
+                await BluetoothSetup.DisconnectSocketUtil();
+            }
+            catch (NotSupportedException)
+            {
+                if (isBluetoothSupported == false)
+                {
+                    BluetoothHelper.DisplayLabel("Client_READ_ONLY");
+                    await ManualTest.WaitForConfirm();
+                }
+            }
+            catch (TypeInitializationException e)
+            {
+                if (isBluetoothSupported == false && e.InnerException.GetType() == typeof(NotSupportedException))
+                {
+                    BluetoothHelper.DisplayLabel("Client_READ_ONLY");
+                    await ManualTest.WaitForConfirm();
+                }
+            }
+            catch (Exception ex)
+            {
+                Assert.True(false, "Exception occurs. Msg : " + ex.ToString());
+            }
+        }
     }
 }