From: nguyen.vtan Date: Tue, 5 Jun 2018 08:28:31 +0000 (+0700) Subject: [Non-ACR][MediaPlayer][add precondition for Tizen.MediaPlayer.Tests ] X-Git-Tag: tct5.0_m2~203^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=847cb407dd17151ddf3628069fb90e992e089fc3;p=test%2Ftct%2Fcsharp%2Fapi.git [Non-ACR][MediaPlayer][add precondition for Tizen.MediaPlayer.Tests ] http://suprem.sec.samsung.net/jira/browse/DPTTIZEN-3073 Change-Id: Ifcdd55be4cc0735ca305ae08039147ea5322986a Signed-off-by: nguyen.vtan --- diff --git a/release/csharp-tct_5.0_dotnet/csharp-tct_5.0_dotnet/resource/tct-testconfig-3.0.zip b/release/csharp-tct_5.0_dotnet/csharp-tct_5.0_dotnet/resource/tct-testconfig-3.0.zip index 59ec304..fe25108 100755 Binary files a/release/csharp-tct_5.0_dotnet/csharp-tct_5.0_dotnet/resource/tct-testconfig-3.0.zip and b/release/csharp-tct_5.0_dotnet/csharp-tct_5.0_dotnet/resource/tct-testconfig-3.0.zip differ diff --git a/release/csharp-tct_5.0_dotnet/csharp-tct_5.0_dotnet/resource/tct-testconfig/preconfigure.json b/release/csharp-tct_5.0_dotnet/csharp-tct_5.0_dotnet/resource/tct-testconfig/preconfigure.json index 59ce6aa..cc345d0 100755 --- a/release/csharp-tct_5.0_dotnet/csharp-tct_5.0_dotnet/resource/tct-testconfig/preconfigure.json +++ b/release/csharp-tct_5.0_dotnet/csharp-tct_5.0_dotnet/resource/tct-testconfig/preconfigure.json @@ -32,5 +32,6 @@ "HERE_MAPS_PROVIDER_KEY_FOR_XAMARIN":"Set the HERE_MAPS_PROVIDER_KEY.(for xamarin)", "WPS_PBC_AP":"Set name of available AP with WPS PBC function", "WPS_PIN_AP":"Set name of available AP with WPS PIN function", - "PIN_NUMBER_OF_WPS_PIN_AP":"Set pin number of WPS_PIN_AP. The pin number should be generated with the checksum defined in WSC spec (Wi-Fi Simple Configuration Technical Specification). If you are not familiar with it, please use an example number, 47363533." + "PIN_NUMBER_OF_WPS_PIN_AP":"Set pin number of WPS_PIN_AP. The pin number should be generated with the checksum defined in WSC spec (Wi-Fi Simple Configuration Technical Specification). If you are not familiar with it, please use an example number, 47363533.", + "STREAMING_URI":"Set the streaming uri such as http://www.samsung.com/xx/xx/aa.mp4" }] diff --git a/release/csharp-tct_5.0_dotnet/csharp-tct_5.0_dotnet/resource/tct-testconfig/tct-testconfig.ini b/release/csharp-tct_5.0_dotnet/csharp-tct_5.0_dotnet/resource/tct-testconfig/tct-testconfig.ini index 93c3889..fbb67d2 100755 --- a/release/csharp-tct_5.0_dotnet/csharp-tct_5.0_dotnet/resource/tct-testconfig/tct-testconfig.ini +++ b/release/csharp-tct_5.0_dotnet/csharp-tct_5.0_dotnet/resource/tct-testconfig/tct-testconfig.ini @@ -51,3 +51,6 @@ HERE_MAPS_PROVIDER_KEY_FOR_XAMARIN = Set the HERE_MAPS_PROVIDER_KEY.(for xamarin [Tizen.XamarinFormsMaps.Manual.Tests] HERE_MAPS_PROVIDER_KEY_FOR_XAMARIN = Set the HERE_MAPS_PROVIDER_KEY.(for xamarin) +# MediaPlayer test key settings +[Tizen.MediaPlayer.Tests] +STREAMING_URI = set the uri in here. ex>http://www.samsung.com/xx/xx/aa.mp4 \ No newline at end of file diff --git a/release/csharp-tct_5.0_dotnet/csharp-tct_5.0_dotnet/resource/tct-testconfig/tests.xml b/release/csharp-tct_5.0_dotnet/csharp-tct_5.0_dotnet/resource/tct-testconfig/tests.xml index 24d2834..f65a029 100755 --- a/release/csharp-tct_5.0_dotnet/csharp-tct_5.0_dotnet/resource/tct-testconfig/tests.xml +++ b/release/csharp-tct_5.0_dotnet/csharp-tct_5.0_dotnet/resource/tct-testconfig/tests.xml @@ -387,5 +387,18 @@ The tct-bt-helper is included in the tct-bluetooth-tizen-tests package. Install + + + + + + + Set the streaming uri such as http://www.samsung.com/xx/xx/aa.mp4. + + + + + + diff --git a/tct-suite-vs/Tizen.MediaPlayer.Tests/testcase/support/PreconditionUtil.cs b/tct-suite-vs/Tizen.MediaPlayer.Tests/testcase/support/PreconditionUtil.cs new file mode 100644 index 0000000..a3d8fd1 --- /dev/null +++ b/tct-suite-vs/Tizen.MediaPlayer.Tests/testcase/support/PreconditionUtil.cs @@ -0,0 +1,82 @@ +/* +* Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved +* +* Licensed under the Apache License, Version 2.0 (the License); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an AS IS BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +using NUnit.Framework.TUnit; +using System; +using System.IO; + +namespace PreconditionUtils +{ + public class PreconditionUtils + { + public static string STREAMING_URI = null; + + public static void SetPrecondition() + { + string result = ReadFile("/opt/usr/home/owner/share/tct/preconfigure.json"); + int index = 0; + string[] resultArray = StringParser(result); + foreach (string item in resultArray) + { + switch (item) + { + case "STREAMING_URI": + // Remove backslash + resultArray[index + 1] = resultArray[index + 1].Replace("\\", ""); + STREAMING_URI = resultArray[index + 1]; + break; + default: + break; + } + index++; + } + } + + private static string ReadFile(string path) + { + string result = null; + string url = path; + + try + { + StreamReader reader = File.OpenText(path); + result = reader.ReadToEnd(); + } + catch (Exception e) + { + LogUtils.Write(LogUtils.ERROR, LogUtils.TAG, "File read error : " + e.Message); + } + + return result; + } + private static string[] StringParser(string TCID) + { + string[] delimiter = { "[{\"", "\":\"", "\",\"", "\":", ",\"", "\"}]", "}" }; + string[] stringPieces = null; + + try + { + stringPieces = TCID.Split(delimiter, StringSplitOptions.None); + } + catch (Exception e) + { + LogUtils.Write(LogUtils.ERROR, LogUtils.TAG, "ResultParser : " + e.Message); + } + + return stringPieces; + } + } +} diff --git a/tool/script/tct-testconfig/preconfigure.json b/tool/script/tct-testconfig/preconfigure.json index 59ce6aa..cc345d0 100755 --- a/tool/script/tct-testconfig/preconfigure.json +++ b/tool/script/tct-testconfig/preconfigure.json @@ -32,5 +32,6 @@ "HERE_MAPS_PROVIDER_KEY_FOR_XAMARIN":"Set the HERE_MAPS_PROVIDER_KEY.(for xamarin)", "WPS_PBC_AP":"Set name of available AP with WPS PBC function", "WPS_PIN_AP":"Set name of available AP with WPS PIN function", - "PIN_NUMBER_OF_WPS_PIN_AP":"Set pin number of WPS_PIN_AP. The pin number should be generated with the checksum defined in WSC spec (Wi-Fi Simple Configuration Technical Specification). If you are not familiar with it, please use an example number, 47363533." + "PIN_NUMBER_OF_WPS_PIN_AP":"Set pin number of WPS_PIN_AP. The pin number should be generated with the checksum defined in WSC spec (Wi-Fi Simple Configuration Technical Specification). If you are not familiar with it, please use an example number, 47363533.", + "STREAMING_URI":"Set the streaming uri such as http://www.samsung.com/xx/xx/aa.mp4" }] diff --git a/tool/script/tct-testconfig/tct-testconfig-3.0.zip b/tool/script/tct-testconfig/tct-testconfig-3.0.zip index 59ec304..fe25108 100755 Binary files a/tool/script/tct-testconfig/tct-testconfig-3.0.zip and b/tool/script/tct-testconfig/tct-testconfig-3.0.zip differ diff --git a/tool/script/tct-testconfig/tct-testconfig.ini b/tool/script/tct-testconfig/tct-testconfig.ini index 93c3889..fbb67d2 100755 --- a/tool/script/tct-testconfig/tct-testconfig.ini +++ b/tool/script/tct-testconfig/tct-testconfig.ini @@ -51,3 +51,6 @@ HERE_MAPS_PROVIDER_KEY_FOR_XAMARIN = Set the HERE_MAPS_PROVIDER_KEY.(for xamarin [Tizen.XamarinFormsMaps.Manual.Tests] HERE_MAPS_PROVIDER_KEY_FOR_XAMARIN = Set the HERE_MAPS_PROVIDER_KEY.(for xamarin) +# MediaPlayer test key settings +[Tizen.MediaPlayer.Tests] +STREAMING_URI = set the uri in here. ex>http://www.samsung.com/xx/xx/aa.mp4 \ No newline at end of file diff --git a/tool/script/tct-testconfig/tests.xml b/tool/script/tct-testconfig/tests.xml index 24d2834..f65a029 100755 --- a/tool/script/tct-testconfig/tests.xml +++ b/tool/script/tct-testconfig/tests.xml @@ -387,5 +387,18 @@ The tct-bt-helper is included in the tct-bluetooth-tizen-tests package. Install + + + + + + + Set the streaming uri such as http://www.samsung.com/xx/xx/aa.mp4. + + + + + +