[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";
Server = BluetoothAdapter.CreateServerSocket(ServiceUuid);
Assert.IsNotNull(Server, "PRECONDITION: Failed to get server socket for testing");
Server.Dispose();
- BluetoothAdapter.DestroyServerSocket(Server);
}
catch (NotSupportedException)
{
catch (TypeInitializationException e)
{
if (isBluetoothSupported == false && e.InnerException.GetType() == typeof(NotSupportedException))
- {
+ {
BluetoothHelper.DisplayLabel("AcceptStateChanged_EVENT");
await ManualTest.WaitForConfirm();
}
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());
+ }
+ }
}
}