[Network][Non-ACR][Add delay to catch exception] 14/172514/5
authorchleun.moon <chleun.moon@samsung.com>
Wed, 14 Mar 2018 07:58:07 +0000 (16:58 +0900)
committerchleun.moon <chleun.moon@samsung.com>
Tue, 20 Mar 2018 01:40:23 +0000 (10:40 +0900)
Change-Id: I9b3e3b3b67a4d375091946190a2a6edd6ec30a8c
Signed-off-by: Cheoleun Moon <chleun.moon@samsung.com>
tct-suite-vs/Tizen.Network.Tests/testcase/TSConnectionProfile.cs
tct-suite-vs/Tizen.Network.Tests/testcase/TSConnectionProfileStateEventArgs.cs
tct-suite-vs/Tizen.Network.Tests/testcase/TSConnectionStateChangedEventArgs.cs
tct-suite-vs/Tizen.Network.Tests/testcase/TSDeviceStateChangedEventArgs.cs
tct-suite-vs/Tizen.Network.Tests/testcase/TSProfileStateEventArgs.cs
tct-suite-vs/Tizen.Network.Tests/testcase/TSRssiLevelChangedEventArgs.cs
tct-suite-vs/Tizen.Network.Tests/testcase/TSWiFiManager.cs

index b071e4f..93045f1 100755 (executable)
@@ -590,10 +590,12 @@ namespace Tizen.Network.Connection.Tests
 
                 Assert.IsNotNull(_connectionProfile, "No Profile Found");
                 _connectionProfile.ProfileStateChanged += EventHandlerProfileStateChanged;
+                await Task.Delay(3000);
                 await tearDown();
                 await Task.Delay(5000);
                 Log.Info(Globals.LogTag, "_flag=" + _flag);
                 Assert.IsTrue(_flag, "Profile State don't change");
+                _connectionProfile.ProfileStateChanged -= EventHandlerProfileStateChanged;
                 // POSTCONDITION
                 await setUp();
             }
index 9520e45..fb636fb 100755 (executable)
@@ -77,11 +77,13 @@ namespace Tizen.Network.Connection.Tests
 
                 Assert.IsNotNull(_connectionProfile, "No Profile Found");
                 _connectionProfile.ProfileStateChanged += EventHandlerProfileStateChanged;
+                await Task.Delay(3000);
                 Log.Info(Globals.LogTag, "Event subscripted");
                 await tearDown();
                 await Task.Delay(5000);
                 Log.Info(Globals.LogTag, "_flag=" + _flag);
                 Assert.IsTrue(_flag, "Profile State don't change");
+                _connectionProfile.ProfileStateChanged -= EventHandlerProfileStateChanged;
                 // POSTCONDITION
                 await setUp();
             }
index d309462..046dd40 100755 (executable)
@@ -76,6 +76,7 @@ namespace Tizen.Network.WiFi.Tests
                  * TEST CODE
                  */
                 WiFiManager.ConnectionStateChanged += EventHandlerConnectionStateChangedCBState;
+                await Task.Delay(3000);
                 await tearDown();
                 await Task.Delay(3000);
                 Assert.IsTrue(_flag, "Flag should be true after checking");
@@ -129,10 +130,12 @@ namespace Tizen.Network.WiFi.Tests
                  * Then, connect to WiFi private2, changed WiFiAp
                  */
                 WiFiManager.ConnectionStateChanged += EventHandlerConnectionStateChangedCBAp;
+                await Task.Delay(3000);
                 await networkSetup.WiFiActivate(networkParameter.wnPRIVATE1, networkParameter.wType.wPrivate, networkParameter.wPASS);
                 await Task.Delay(5000);
                 _wifiAP2 = WiFiManager.GetConnectedAP();
                 Assert.IsTrue(_flag, "Flag should be true after checking");
+                WiFiManager.ConnectionStateChanged -= EventHandlerConnectionStateChangedCBAp;
                 // POSTCONDITION
                 await setUp();
             }
@@ -158,13 +161,6 @@ namespace Tizen.Network.WiFi.Tests
                 {
                     _wifiAP2.Dispose();
                 }
-                try
-                {
-                    WiFiManager.ConnectionStateChanged -= EventHandlerConnectionStateChangedCBAp;
-                }
-                catch
-                {
-                }
             }
         }
     }
index b5184b5..ce83d64 100755 (executable)
@@ -54,10 +54,11 @@ namespace Tizen.Network.WiFi.Tests
         {
             try
             {
-                /* 
+                /*
                  * TEST CODE
                  */
                 WiFiManager.DeviceStateChanged += EventHandlerDeviceStateChangedCB;
+                await Task.Delay(3000);
                 if (WiFiManager.IsActive)
                 {
                     Log.Info(Globals.LogTag, "WiFi is activated");
index 85b1d3e..38ea42c 100755 (executable)
@@ -84,6 +84,7 @@ namespace Tizen.Network.Connection.Tests
                  */
                 Assert.IsNotNull(_connectionProfile, "No Profile Found");
                 _connectionProfile.ProfileStateChanged += EventHandlerProfileStateChangedCB;
+                await Task.Delay(3000);
                 await tearDown();
                 Log.Info(Globals.LogTag, "ConnectionProfile3=" + _connectionProfile.GetState(AddressFamily.IPv4).ToString());
                 await Task.Delay(3000);
index 556762d..17b12ac 100755 (executable)
@@ -58,6 +58,7 @@ namespace Tizen.Network.WiFi.Tests
                  * TEST CODE
                  */
                 WiFiManager.RssiLevelChanged += EventHandlerRssiLevelChangedCB;
+                await Task.Delay(3000);
                 if (WiFiManager.IsActive)
                 {
                     Log.Info(Globals.LogTag, "WiFi is activated");
index 99e3103..0856c9f 100755 (executable)
@@ -455,6 +455,7 @@ namespace Tizen.Network.WiFi.Tests
             try
             {
                 WiFiManager.DeviceStateChanged += EventHandlerDevice;
+                await Task.Delay(3000);
                 if (!WiFiManager.IsActive)
                 {
                     await WiFiManager.ActivateAsync();
@@ -829,14 +830,17 @@ namespace Tizen.Network.WiFi.Tests
                 /*
                  * TEST CODE
                  */
-                WiFiManager.ConnectionStateChanged += (s, e) =>
+                EventHandler<ConnectionStateChangedEventArgs> connectionStateChanged = (s, e) =>
                 {
                     _flag = true;
                 };
+                WiFiManager.ConnectionStateChanged += connectionStateChanged;
+                await Task.Delay(3000);
                 await setUp();
                 await Task.Delay(3000);
                 Assert.IsTrue(_flag, "Flag should be true after checking");
 
+                WiFiManager.ConnectionStateChanged -= connectionStateChanged;
                 Log.Info(Globals.LogTag, "Successfully done");
             }
             catch (NotSupportedException)
@@ -872,6 +876,7 @@ namespace Tizen.Network.WiFi.Tests
                 };
 
                 WiFiManager.BackgroundScanFinished += backgroundScanFinished;
+                await Task.Delay(3000);
                 await setUp();
                 WiFiAP ap = WiFiManager.GetConnectedAP();
                 ap.ForgetAP();