From 847cb407dd17151ddf3628069fb90e992e089fc3 Mon Sep 17 00:00:00 2001 From: "nguyen.vtan" Date: Tue, 5 Jun 2018 15:28:31 +0700 Subject: [PATCH] [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 --- .../resource/tct-testconfig-3.0.zip | Bin 50026 -> 50706 bytes .../resource/tct-testconfig/preconfigure.json | 3 +- .../resource/tct-testconfig/tct-testconfig.ini | 3 + .../resource/tct-testconfig/tests.xml | 13 ++++ .../testcase/support/PreconditionUtil.cs | 82 +++++++++++++++++++++ tool/script/tct-testconfig/preconfigure.json | 3 +- tool/script/tct-testconfig/tct-testconfig-3.0.zip | Bin 50026 -> 50706 bytes tool/script/tct-testconfig/tct-testconfig.ini | 3 + tool/script/tct-testconfig/tests.xml | 13 ++++ 9 files changed, 118 insertions(+), 2 deletions(-) create mode 100644 tct-suite-vs/Tizen.MediaPlayer.Tests/testcase/support/PreconditionUtil.cs 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 59ec3040cec324d02d1c76d84cb80f063b41cd39..fe25108811fc1824d9511d6525be7496dd6edb42 100755 GIT binary patch delta 522 zcmaFW#yqKqnJ>VbnMH&F1a9PJ`fTLu6Jr4}CNB^R2QxPR7F!;|JG1hr&zi8)lPlO6 z7%Dce&wj@$%c&F`66EUW>*?nn9~$JTWTjM`TB1;rk*ZKyl(~6k;bKO?s-r%U3a3-9 zx-&3AO9weZp|~_TLm{zP zA)}+kg8;8j*Ywo`7uj2ps9dLgOBCB?D4TquE|V5@)>7z&wr3K^+IsR7=MOd`yP zz@FTF&;=6Mmk;_w7;1;SQNwz2-61!5jBo_U7nu0p7*q@k)ye-3@hhOXALs{Fgj$CG WjfuO#iamDVbnMH&F1X}Ylyf*UniLrnflNX4EgBhEDi!Be~bxQN}dCkix8_v$a z5WabR_B+&n0Y!ZMTnj)+ZOaFla%PjRp7L(kJs5 zDR3|_fUqi9$*ZG6o0sfX;1CG#W@Hj!MmS)y@evn@1FDbsLm20dc%#}sS?#EsJi5(b lFF=U@jfTaO{f~$O9U`iLVLysOiJf4DuZ}9QRUZV&0089!Rnhhttp://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 59ec3040cec324d02d1c76d84cb80f063b41cd39..fe25108811fc1824d9511d6525be7496dd6edb42 100755 GIT binary patch delta 522 zcmaFW#yqKqnJ>VbnMH&F1a9PJ`fTLu6Jr4}CNB^R2QxPR7F!;|JG1hr&zi8)lPlO6 z7%Dce&wj@$%c&F`66EUW>*?nn9~$JTWTjM`TB1;rk*ZKyl(~6k;bKO?s-r%U3a3-9 zx-&3AO9weZp|~_TLm{zP zA)}+kg8;8j*Ywo`7uj2ps9dLgOBCB?D4TquE|V5@)>7z&wr3K^+IsR7=MOd`yP zz@FTF&;=6Mmk;_w7;1;SQNwz2-61!5jBo_U7nu0p7*q@k)ye-3@hhOXALs{Fgj$CG WjfuO#iamDVbnMH&F1X}Ylyf*UniLrnflNX4EgBhEDi!Be~bxQN}dCkix8_v$a z5WabR_B+&n0Y!ZMTnj)+ZOaFla%PjRp7L(kJs5 zDR3|_fUqi9$*ZG6o0sfX;1CG#W@Hj!MmS)y@evn@1FDbsLm20dc%#}sS?#EsJi5(b lFF=U@jfTaO{f~$O9U`iLVLysOiJf4DuZ}9QRUZV&0089!Rnhhttp://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. + + + + + + -- 2.7.4