From: Sehaj Singh Kalra Date: Fri, 3 Jun 2016 18:22:34 +0000 (+0530) Subject: TCT implementation and bugs fixed X-Git-Tag: submit/tizen/20161214.063015~32 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c5e339ed931d9a7667ab68ba1fc6a73566cb5f96;p=platform%2Fcore%2Fcsapi%2Fsystem.git TCT implementation and bugs fixed Change-Id: Ief0f4f131ff687f0a6dcd7a2878282ee0e2a068f Signed-off-by: Sehaj Singh Kalra --- diff --git a/tct-runtimeinformation-tizen-tests/Makefile b/tct-runtimeinformation-tizen-tests/Makefile old mode 100644 new mode 100755 diff --git a/tct-runtimeinformation-tizen-tests/Properties/AssemblyInfo.cs b/tct-runtimeinformation-tizen-tests/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..dac2ee6 --- /dev/null +++ b/tct-runtimeinformation-tizen-tests/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("tct-runtimeinformation-tizen-tests")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Samsung Electronics")] +[assembly: AssemblyProduct("tct-runtimeinformation-tizen-tests")] +[assembly: AssemblyCopyright("Copyright © 2016 Samsung Electronics Co., Ltd")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("fdaa3944-fcce-4319-b93e-61ff53137edb")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/tct-runtimeinformation-tizen-tests/ReadMe.md b/tct-runtimeinformation-tizen-tests/ReadMe.md old mode 100644 new mode 100755 index 6aaa831..29816b0 --- a/tct-runtimeinformation-tizen-tests/ReadMe.md +++ b/tct-runtimeinformation-tizen-tests/ReadMe.md @@ -9,7 +9,7 @@ tct-suite-tizen-tests ├── bin - Contains executable file which is created by make file. ├── lib - Library files which needs to be packed. ├── res - Resource folder for any resources needed to run test. -├── share +├── share ├── Makefile - Script which builds package. ├── TCTCert.p12 - A Certificate file for building package. (pw:test) └── tizen-manifest.xml - A Tizen Manifest file for declaring privilege and controls. diff --git a/tct-runtimeinformation-tizen-tests/lib/Tizen.Internals.dll b/tct-runtimeinformation-tizen-tests/lib/Tizen.Internals.dll old mode 100644 new mode 100755 index fa644e1..30c421b Binary files a/tct-runtimeinformation-tizen-tests/lib/Tizen.Internals.dll and b/tct-runtimeinformation-tizen-tests/lib/Tizen.Internals.dll differ diff --git a/tct-runtimeinformation-tizen-tests/lib/Tizen.Network.dll b/tct-runtimeinformation-tizen-tests/lib/Tizen.Network.dll deleted file mode 100644 index 1a92ad6..0000000 Binary files a/tct-runtimeinformation-tizen-tests/lib/Tizen.Network.dll and /dev/null differ diff --git a/tct-runtimeinformation-tizen-tests/lib/Tizen.UI.dll b/tct-runtimeinformation-tizen-tests/lib/Tizen.UI.dll deleted file mode 100644 index 6b194c2..0000000 Binary files a/tct-runtimeinformation-tizen-tests/lib/Tizen.UI.dll and /dev/null differ diff --git a/tct-runtimeinformation-tizen-tests/lib/Tizen.dll b/tct-runtimeinformation-tizen-tests/lib/Tizen.dll old mode 100644 new mode 100755 index a6d2edf..f656769 Binary files a/tct-runtimeinformation-tizen-tests/lib/Tizen.dll and b/tct-runtimeinformation-tizen-tests/lib/Tizen.dll differ diff --git a/tct-runtimeinformation-tizen-tests/lib/Xamarin.Forms.Platform.Tizen.dll b/tct-runtimeinformation-tizen-tests/lib/Xamarin.Forms.Platform.Tizen.dll deleted file mode 100644 index b91fc96..0000000 Binary files a/tct-runtimeinformation-tizen-tests/lib/Xamarin.Forms.Platform.Tizen.dll and /dev/null differ diff --git a/tct-runtimeinformation-tizen-tests/lib/Xamarin.Forms.dll b/tct-runtimeinformation-tizen-tests/lib/Xamarin.Forms.dll deleted file mode 100644 index 08c22be..0000000 Binary files a/tct-runtimeinformation-tizen-tests/lib/Xamarin.Forms.dll and /dev/null differ diff --git a/tct-runtimeinformation-tizen-tests/org.test.tizen.newmodule.tpk b/tct-runtimeinformation-tizen-tests/org.test.tizen.newmodule.tpk deleted file mode 100644 index 154bbd9..0000000 Binary files a/tct-runtimeinformation-tizen-tests/org.test.tizen.newmodule.tpk and /dev/null differ diff --git a/tct-runtimeinformation-tizen-tests/org.test.tizen.runtimeinformation.tpk b/tct-runtimeinformation-tizen-tests/org.test.tizen.runtimeinformation.tpk new file mode 100644 index 0000000..0072f04 Binary files /dev/null and b/tct-runtimeinformation-tizen-tests/org.test.tizen.runtimeinformation.tpk differ diff --git a/tct-runtimeinformation-tizen-tests/res/ReadMe.md b/tct-runtimeinformation-tizen-tests/res/ReadMe.md old mode 100644 new mode 100755 index fd860ed..85fa0b5 --- a/tct-runtimeinformation-tizen-tests/res/ReadMe.md +++ b/tct-runtimeinformation-tizen-tests/res/ReadMe.md @@ -1,7 +1,27 @@ +# Naming conventions + +1) "TC application" refers to "org.test.tizen.application". +2) "sample applications" refers to those whose name contains string "Sample". + # purpose of those scripts -1) "push.sh" - this script is made for pushing the TC runtimeinformation module and "install.sh", "run.sh" scripts to Tizen device. Run it in Ubuntu. +1) "push.sh" - this script is made for pushing the TC application, the sample applications and "install.sh", "run.sh" scripts to Tizen device. Run it in Ubuntu. + +2) "install.sh" - this script is made for installing the sample applications in Tizen device. This script will be pushed to "/home/owner" directory of Tizen device. Manually run it. + +3) "run.sh" - this script is made for launching & relaunching TC application for Application API. This script will be pushed to "/home/owner" directory of Tizen device. Manually run it. + +# how to install your sample applications using those script + +1) Put your sample applications in the directory of the scripts. -2) "install.sh" - this script is made for installing the test application in Tizen device. This script will be pushed to "/home/owner" directory of Tizen device. Manually run it. +2) Add your sample application's name to "install.sh" script as below: + pkgcmd -u -n + pkgcmd -t tpk -i -p .tpk -q + app_launcher -l | grep + +3) Add your sample application's name to "run.sh" script as below: + app_launcher -k -3) "run.sh" - this script is made for launching & relaunching TC application for Network API. This script will be pushed to "/home/owner" directory of Tizen device. Manually run it. +# the end +-- nothing here--- diff --git a/tct-runtimeinformation-tizen-tests/res/Result/NewModule.xml b/tct-runtimeinformation-tizen-tests/res/Result/NewModule.xml deleted file mode 100644 index ce4df63..0000000 --- a/tct-runtimeinformation-tizen-tests/res/Result/NewModule.xml +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - PASS - - - - - - - - - - - - - - - - - PASS - - - - - - - - - - - - - \ No newline at end of file diff --git a/tct-runtimeinformation-tizen-tests/res/Result/System.xml b/tct-runtimeinformation-tizen-tests/res/Result/System.xml new file mode 100644 index 0000000..e7f1950 --- /dev/null +++ b/tct-runtimeinformation-tizen-tests/res/Result/System.xml @@ -0,0 +1,461 @@ + + + + + + + + + + + + + + + + + + + + + + + PASS + + + + + + + + + + + + + + + + + PASS + + + + + + + + + + + + + + + + + PASS + + + + + + + + + + + + + + + + + PASS + + + + + + + + + + + + + + + + + PASS + + + + + + + + + + + + + + + + + PASS + + + + + + + + + + + + + + + + + PASS + + + + + + + + + + + + + + + + + PASS + + + + + + + + + + + + + + + + + PASS + + + + + + + + + + + + + + + + + PASS + + + + + + + + + + + + + + + + + PASS + + + + + + + + + + + + + + + + + PASS + + + + + + + + + + + + + + + + + PASS + + + + + + + + + + + + + + + + + PASS + + + + + + + + + + + + + + + + + PASS + + + + + + + + + + + + + + + + + PASS + + + + + + + + + + + + + + + + + PASS + + + + + + + + + + + + + + + + + PASS + + + + + + + + + + + + + + + + + PASS + + + + + + + + + + + + + + + + + PASS + + + + + + + + + + + + + + + + + PASS + + + + + + + + + + + + + + + + + PASS + + + + + + + + + + + + + + + + + PASS + + + + + + + + + + + + + + + + + PASS + + + + + + + + + + + + + + + + + PASS + + + + + + + + + + + + + + + + + PASS + + + + + + + + + + + + + \ No newline at end of file diff --git a/tct-runtimeinformation-tizen-tests/res/Result/style/application.js b/tct-runtimeinformation-tizen-tests/res/Result/style/application.js old mode 100644 new mode 100755 diff --git a/tct-runtimeinformation-tizen-tests/res/Result/style/back_top.png b/tct-runtimeinformation-tizen-tests/res/Result/style/back_top.png old mode 100644 new mode 100755 diff --git a/tct-runtimeinformation-tizen-tests/res/Result/style/blue.jpg b/tct-runtimeinformation-tizen-tests/res/Result/style/blue.jpg old mode 100644 new mode 100755 diff --git a/tct-runtimeinformation-tizen-tests/res/Result/style/gray.jpg b/tct-runtimeinformation-tizen-tests/res/Result/style/gray.jpg old mode 100644 new mode 100755 diff --git a/tct-runtimeinformation-tizen-tests/res/Result/style/jquery.min.js b/tct-runtimeinformation-tizen-tests/res/Result/style/jquery.min.js old mode 100644 new mode 100755 diff --git a/tct-runtimeinformation-tizen-tests/res/Result/style/orange.jpg b/tct-runtimeinformation-tizen-tests/res/Result/style/orange.jpg old mode 100644 new mode 100755 diff --git a/tct-runtimeinformation-tizen-tests/res/Result/style/popup.js b/tct-runtimeinformation-tizen-tests/res/Result/style/popup.js old mode 100644 new mode 100755 diff --git a/tct-runtimeinformation-tizen-tests/res/Result/style/red.jpg b/tct-runtimeinformation-tizen-tests/res/Result/style/red.jpg old mode 100644 new mode 100755 diff --git a/tct-runtimeinformation-tizen-tests/res/Result/style/summary.xsl b/tct-runtimeinformation-tizen-tests/res/Result/style/summary.xsl old mode 100644 new mode 100755 diff --git a/tct-runtimeinformation-tizen-tests/res/Result/style/testresult.xsl b/tct-runtimeinformation-tizen-tests/res/Result/style/testresult.xsl old mode 100644 new mode 100755 diff --git a/tct-runtimeinformation-tizen-tests/res/Result/style/tests.css b/tct-runtimeinformation-tizen-tests/res/Result/style/tests.css old mode 100644 new mode 100755 index 2fda634..487bca0 --- a/tct-runtimeinformation-tizen-tests/res/Result/style/tests.css +++ b/tct-runtimeinformation-tizen-tests/res/Result/style/tests.css @@ -1,195 +1,195 @@ -@charset "UTF-8"; -/* CSS Document */ -#testcasepage div,#testcasepage h1,#testcasepage p,#testcasepage table,#testcasepage tr,#testcasepage th,#testcasepage td - { - margin: 0; - padding: 0; - border: 0; - font-weight: inherit; - font-style: inherit; - font-size: 0.96em; - font-family: arial; - vertical-align: baseline; -} - -#title td, #btc td{ - margin: 0; - padding: 0; - border: 0; - font-weight: inherit; - font-style: inherit; - font-size: 0.96em; - font-family: arial; - vertical-align: baseline; -} - -td.Ratio { - text-align: left; - font-weight: normal; - padding: 4px 10px 4px 5px; - vertical-align: middle; -} - -th.Ratio { - width: 400px; -} - -#testcasepage p { - text-align: left; -} - -#suite_title { - text-align: left; -} - -#btc { - text-align: right; -} - -#btc table { - position: absolute; - right: 0px; - width: 600px; -} - -#testcasepage table { - border-collapse: separate; - border-spacing: 0; - margin-bottom: 1.4em; - vertical-align: middle; -} - -#testcasepage th,#testcasepage td { - text-align: left; - font-weight: normal; - padding: 4px 10px 4px 5px; - vertical-align: middle; -} - -#cases table { - width: 101%; -} - -#cases td { - border-left: 0px; - font-weight: normal; - border-bottom: 0px; -} - -#suite_summary table { - width: 100%; -} - - -#overview table { - width: 101%; -} - -#overview table, #overview td, #overview tr { - border-left: none; - border-bottom: none; - border-right: none; - vertical-align: top; -} - -#overview td{ - width: 50%; -} - -#capability table { - width: 50%; -} - -#fail_cases table { - width: 101%; -} - -#title table { - width: 101%; -} - -#device table { - width: 100%; -} - -#summary table { - width: 100%; -} - -#testcasepage th { - border-bottom: 1px solid #000; - background-color: #AAAAAA; - border-left: 1px solid #000; - border-top: 1px solid #000; - color: #000; - font-weight: bold; - vertical-align: bottom; -} - -#summary th:last-child,#summary td:last-child, #device th:last-child,#device td:last-child, #suite_summary th:last-child,#suite_summary td:last-child,#cases th:last-child,#cases td:last-child,#capability th:last-child,#capability td:last-child { - border-right: 1px solid #000; -} - -#testcasepage td { - font-weight: normal; -} - -#summary td, #device td, #capability td, #suite_summary td, #cases td{ - border-left: 1px solid; - font-weight: normal; - border-bottom: 1px solid; -} - -#testcasepage td.yellow_rate { - background-color: #ffcc00; -} - -#testcasepage td.green_rate { - background-color: #1E90FF; -} - -#testcasepage td.dgreen_rate { - background-color: #339933; -} - -#testcasepage td.red_rate { - background-color: #FF3333; -} - -#testcasepage td.orange_rate { - background-color: #FFA500; -} - -#testcasepage td.gray_rate { - background-color: #AAAAAA; -} - -#title table,#title tr,#title td { - border-left: none; - border-bottom: none; - text-align: center; -} - -#title td:last-child { - border-right: none; -} - -#testcasepage h1 { - font-size: 2em; - font-family: Arial, sans-serif; - font-weight: bold; - line-height: 1; - color: #000; - margin-bottom: 0.75em; - padding-top: 0.25em; - font-weight: bold; -} - -#goTopBtn { - right: 0px; - bottom: 0px; - position: fixed; + - position: absolute; - top: expression(parseInt(document.body.scrollTop)+document.body.clientHeight-40 - ); -} +@charset "UTF-8"; +/* CSS Document */ +#testcasepage div,#testcasepage h1,#testcasepage p,#testcasepage table,#testcasepage tr,#testcasepage th,#testcasepage td + { + margin: 0; + padding: 0; + border: 0; + font-weight: inherit; + font-style: inherit; + font-size: 0.96em; + font-family: arial; + vertical-align: baseline; +} + +#title td, #btc td{ + margin: 0; + padding: 0; + border: 0; + font-weight: inherit; + font-style: inherit; + font-size: 0.96em; + font-family: arial; + vertical-align: baseline; +} + +td.Ratio { + text-align: left; + font-weight: normal; + padding: 4px 10px 4px 5px; + vertical-align: middle; +} + +th.Ratio { + width: 400px; +} + +#testcasepage p { + text-align: left; +} + +#suite_title { + text-align: left; +} + +#btc { + text-align: right; +} + +#btc table { + position: absolute; + right: 0px; + width: 600px; +} + +#testcasepage table { + border-collapse: separate; + border-spacing: 0; + margin-bottom: 1.4em; + vertical-align: middle; +} + +#testcasepage th,#testcasepage td { + text-align: left; + font-weight: normal; + padding: 4px 10px 4px 5px; + vertical-align: middle; +} + +#cases table { + width: 101%; +} + +#cases td { + border-left: 0px; + font-weight: normal; + border-bottom: 0px; +} + +#suite_summary table { + width: 100%; +} + + +#overview table { + width: 101%; +} + +#overview table, #overview td, #overview tr { + border-left: none; + border-bottom: none; + border-right: none; + vertical-align: top; +} + +#overview td{ + width: 50%; +} + +#capability table { + width: 50%; +} + +#fail_cases table { + width: 101%; +} + +#title table { + width: 101%; +} + +#device table { + width: 100%; +} + +#summary table { + width: 100%; +} + +#testcasepage th { + border-bottom: 1px solid #000; + background-color: #AAAAAA; + border-left: 1px solid #000; + border-top: 1px solid #000; + color: #000; + font-weight: bold; + vertical-align: bottom; +} + +#summary th:last-child,#summary td:last-child, #device th:last-child,#device td:last-child, #suite_summary th:last-child,#suite_summary td:last-child,#cases th:last-child,#cases td:last-child,#capability th:last-child,#capability td:last-child { + border-right: 1px solid #000; +} + +#testcasepage td { + font-weight: normal; +} + +#summary td, #device td, #capability td, #suite_summary td, #cases td{ + border-left: 1px solid; + font-weight: normal; + border-bottom: 1px solid; +} + +#testcasepage td.yellow_rate { + background-color: #ffcc00; +} + +#testcasepage td.green_rate { + background-color: #1E90FF; +} + +#testcasepage td.dgreen_rate { + background-color: #339933; +} + +#testcasepage td.red_rate { + background-color: #FF3333; +} + +#testcasepage td.orange_rate { + background-color: #FFA500; +} + +#testcasepage td.gray_rate { + background-color: #AAAAAA; +} + +#title table,#title tr,#title td { + border-left: none; + border-bottom: none; + text-align: center; +} + +#title td:last-child { + border-right: none; +} + +#testcasepage h1 { + font-size: 2em; + font-family: Arial, sans-serif; + font-weight: bold; + line-height: 1; + color: #000; + margin-bottom: 0.75em; + padding-top: 0.25em; + font-weight: bold; +} + +#goTopBtn { + right: 0px; + bottom: 0px; + position: fixed; + + position: absolute; + top: expression(parseInt(document.body.scrollTop)+document.body.clientHeight-40 + ); +} diff --git a/tct-runtimeinformation-tizen-tests/res/Result/summary.xml b/tct-runtimeinformation-tizen-tests/res/Result/summary.xml index 02571f3..807d726 100644 --- a/tct-runtimeinformation-tizen-tests/res/Result/summary.xml +++ b/tct-runtimeinformation-tizen-tests/res/Result/summary.xml @@ -8,9 +8,9 @@ 2016-04-20_18_37_38 2016-04-20_18_37_38 - - 2 - 2 + + 26 + 26 100 0 0 diff --git a/tct-runtimeinformation-tizen-tests/res/install.sh b/tct-runtimeinformation-tizen-tests/res/install.sh old mode 100644 new mode 100755 index c76b062..9c46f4e --- a/tct-runtimeinformation-tizen-tests/res/install.sh +++ b/tct-runtimeinformation-tizen-tests/res/install.sh @@ -1,2 +1,9 @@ +# uninstall sample applications pkgcmd -u -n org.test.tizen.runtimeinformation + +#install sample applications pkgcmd -t tpk -i -p org.test.tizen.runtimeinformation.tpk -q + +#list installed sample applications +echo "Successful installed the following packages: " +app_launcher -l | grep UIApplication diff --git a/tct-runtimeinformation-tizen-tests/res/pull.sh b/tct-runtimeinformation-tizen-tests/res/pull.sh old mode 100644 new mode 100755 index 6ce6bec..49bfbf0 --- a/tct-runtimeinformation-tizen-tests/res/pull.sh +++ b/tct-runtimeinformation-tizen-tests/res/pull.sh @@ -1,4 +1,4 @@ # pull result file sdb root on -sdb pull /home/owner/share/RuntimeInformation/RuntimeInformation.xml Result/ -sdb pull /home/owner/share/RuntimeInformation/summary.xml Result/ +sdb pull /home/owner/share/System/System.xml Result/ +sdb pull /home/owner/share/System/summary.xml Result/ diff --git a/tct-runtimeinformation-tizen-tests/res/push.sh b/tct-runtimeinformation-tizen-tests/res/push.sh old mode 100644 new mode 100755 diff --git a/tct-runtimeinformation-tizen-tests/res/run.sh b/tct-runtimeinformation-tizen-tests/res/run.sh old mode 100644 new mode 100755 index c03320b..2db171c --- a/tct-runtimeinformation-tizen-tests/res/run.sh +++ b/tct-runtimeinformation-tizen-tests/res/run.sh @@ -1,2 +1,4 @@ # install & run TC application +pkgcmd -u -n org.test.tizen.runtimeinformation +pkgcmd -t tpk -i -p org.test.tizen.runtimeinformation.tpk -q app_launcher -s org.test.tizen.runtimeinformation diff --git a/tct-runtimeinformation-tizen-tests/share/res/icon.png b/tct-runtimeinformation-tizen-tests/share/res/icon.png deleted file mode 100644 index 9765b1b..0000000 Binary files a/tct-runtimeinformation-tizen-tests/share/res/icon.png and /dev/null differ diff --git a/tct-runtimeinformation-tizen-tests/src/Program.cs b/tct-runtimeinformation-tizen-tests/src/Program.cs old mode 100644 new mode 100755 index 6c94a4b..88b1a5d --- a/tct-runtimeinformation-tizen-tests/src/Program.cs +++ b/tct-runtimeinformation-tizen-tests/src/Program.cs @@ -1,48 +1,29 @@ -using System; -using System.Threading.Tasks; using Tizen.Applications; -using Xamarin.Forms; -using Xamarin.Forms.Platform.Tizen; -using TestFramework; namespace TestFramework { - public class App : Xamarin.Forms.Application - { - public App() - { - MainPage = new NavigationPage(new TestMainPage()); + public class MyApplication : UIApplication { + protected override void OnCreate() { + Assert.Init(); + TestManager manager = new TestManager(); + manager.RunTestFromTCList(); } - protected override void OnStart() - { - // Handle when your app starts + protected override void OnResume() { + LogUtils.write(LogUtils.DEBUG, LogUtils.INFO, "Resumed!"); } - protected override void OnSleep() - { - // Handle when your app sleeps + protected override void OnPause() { + LogUtils.write(LogUtils.DEBUG, LogUtils.INFO, "Paused!"); } - protected override void OnResume() - { - // Handle when your app resumes + protected override void OnTerminate() { + LogUtils.write(LogUtils.DEBUG, LogUtils.INFO, "Terminated!"); } } - - public class MyApp : FormsApplication - { - protected override void OnCreate() - { - base.OnCreate(); - Forms.Init(this); - LoadApplication(new App()); - } - } - class Program { static void Main(string[] args) { - MyApp myApp = new MyApp(); - myApp.Run(args); + MyApplication app = new MyApplication(); + app.Run(args); } } } diff --git a/tct-runtimeinformation-tizen-tests/src/TestMainPage.cs b/tct-runtimeinformation-tizen-tests/src/TestMainPage.cs deleted file mode 100644 index 0fc8cca..0000000 --- a/tct-runtimeinformation-tizen-tests/src/TestMainPage.cs +++ /dev/null @@ -1,81 +0,0 @@ -using System; -using System.Collections.Generic; -using Xamarin.Forms; - -namespace TestFramework -{ - public class TestMainPage : ContentPage - { - TestManager manager; - Button runbutton; - Button rerunbutton; - Label label; - - public void initialize(){ - manager = new TestManager(); - manager.TestExecutionDone += MyTestRunner_TestCaseDone; - } - - public TestMainPage() - { - initialize(); - Title = "C# Test Application"; - - runbutton = new Button - { - Text = "Run", - FontSize = 20, - Image = "cat.png", - HorizontalOptions = LayoutOptions.FillAndExpand, - }; - runbutton.Clicked += OnRunButtonClicked; - - rerunbutton = new Button - { - Text = "Rerun", - FontSize = 20, - Image = "cat.png", - HorizontalOptions = LayoutOptions.FillAndExpand - }; - rerunbutton.Clicked += OnRerunButtonClicked; - rerunbutton.IsEnabled = false; - - label = new Label - { - Text = "Test Pending", - Font = Font.SystemFontOfSize(NamedSize.Large), - HorizontalOptions = LayoutOptions.FillAndExpand, - VerticalOptions = LayoutOptions.CenterAndExpand - }; - - Content = new StackLayout - { - Children= { - runbutton, - rerunbutton, - label - } - }; - - Padding = new Thickness(5, Device.OnPlatform(20, 5, 5), 5, 5); - } - - void OnRunButtonClicked(object sender, EventArgs e) - { - runbutton.IsEnabled = false; - label.Text = "Result Pending"; - manager.RunTestFromTCList(); - } - - void OnRerunButtonClicked(object sender, EventArgs e) - { - manager.RerunTestFromTCList(); - } - - void MyTestRunner_TestCaseDone(object sender, TestExecutionDoneEventArgs e) - { - label.Text = "TOTAL : " + e.Total + ", " + "PASS : " + e.Pass + ", " + "FAIL : " + e.Fail + Environment.NewLine; - rerunbutton.IsEnabled = true; - } - } -} diff --git a/tct-runtimeinformation-tizen-tests/src/Testcase/TSRuntimeInformation.cs b/tct-runtimeinformation-tizen-tests/src/Testcase/TSRuntimeInformation.cs index 849cfa7..9e42538 100644 --- a/tct-runtimeinformation-tizen-tests/src/Testcase/TSRuntimeInformation.cs +++ b/tct-runtimeinformation-tizen-tests/src/Testcase/TSRuntimeInformation.cs @@ -1,7 +1,11 @@ using System; +using System.Threading; using System.Threading.Tasks; using TestFramework; using Tizen.System; +using Tizen; +using System.Collections.Generic; +using System.Diagnostics; namespace TizenTest.System { [TestFixture] @@ -620,6 +624,114 @@ namespace TizenTest.System { } } + [Test] + [Category("P1")] + [Description("Return value type and sanity checking for GetProcessMemoryInformation")] + [Property("SPEC", "Tizen.System.RuntimeInformation.GetProcessMemoryInformation M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Tester, Sehaj Singh Kalra sehaj.kalra@samsung.com")] + public static void GetProcessMemoryInformation_TYPE_RETURN_VALUE() + { + try + { + IList processlist = new List(); + Process[] list = Process.GetProcesses(); + foreach (Process p in list) { + processlist.Add(p.Id); + } + Log.Info("TizenSehaj", "No.of System processes " + processlist.Count); + + IDictionary all_info = Tizen.System.RuntimeInformation.GetProcessMemoryInformation(processlist); + Log.Info("TizenSehaj", "API call made"); + + Assert.True((processlist.Count == all_info.Count), "Mismatch in number of pids given and results returned"); + Log.Info("TizenSehaj", "Count assertion passed"); + + foreach (KeyValuePair kvp in all_info) + { + ProcessMemoryInformation info = kvp.Value; + + object vsz_val = info.Vsz; + Assert.IsNotNull(vsz_val, "Virtual memory size is null"); + Assert.True((vsz_val is int), "Virtual memory size is not of type int"); + + object rss_val = info.Rss; + Assert.IsNotNull(rss_val, "Resident set size is null"); + Assert.True((rss_val is int), "Resident set size is not of type int"); + + object pss_val = info.Pss; + Assert.IsNotNull(pss_val, "Proportional set size is null"); + Assert.True((pss_val is int), "Proportional set size is not of type int"); + + object shared_clean_val = info.SharedClean; + Assert.IsNotNull(shared_clean_val, "Shared Clean is null"); + Assert.True((shared_clean_val is int), "Shared Clean is not of type int"); + + object shared_dirty_val = info.SharedDirty; + Assert.IsNotNull(shared_dirty_val, "Shared Dirty is null"); + Assert.True((shared_dirty_val is int), "Shared Dirty is not of type int"); + + object private_clean_val = info.PrivateClean; + Assert.IsNotNull(private_clean_val, "Private Clean is null"); + Assert.True((private_clean_val is int), "Private Clean is not of type int"); + + object private_dirty_val = info.PrivateDirty; + Assert.IsNotNull(private_dirty_val, "Private Dirty is null"); + Assert.True((private_dirty_val is int), "Private Dirty is not of type int"); + } + } + catch (Exception e) + { + Assert.Fail(); + } + } + + [Test] + [Category("P1")] + [Description("Return value type and sanity checking for GetProcessCpuUsage")] + [Property("SPEC", "Tizen.System.RuntimeInformation.GetProcessMemoryInformation M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Tester, Sehaj Singh Kalra sehaj.kalra@samsung.com")] + public static void GetProcessCpuUsage_TYPE_RETURN_VALUE() + { + try + { + IList processlist = new List(); + Process[] list = Process.GetProcesses(); + foreach (Process p in list) { + processlist.Add(p.Id); + } + Log.Info("TizenSehaj", "No.of System processes " + processlist.Count); + + IDictionary all_info = Tizen.System.RuntimeInformation.GetProcessCpuUsage(processlist); + Log.Info("TizenSehaj", "API call made"); + + Assert.True((processlist.Count == all_info.Count), "Mismatch in number of pids given and results returned"); + Log.Info("TizenSehaj", "Count assertion passed"); + + foreach (KeyValuePair kvp in all_info) + { + ProcessCpuUsage info = kvp.Value; + + object utime_val = info.UTime; + Assert.IsNotNull(utime_val, "Amount of time that this process has been scheduled in user mode is null"); + Assert.True((utime_val is uint), "Amount of time that this process has been scheduled in user mode is not of type int"); + Assert.True(((uint)utime_val >= 0), "Amount of time that this process has been scheduled in user mode is less than zero"); + + object stime_val = info.STime; + Assert.IsNotNull((uint)stime_val, "Amount of time that this process has been scheduled in kernel mode is null"); + Assert.True((stime_val is uint), "Amount of time that this process has been scheduled in kernel mode is not of type int"); + Assert.True(((uint)stime_val >= 0), "Amount of time that this process has been scheduled in kernel mode is less than zero"); + } + } + catch (Exception e) + { + Assert.Fail(); + } + } + [Test] [Category("P1")] [Description("Return value type and sanity checking for GetCpuUsage")] @@ -655,6 +767,28 @@ namespace TizenTest.System { } } + [Test] + [Category("P1")] + [Description("Value type and sanity checking for ProcessorCount")] + [Property("SPEC", "Tizen.System.RuntimeInformation.ProcessorCount M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Tester, Sehaj Singh Kalra sehaj.kalra@samsung.com")] + public static void ProcessorCount_TYPE_VALUE() + { + try + { + object processor_count = Tizen.System.RuntimeInformation.ProcessorCount; + + Assert.IsNotNull(processor_count, "Processor current frequency is null"); + Assert.True((processor_count is int), "Processor current frequency is not of type int"); + } + catch (Exception e) + { + Assert.Fail(); + } + } + [Test] [Category("P1")] [Description("Return value type and sanity checking for GetProcessorCurrentFrequency")] diff --git a/tct-runtimeinformation-tizen-tests/tct-runtimeinformation-tizen-tests.csproj b/tct-runtimeinformation-tizen-tests/tct-runtimeinformation-tizen-tests.csproj new file mode 100644 index 0000000..b4e2187 --- /dev/null +++ b/tct-runtimeinformation-tizen-tests/tct-runtimeinformation-tizen-tests.csproj @@ -0,0 +1,104 @@ + + + + Debug + AnyCPU + {FDAA3944-FCCE-4319-B93E-61FF53137EDB} + Library + Properties + tct_system_runtimeinformation_tizen_tests + tct-runtimeinformation-tizen-tests + v4.5.2 + 512 + {3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + 10.0 + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) + $(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages + False + UnitTest + + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + lib\TestFramework.dll + + + lib\Tizen.dll + + + lib\Tizen.Applications.dll + + + lib\Tizen.Internals.dll + + + lib\Tizen.System.dll + + + + + + + + + + + + + + + + + + + + + + + + + + + + False + + + False + + + False + + + False + + + + + + + + diff --git a/tct-runtimeinformation-tizen-tests/tizen-manifest.xml b/tct-runtimeinformation-tizen-tests/tizen-manifest.xml old mode 100644 new mode 100755 index 58a52d5..dca5c69 --- a/tct-runtimeinformation-tizen-tests/tizen-manifest.xml +++ b/tct-runtimeinformation-tizen-tests/tizen-manifest.xml @@ -1,10 +1,10 @@ - + icon.png - + - + http://tizen.org/privilege/systemmonitor