From c3209fda87b3b202f58b76c512dab5cd5c242f90 Mon Sep 17 00:00:00 2001 From: "chleun.moon" Date: Thu, 10 May 2018 10:34:33 +0900 Subject: [PATCH] [Network][Non-ACR][Disconnect Wi-Fi before statistics is reset If the Wi-Fi connection is still maintained, it is not ensured that the staticstics is zero even if the statistics is reset. Change-Id: I005188e00320224d64993650a91241d8fc85611e Signed-off-by: Cheoleun Moon --- .../testcase/TSConnectionManager.cs | 30 ++++++---------------- 1 file changed, 8 insertions(+), 22 deletions(-) diff --git a/tct-suite-vs/Tizen.Network.Tests/testcase/TSConnectionManager.cs b/tct-suite-vs/Tizen.Network.Tests/testcase/TSConnectionManager.cs index a9dc0c2..21f6451 100755 --- a/tct-suite-vs/Tizen.Network.Tests/testcase/TSConnectionManager.cs +++ b/tct-suite-vs/Tizen.Network.Tests/testcase/TSConnectionManager.cs @@ -660,33 +660,26 @@ namespace Tizen.Network.Connection.Tests [Property("AUTHOR", "Cheoleun Moon, chleun.moon@samsung.com")] public static async Task ResetStatistics_ALL_STATISTICS_TYPE() { - WiFiAP _wifiAP = null; try { - /* - * PRECONDITION - * 1. Activate WiFi then connect to a AP. - * 2. Bluetooth, SIM card inserted. - */ Log.Info(Globals.LogTag, "ResetStatistics_ALL_CONNECTION_TYPE start"); - await setUp(); - _wifiAP = WiFiManager.GetConnectedAP(); - Assert.IsNotNull(_wifiAP, "No WiFi connection"); - Assert.AreEqual((string)_nameWiFi, (string)_wifiAP.NetworkInformation.Essid, "Connect to an AP do not successfully"); + await tearDown(); - /* TEST CODE */ ConnectionManager.ResetStatistics(ConnectionType.WiFi, StatisticsType.LastReceivedData); Log.Info(Globals.LogTag, "Reset LastReceivedData"); - Assert.IsTrue(0 == ConnectionManager.GetStatistics(ConnectionType.WiFi, StatisticsType.LastReceivedData), "ResetStatistics failed"); + Assert.IsTrue(0 == ConnectionManager.GetStatistics(ConnectionType.WiFi, StatisticsType.LastReceivedData), "Reset LastReceivedData failed"); ConnectionManager.ResetStatistics(ConnectionType.WiFi, StatisticsType.LastSentData); Log.Info(Globals.LogTag, "Reset LastSentData"); - Assert.IsTrue(0 == ConnectionManager.GetStatistics(ConnectionType.WiFi, StatisticsType.LastSentData), "ResetStatistics failed"); + Assert.IsTrue(0 == ConnectionManager.GetStatistics(ConnectionType.WiFi, StatisticsType.LastSentData), "Reset LastSentData failed"); ConnectionManager.ResetStatistics(ConnectionType.WiFi, StatisticsType.TotalReceivedData); Log.Info(Globals.LogTag, "Reset TotalReceivedData"); - Assert.IsTrue(0 == ConnectionManager.GetStatistics(ConnectionType.WiFi, StatisticsType.TotalReceivedData), "ResetStatistics failed"); + Assert.IsTrue(0 == ConnectionManager.GetStatistics(ConnectionType.WiFi, StatisticsType.TotalReceivedData), "Reset TotalReceivedData failed"); ConnectionManager.ResetStatistics(ConnectionType.WiFi, StatisticsType.TotalSentData); Log.Info(Globals.LogTag, "Reset TotalSentData"); - Assert.IsTrue(0 == ConnectionManager.GetStatistics(ConnectionType.WiFi, StatisticsType.TotalSentData), "ResetStatistics failed"); + Assert.IsTrue(0 == ConnectionManager.GetStatistics(ConnectionType.WiFi, StatisticsType.TotalSentData), "Reset TotalSentData failed"); + + // POSTCONDITION + await setUp(); } catch (NotSupportedException) { @@ -700,13 +693,6 @@ namespace Tizen.Network.Connection.Tests { Assert.True(false, "Exception occurs. Msg : " + ex.ToString()); } - finally - { - if (_wifiAP != null) - { - _wifiAP.Dispose(); - } - } } [Test] -- 2.7.4