From: Hwankyu Jhun Date: Mon, 27 Jul 2020 07:09:24 +0000 (+0900) Subject: [Applications][Non-ACR][Separate packages from Applications.Tests] X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F00%2F239500%2F2;p=test%2Ftct%2Fcsharp%2Fapi.git [Applications][Non-ACR][Separate packages from Applications.Tests] Adds: - Tizen.Applications.MessagePort.Tests - Tizen.Applications.Preference.Tests - Tizen.Applications.RPCPort.Tests - Tizen.Applications.UI.Tests - Tizen.Applications.Service.Tests Change-Id: I265a62ca26027e428dba2a03471f192c85ed40a1 Signed-off-by: Hwankyu Jhun --- diff --git a/tct-suite-vs/Resource/Tizen.Applications.MessagePort.Tests/code/MsgPortApp.Tizen/MsgPortApp.Tizen.sln b/tct-suite-vs/Resource/Tizen.Applications.MessagePort.Tests/code/MsgPortApp.Tizen/MsgPortApp.Tizen.sln new file mode 100755 index 000000000..6017758ee --- /dev/null +++ b/tct-suite-vs/Resource/Tizen.Applications.MessagePort.Tests/code/MsgPortApp.Tizen/MsgPortApp.Tizen.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +VisualStudioVersion = 15.0.26730.10 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MsgPortApp.Tizen", "MsgPortApp.Tizen\MsgPortApp.Tizen.csproj", "{7578B31D-7987-42F2-9B10-FDC30CBA8401}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {7578B31D-7987-42F2-9B10-FDC30CBA8401}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7578B31D-7987-42F2-9B10-FDC30CBA8401}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7578B31D-7987-42F2-9B10-FDC30CBA8401}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7578B31D-7987-42F2-9B10-FDC30CBA8401}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {03C02E20-0C77-4660-A92A-A02CA346C8E8} + EndGlobalSection +EndGlobal diff --git a/tct-suite-vs/Resource/Tizen.Applications.MessagePort.Tests/code/MsgPortApp.Tizen/MsgPortApp.Tizen/MsgPortApp.Tizen.csproj b/tct-suite-vs/Resource/Tizen.Applications.MessagePort.Tests/code/MsgPortApp.Tizen/MsgPortApp.Tizen/MsgPortApp.Tizen.csproj new file mode 100755 index 000000000..d94c91687 --- /dev/null +++ b/tct-suite-vs/Resource/Tizen.Applications.MessagePort.Tests/code/MsgPortApp.Tizen/MsgPortApp.Tizen/MsgPortApp.Tizen.csproj @@ -0,0 +1,44 @@ + + + + + + $(MSBuildExtensionsPath)\Tizen\VisualStudio\ + + + + + + + + Exe + netcoreapp2.0 + + + + portable + + + None + + + + + + + + + + + + + + + + + + + + + + diff --git a/tct-suite-vs/Resource/Tizen.Applications.MessagePort.Tests/code/MsgPortApp.Tizen/MsgPortApp.Tizen/MsgPortApp.Tizen_App.cs b/tct-suite-vs/Resource/Tizen.Applications.MessagePort.Tests/code/MsgPortApp.Tizen/MsgPortApp.Tizen/MsgPortApp.Tizen_App.cs new file mode 100755 index 000000000..a1c5cbbf0 --- /dev/null +++ b/tct-suite-vs/Resource/Tizen.Applications.MessagePort.Tests/code/MsgPortApp.Tizen/MsgPortApp.Tizen/MsgPortApp.Tizen_App.cs @@ -0,0 +1,142 @@ +using Tizen.Applications; +using ElmSharp; +using Tizen.Applications.Messages; +using Tizen; + +namespace MsgPortApp.Tizen +{ + class App : CoreUIApplication + { + private static MessagePort _remotePort; + private static MessagePort _remotePort1; + private static MessagePort _testRemotePort; + private static MessagePort _controlRemotePort; + private Bundle _confirmMsg; + private static bool _flag; + + private string TAG; + protected override void OnCreate() + { + base.OnCreate(); + Initialize(); + + _confirmMsg = new Bundle(); + _confirmMsg.AddItem("ConfirmMessage", "Message is received"); + TAG = "MSGPORTAPP"; + + Log.Debug(TAG, "@@@@@@@ Create"); + _remotePort = new MessagePort("RemotePort", false); + Log.Debug(TAG, "@@@@@@@ MessagePort Create : " + _remotePort.PortName + "Trusted : " + _remotePort.Trusted); + + _remotePort.MessageReceived += MessageReceived_Callback; + _remotePort.Listen(); + + _remotePort1 = new MessagePort("RemotePort1", true); + _remotePort1.MessageReceived += TrustedMessageReceived_Callback; + _remotePort1.Listen(); + + Log.Debug(TAG, "@@### RemotePort Test MessagePort Create"); + + _testRemotePort = new MessagePort("TestRemotePort", false); + _testRemotePort.MessageReceived += RemotePortMessageReceived_Callback; + _testRemotePort.Listen(); + + _flag = true; + _controlRemotePort = new MessagePort("ControlRemotePort", false); + _controlRemotePort.MessageReceived += ControlRemotePortMessageReceived_Callback; + _controlRemotePort.Listen(); + } + + void Initialize() + { + Window window = new Window("ElmSharpApp") + { + AvailableRotations = DisplayRotation.Degree_0 | DisplayRotation.Degree_180 | DisplayRotation.Degree_270 | DisplayRotation.Degree_90 + }; + window.BackButtonPressed += (s, e) => + { + Exit(); + }; + window.Show(); + + var box = new Box(window) + { + AlignmentX = -1, + AlignmentY = -1, + WeightX = 1, + WeightY = 1, + }; + box.Show(); + + var bg = new Background(window) + { + Color = Color.White + }; + bg.SetContent(box); + + var conformant = new Conformant(window); + conformant.Show(); + conformant.SetContent(bg); + + var label = new Label(window) + { + Text = "Hello, Tizen", + }; + label.Show(); + box.PackEnd(label); + } + + private void MessageReceived_Callback(object sender, MessageReceivedEventArgs e) + { + Log.Debug(TAG, "@@@@@@@ Message Received"); + Log.Debug(TAG, "@@@@@@@ App ID : " + e.Remote.AppId); + Log.Debug(TAG, "@@@@@@@ PortName : " + e.Remote.PortName); + Log.Debug(TAG, "@@@@@@@ Trusted : " + e.Remote.Trusted); + Log.Debug(TAG, "@@@@@@@ message: " + e.Message.GetItem("message")); + + _remotePort.Send(_confirmMsg, "Tizen.Applications.MessagePort.Tests", "LocalPort"); + } + + private void TrustedMessageReceived_Callback(object sender, MessageReceivedEventArgs e) + { + Log.Debug(TAG, "@@@@@@@ Message Received"); + Log.Debug(TAG, "@@@@@@@ App ID : " + e.Remote.AppId); + Log.Debug(TAG, "@@@@@@@ PortName : " + e.Remote.PortName); + Log.Debug(TAG, "@@@@@@@ Trusted : " + e.Remote.Trusted); + Log.Debug(TAG, "@@@@@@@ message: " + e.Message.GetItem("message")); + + _remotePort1.Send(_confirmMsg, "Tizen.Applications.MessagePort.Tests", "LocalPort", true); + } + + private void RemotePortMessageReceived_Callback(object sender, MessageReceivedEventArgs e) + { + Log.Debug(TAG, "@@@### RemotePortMessageReceived_Callback Received"); + } + + private void ControlRemotePortMessageReceived_Callback(object sender, MessageReceivedEventArgs e) + { + Log.Debug(TAG, "@@@@@@@ ControlRemotePortMessageReceived_Callback Received"); + + if (_flag == true) + { + Log.Debug(TAG, "@@@### Stop TestRemotePort"); + _flag = false; + _testRemotePort.StopListening(); + } + else + { + Log.Debug(TAG, "@@@### Listen TestRemotePort"); + _flag = true; + _testRemotePort.Listen(); + } + } + + static void Main(string[] args) + { + Elementary.Initialize(); + Elementary.ThemeOverlay(); + App app = new App(); + app.Run(args); + } + } +} diff --git a/tct-suite-vs/Resource/Tizen.Applications.MessagePort.Tests/code/MsgPortApp.Tizen/MsgPortApp.Tizen/shared/res/MsgPortApp.Tizen.png b/tct-suite-vs/Resource/Tizen.Applications.MessagePort.Tests/code/MsgPortApp.Tizen/MsgPortApp.Tizen/shared/res/MsgPortApp.Tizen.png new file mode 100755 index 000000000..9f3cb9860 Binary files /dev/null and b/tct-suite-vs/Resource/Tizen.Applications.MessagePort.Tests/code/MsgPortApp.Tizen/MsgPortApp.Tizen/shared/res/MsgPortApp.Tizen.png differ diff --git a/tct-suite-vs/Resource/Tizen.Applications.MessagePort.Tests/code/MsgPortApp.Tizen/MsgPortApp.Tizen/tizen-manifest.xml b/tct-suite-vs/Resource/Tizen.Applications.MessagePort.Tests/code/MsgPortApp.Tizen/MsgPortApp.Tizen/tizen-manifest.xml new file mode 100755 index 000000000..2cfd55b4a --- /dev/null +++ b/tct-suite-vs/Resource/Tizen.Applications.MessagePort.Tests/code/MsgPortApp.Tizen/MsgPortApp.Tizen/tizen-manifest.xml @@ -0,0 +1,16 @@ + + + + + + MsgPortApp.Tizen.png + + + + + + + + + + diff --git a/tct-suite-vs/Resource/Tizen.Applications.MessagePort.Tests/code/MsgPortApp1.Tizen/MsgPortApp1.Tizen.sln b/tct-suite-vs/Resource/Tizen.Applications.MessagePort.Tests/code/MsgPortApp1.Tizen/MsgPortApp1.Tizen.sln new file mode 100755 index 000000000..db67ff5a0 --- /dev/null +++ b/tct-suite-vs/Resource/Tizen.Applications.MessagePort.Tests/code/MsgPortApp1.Tizen/MsgPortApp1.Tizen.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +VisualStudioVersion = 15.0.26730.10 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MsgPortApp1.Tizen", "MsgPortApp1.Tizen\MsgPortApp1.Tizen.csproj", "{1A3B63B0-6674-4FF1-AA59-A4CFD65E0A94}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {1A3B63B0-6674-4FF1-AA59-A4CFD65E0A94}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1A3B63B0-6674-4FF1-AA59-A4CFD65E0A94}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1A3B63B0-6674-4FF1-AA59-A4CFD65E0A94}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1A3B63B0-6674-4FF1-AA59-A4CFD65E0A94}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {B71F68E2-8F43-4D76-A935-77EFB31BA1E3} + EndGlobalSection +EndGlobal diff --git a/tct-suite-vs/Resource/Tizen.Applications.MessagePort.Tests/code/MsgPortApp1.Tizen/MsgPortApp1.Tizen/MsgPortApp1.Tizen.csproj b/tct-suite-vs/Resource/Tizen.Applications.MessagePort.Tests/code/MsgPortApp1.Tizen/MsgPortApp1.Tizen/MsgPortApp1.Tizen.csproj new file mode 100755 index 000000000..d94c91687 --- /dev/null +++ b/tct-suite-vs/Resource/Tizen.Applications.MessagePort.Tests/code/MsgPortApp1.Tizen/MsgPortApp1.Tizen/MsgPortApp1.Tizen.csproj @@ -0,0 +1,44 @@ + + + + + + $(MSBuildExtensionsPath)\Tizen\VisualStudio\ + + + + + + + + Exe + netcoreapp2.0 + + + + portable + + + None + + + + + + + + + + + + + + + + + + + + + + diff --git a/tct-suite-vs/Resource/Tizen.Applications.MessagePort.Tests/code/MsgPortApp1.Tizen/MsgPortApp1.Tizen/MsgPortApp1.Tizen_App.cs b/tct-suite-vs/Resource/Tizen.Applications.MessagePort.Tests/code/MsgPortApp1.Tizen/MsgPortApp1.Tizen/MsgPortApp1.Tizen_App.cs new file mode 100755 index 000000000..25278f2f8 --- /dev/null +++ b/tct-suite-vs/Resource/Tizen.Applications.MessagePort.Tests/code/MsgPortApp1.Tizen/MsgPortApp1.Tizen/MsgPortApp1.Tizen_App.cs @@ -0,0 +1,88 @@ +using Tizen.Applications; +using ElmSharp; +using Tizen; +using Tizen.Applications.Messages; + +namespace MsgPortApp1.Tizen +{ + class App : CoreUIApplication + { + private static MessagePort _remotePort; + private Bundle _confirmMsg; + private static string TAG; + protected override void OnCreate() + { + base.OnCreate(); + Initialize(); + + _confirmMsg = new Bundle(); + _confirmMsg.AddItem("ConfirmMessage", "Message is received"); + TAG = "MSGPORTAPP1"; + + Log.Debug(TAG, "@@@@@@@ Create"); + _remotePort = new MessagePort("RemotePort", false); + Log.Debug(TAG, "@@@@@@@ MessagePort-MsgPortApp1 Create : " + _remotePort.PortName + "Trusted : " + _remotePort.Trusted); + + _remotePort.MessageReceived += MessageReceived_Callback; + _remotePort.Listen(); + } + + void Initialize() + { + Window window = new Window("ElmSharpApp") + { + AvailableRotations = DisplayRotation.Degree_0 | DisplayRotation.Degree_180 | DisplayRotation.Degree_270 | DisplayRotation.Degree_90 + }; + window.BackButtonPressed += (s, e) => + { + Exit(); + }; + window.Show(); + + var box = new Box(window) + { + AlignmentX = -1, + AlignmentY = -1, + WeightX = 1, + WeightY = 1, + }; + box.Show(); + + var bg = new Background(window) + { + Color = Color.White + }; + bg.SetContent(box); + + var conformant = new Conformant(window); + conformant.Show(); + conformant.SetContent(bg); + + var label = new Label(window) + { + Text = "Hello, Tizen", + }; + label.Show(); + box.PackEnd(label); + } + + private void MessageReceived_Callback(object sender, MessageReceivedEventArgs e) + { + Log.Debug(TAG, "@@@@@@@ Message Received"); + Log.Debug(TAG, "@@@@@@@ App ID : " + e.Remote.AppId); + Log.Debug(TAG, "@@@@@@@ PortName : " + e.Remote.PortName); + Log.Debug(TAG, "@@@@@@@ Trusted : " + e.Remote.Trusted); + Log.Debug(TAG, "@@@@@@@ message: " + e.Message.GetItem("message")); + + _remotePort.Send(_confirmMsg, "Tizen.Applications.MessagePort.Tests", "LocalPort"); + } + + static void Main(string[] args) + { + Elementary.Initialize(); + Elementary.ThemeOverlay(); + App app = new App(); + app.Run(args); + } + } +} diff --git a/tct-suite-vs/Resource/Tizen.Applications.MessagePort.Tests/code/MsgPortApp1.Tizen/MsgPortApp1.Tizen/shared/res/MsgPortApp1.Tizen.png b/tct-suite-vs/Resource/Tizen.Applications.MessagePort.Tests/code/MsgPortApp1.Tizen/MsgPortApp1.Tizen/shared/res/MsgPortApp1.Tizen.png new file mode 100755 index 000000000..9f3cb9860 Binary files /dev/null and b/tct-suite-vs/Resource/Tizen.Applications.MessagePort.Tests/code/MsgPortApp1.Tizen/MsgPortApp1.Tizen/shared/res/MsgPortApp1.Tizen.png differ diff --git a/tct-suite-vs/Resource/Tizen.Applications.MessagePort.Tests/code/MsgPortApp1.Tizen/MsgPortApp1.Tizen/tizen-manifest.xml b/tct-suite-vs/Resource/Tizen.Applications.MessagePort.Tests/code/MsgPortApp1.Tizen/MsgPortApp1.Tizen/tizen-manifest.xml new file mode 100755 index 000000000..1a9c94c47 --- /dev/null +++ b/tct-suite-vs/Resource/Tizen.Applications.MessagePort.Tests/code/MsgPortApp1.Tizen/MsgPortApp1.Tizen/tizen-manifest.xml @@ -0,0 +1,16 @@ + + + + + + MsgPortApp1.Tizen.png + + + + + + + + + + diff --git a/tct-suite-vs/Resource/Tizen.Applications.MessagePort.Tests/org.tizen.MsgPortApp.Tizen-1.0.0.tpk b/tct-suite-vs/Resource/Tizen.Applications.MessagePort.Tests/org.tizen.MsgPortApp.Tizen-1.0.0.tpk new file mode 100755 index 000000000..f2cccfc58 Binary files /dev/null and b/tct-suite-vs/Resource/Tizen.Applications.MessagePort.Tests/org.tizen.MsgPortApp.Tizen-1.0.0.tpk differ diff --git a/tct-suite-vs/Resource/Tizen.Applications.MessagePort.Tests/org.tizen.MsgPortApp1.Tizen-1.0.0.tpk b/tct-suite-vs/Resource/Tizen.Applications.MessagePort.Tests/org.tizen.MsgPortApp1.Tizen-1.0.0.tpk new file mode 100755 index 000000000..2811498e5 Binary files /dev/null and b/tct-suite-vs/Resource/Tizen.Applications.MessagePort.Tests/org.tizen.MsgPortApp1.Tizen-1.0.0.tpk differ diff --git a/tct-suite-vs/Resource/Tizen.Applications.RPCPort.Tests/code/org.tizen.example.RpcPortProxy/RpcPortProxy.sln b/tct-suite-vs/Resource/Tizen.Applications.RPCPort.Tests/code/org.tizen.example.RpcPortProxy/RpcPortProxy.sln new file mode 100755 index 000000000..c93784213 --- /dev/null +++ b/tct-suite-vs/Resource/Tizen.Applications.RPCPort.Tests/code/org.tizen.example.RpcPortProxy/RpcPortProxy.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +VisualStudioVersion = 15.0.27703.2035 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RpcPortProxy", "RpcPortProxy\RpcPortProxy.csproj", "{B4C8261C-D74F-43D1-A075-B9E242851D31}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {B4C8261C-D74F-43D1-A075-B9E242851D31}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B4C8261C-D74F-43D1-A075-B9E242851D31}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B4C8261C-D74F-43D1-A075-B9E242851D31}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B4C8261C-D74F-43D1-A075-B9E242851D31}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {3E5007AD-1998-4272-8437-26CDC3729698} + EndGlobalSection +EndGlobal diff --git a/tct-suite-vs/Resource/Tizen.Applications.RPCPort.Tests/code/org.tizen.example.RpcPortProxy/RpcPortProxy/RpcPortProxy.csproj b/tct-suite-vs/Resource/Tizen.Applications.RPCPort.Tests/code/org.tizen.example.RpcPortProxy/RpcPortProxy/RpcPortProxy.csproj new file mode 100755 index 000000000..bfbbbf8c6 --- /dev/null +++ b/tct-suite-vs/Resource/Tizen.Applications.RPCPort.Tests/code/org.tizen.example.RpcPortProxy/RpcPortProxy/RpcPortProxy.csproj @@ -0,0 +1,44 @@ + + + + + + $(MSBuildExtensionsPath)\Tizen\VisualStudio\ + + + + + + + + Exe + netcoreapp2.0 + + + + portable + + + None + + + + + + + + + + + + + + + + + + + + + + diff --git a/tct-suite-vs/Resource/Tizen.Applications.RPCPort.Tests/code/org.tizen.example.RpcPortProxy/RpcPortProxy/RpcPortProxy_App.cs b/tct-suite-vs/Resource/Tizen.Applications.RPCPort.Tests/code/org.tizen.example.RpcPortProxy/RpcPortProxy/RpcPortProxy_App.cs new file mode 100755 index 000000000..68dbd87c5 --- /dev/null +++ b/tct-suite-vs/Resource/Tizen.Applications.RPCPort.Tests/code/org.tizen.example.RpcPortProxy/RpcPortProxy/RpcPortProxy_App.cs @@ -0,0 +1,125 @@ +using System.Threading; +using Tizen; +using Tizen.Applications; +using Tizen.Applications.RPCPort; + +namespace RpcPortProxy +{ + class App : ServiceApplication + { + private Proxy _proxy; + + class Proxy : ProxyBase + { + private Timer _timer; + private bool _send; + + public Proxy(bool send) + { + _timer = new Timer(new TimerCallback(OnTimeout)); + _timer.Change(100, 0); + _send = send; + } + + private void OnTimeout(object state) + { + Connect("Tizen.Applications.RPCPort.Tests", "Test"); + _timer.Dispose(); + _timer = null; + } + + protected override void OnConnectedEvent(string endPoint, string portName, Port port) + { + Log.Debug("RPCPortProxy", "OnConnectedEvent: endPoint:" + endPoint + " port:" + portName); + if (_send) + { + using (var p = new Parcel()) + { + p.WriteString("hello"); + p.Send(port); + } + } + } + + protected override void OnDisconnectedEvent(string endPoint, string portName) + { + Log.Debug("RPCPortProxy", "OnDisconnectedEvent: endPoint:" + endPoint + " port:" + portName); + } + + protected override void OnReceivedEvent(string endPoint, string portName) + { + Log.Debug("RPCPortProxy", "OnReceivedEvent: endPoint:" + endPoint + " port:" + portName); + } + + protected override void OnRejectedEvent(string endPoint, string portName) + { + Log.Debug("RPCPortProxy", "OnRejectedEvent: endPoint:" + endPoint + " port:" + portName); + } + } + + protected override void OnCreate() + { + base.OnCreate(); + } + + protected override void OnAppControlReceived(AppControlReceivedEventArgs e) + { + base.OnAppControlReceived(e); + if (e.ReceivedAppControl.ExtraData.TryGet("Test", out string val)) + { + if (val.Equals("finish")) + { + Log.Debug("RPCPortProxy", "Finish"); + Exit(); + } + } + else + { + Log.Debug("RPCPortProxy", "Connecting"); + _proxy?.Dispose(); + if (e.ReceivedAppControl.ExtraData.TryGet("send", out string v)) + _proxy = new Proxy(true); + else + _proxy = new Proxy(false); + } + } + + protected override void OnDeviceOrientationChanged(DeviceOrientationEventArgs e) + { + base.OnDeviceOrientationChanged(e); + } + + protected override void OnLocaleChanged(LocaleChangedEventArgs e) + { + base.OnLocaleChanged(e); + } + + protected override void OnLowBattery(LowBatteryEventArgs e) + { + base.OnLowBattery(e); + } + + protected override void OnLowMemory(LowMemoryEventArgs e) + { + base.OnLowMemory(e); + } + + protected override void OnRegionFormatChanged(RegionFormatChangedEventArgs e) + { + base.OnRegionFormatChanged(e); + } + + protected override void OnTerminate() + { + _proxy?.Dispose(); + _proxy = null; + base.OnTerminate(); + } + + static void Main(string[] args) + { + App app = new App(); + app.Run(args); + } + } +} diff --git a/tct-suite-vs/Resource/Tizen.Applications.RPCPort.Tests/code/org.tizen.example.RpcPortProxy/RpcPortProxy/shared/res/RpcPortProxy.png b/tct-suite-vs/Resource/Tizen.Applications.RPCPort.Tests/code/org.tizen.example.RpcPortProxy/RpcPortProxy/shared/res/RpcPortProxy.png new file mode 100755 index 000000000..9f3cb9860 Binary files /dev/null and b/tct-suite-vs/Resource/Tizen.Applications.RPCPort.Tests/code/org.tizen.example.RpcPortProxy/RpcPortProxy/shared/res/RpcPortProxy.png differ diff --git a/tct-suite-vs/Resource/Tizen.Applications.RPCPort.Tests/code/org.tizen.example.RpcPortProxy/RpcPortProxy/tizen-manifest.xml b/tct-suite-vs/Resource/Tizen.Applications.RPCPort.Tests/code/org.tizen.example.RpcPortProxy/RpcPortProxy/tizen-manifest.xml new file mode 100755 index 000000000..5401ef0a1 --- /dev/null +++ b/tct-suite-vs/Resource/Tizen.Applications.RPCPort.Tests/code/org.tizen.example.RpcPortProxy/RpcPortProxy/tizen-manifest.xml @@ -0,0 +1,17 @@ + + + + + + RpcPortProxy.png + + + + + + http://tizen.org/privilege/appmanager.launch + http://tizen.org/privilege/datasharing + + + + diff --git a/tct-suite-vs/Resource/Tizen.Applications.RPCPort.Tests/code/org.tizen.example.RpcPortProxy2/RpcPortProxy2.sln b/tct-suite-vs/Resource/Tizen.Applications.RPCPort.Tests/code/org.tizen.example.RpcPortProxy2/RpcPortProxy2.sln new file mode 100755 index 000000000..df07963a6 --- /dev/null +++ b/tct-suite-vs/Resource/Tizen.Applications.RPCPort.Tests/code/org.tizen.example.RpcPortProxy2/RpcPortProxy2.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +VisualStudioVersion = 15.0.27703.2035 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RpcPortProxy2", "RpcPortProxy2\RpcPortProxy2.csproj", "{E877EB41-209D-417B-9E72-7095BBBF7604}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {E877EB41-209D-417B-9E72-7095BBBF7604}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E877EB41-209D-417B-9E72-7095BBBF7604}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E877EB41-209D-417B-9E72-7095BBBF7604}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E877EB41-209D-417B-9E72-7095BBBF7604}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {E8C497F1-5425-439D-8021-3A6D9BF04ED4} + EndGlobalSection +EndGlobal diff --git a/tct-suite-vs/Resource/Tizen.Applications.RPCPort.Tests/code/org.tizen.example.RpcPortProxy2/RpcPortProxy2/RpcPortProxy2.csproj b/tct-suite-vs/Resource/Tizen.Applications.RPCPort.Tests/code/org.tizen.example.RpcPortProxy2/RpcPortProxy2/RpcPortProxy2.csproj new file mode 100755 index 000000000..490b33fa8 --- /dev/null +++ b/tct-suite-vs/Resource/Tizen.Applications.RPCPort.Tests/code/org.tizen.example.RpcPortProxy2/RpcPortProxy2/RpcPortProxy2.csproj @@ -0,0 +1,44 @@ + + + + + + $(MSBuildExtensionsPath)\Tizen\VisualStudio\ + + + + + + + + Exe + netcoreapp2.0 + + + + portable + + + None + + + + + + + + + + + + + + + + + + + + + + diff --git a/tct-suite-vs/Resource/Tizen.Applications.RPCPort.Tests/code/org.tizen.example.RpcPortProxy2/RpcPortProxy2/RpcPortProxy2_App.cs b/tct-suite-vs/Resource/Tizen.Applications.RPCPort.Tests/code/org.tizen.example.RpcPortProxy2/RpcPortProxy2/RpcPortProxy2_App.cs new file mode 100755 index 000000000..0d79ff4f9 --- /dev/null +++ b/tct-suite-vs/Resource/Tizen.Applications.RPCPort.Tests/code/org.tizen.example.RpcPortProxy2/RpcPortProxy2/RpcPortProxy2_App.cs @@ -0,0 +1,116 @@ +using System; +using System.Threading; +using Tizen; +using Tizen.Applications; +using Tizen.Applications.RPCPort; + +namespace RpcPortProxy +{ + class App : ServiceApplication + { + private Proxy _proxy; + + class Proxy : ProxyBase + { + public Proxy() + { + Connect("org.tizen.example.RpcPortStub", "Test"); + } + + protected override void OnConnectedEvent(string endPoint, string portName, Port port) + { + Log.Debug("RPCPortProxy", "OnConnectedEvent: endPoint:" + endPoint + " port:" + portName); + } + + protected override void OnDisconnectedEvent(string endPoint, string portName) + { + Log.Debug("RPCPortProxy", "OnDisconnectedEvent: endPoint:" + endPoint + " port:" + portName); + } + + protected override void OnReceivedEvent(string endPoint, string portName) + { + Log.Debug("RPCPortProxy", "OnReceivedEvent: endPoint:" + endPoint + " port:" + portName); + } + + protected override void OnRejectedEvent(string endPoint, string portName) + { + Log.Debug("RPCPortProxy", "OnRejectedEvent: endPoint:" + endPoint + " port:" + portName); + } + } + + protected override void OnCreate() + { + base.OnCreate(); + } + + protected override void OnAppControlReceived(AppControlReceivedEventArgs e) + { + base.OnAppControlReceived(e); + if (e.ReceivedAppControl.ExtraData.TryGet("Test", out string val)) + { + if (val.Equals("finish")) + { + Log.Debug("RPCPortProxy", "Finish"); + Exit(); + } + } + else + { + Log.Debug("RPCPortProxy", "Connecting"); + _proxy?.Dispose(); + + try + { + _proxy = new Proxy(); + } + catch (PermissionDeniedException) + { + Log.Debug("RPCPortProxy", "PermissionDeniedException happened"); + e.ReceivedAppControl.ReplyToLaunchRequest(new AppControl(), AppControlReplyResult.Succeeded); + } + catch (Exception ex) + { + Log.Debug("RPCPortProxy", "Uncatched exception " + ex.ToString()); + } + } + } + + protected override void OnDeviceOrientationChanged(DeviceOrientationEventArgs e) + { + base.OnDeviceOrientationChanged(e); + } + + protected override void OnLocaleChanged(LocaleChangedEventArgs e) + { + base.OnLocaleChanged(e); + } + + protected override void OnLowBattery(LowBatteryEventArgs e) + { + base.OnLowBattery(e); + } + + protected override void OnLowMemory(LowMemoryEventArgs e) + { + base.OnLowMemory(e); + } + + protected override void OnRegionFormatChanged(RegionFormatChangedEventArgs e) + { + base.OnRegionFormatChanged(e); + } + + protected override void OnTerminate() + { + _proxy?.Dispose(); + _proxy = null; + base.OnTerminate(); + } + + static void Main(string[] args) + { + App app = new App(); + app.Run(args); + } + } +} diff --git a/tct-suite-vs/Resource/Tizen.Applications.RPCPort.Tests/code/org.tizen.example.RpcPortProxy2/RpcPortProxy2/shared/res/RpcPortProxy2.png b/tct-suite-vs/Resource/Tizen.Applications.RPCPort.Tests/code/org.tizen.example.RpcPortProxy2/RpcPortProxy2/shared/res/RpcPortProxy2.png new file mode 100755 index 000000000..9f3cb9860 Binary files /dev/null and b/tct-suite-vs/Resource/Tizen.Applications.RPCPort.Tests/code/org.tizen.example.RpcPortProxy2/RpcPortProxy2/shared/res/RpcPortProxy2.png differ diff --git a/tct-suite-vs/Resource/Tizen.Applications.RPCPort.Tests/code/org.tizen.example.RpcPortProxy2/RpcPortProxy2/tizen-manifest.xml b/tct-suite-vs/Resource/Tizen.Applications.RPCPort.Tests/code/org.tizen.example.RpcPortProxy2/RpcPortProxy2/tizen-manifest.xml new file mode 100755 index 000000000..a72a28822 --- /dev/null +++ b/tct-suite-vs/Resource/Tizen.Applications.RPCPort.Tests/code/org.tizen.example.RpcPortProxy2/RpcPortProxy2/tizen-manifest.xml @@ -0,0 +1,15 @@ + + + + + + RpcPortProxy2.png + + + + + + http://tizen.org/privilege/appmanager.launch + + + diff --git a/tct-suite-vs/Resource/Tizen.Applications.RPCPort.Tests/code/org.tizen.example.RpcPortStub/RpcPortStub.sln b/tct-suite-vs/Resource/Tizen.Applications.RPCPort.Tests/code/org.tizen.example.RpcPortStub/RpcPortStub.sln new file mode 100755 index 000000000..4d59ee918 --- /dev/null +++ b/tct-suite-vs/Resource/Tizen.Applications.RPCPort.Tests/code/org.tizen.example.RpcPortStub/RpcPortStub.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +VisualStudioVersion = 15.0.27703.2035 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RpcPortStub", "RpcPortStub\RpcPortStub.csproj", "{FE0280FD-12A8-4B3D-A035-D73CFF4C2ECF}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {FE0280FD-12A8-4B3D-A035-D73CFF4C2ECF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FE0280FD-12A8-4B3D-A035-D73CFF4C2ECF}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FE0280FD-12A8-4B3D-A035-D73CFF4C2ECF}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FE0280FD-12A8-4B3D-A035-D73CFF4C2ECF}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {C6927ABD-FBB9-450E-BD87-9152B5AD5C22} + EndGlobalSection +EndGlobal diff --git a/tct-suite-vs/Resource/Tizen.Applications.RPCPort.Tests/code/org.tizen.example.RpcPortStub/RpcPortStub/RpcPortStub.csproj b/tct-suite-vs/Resource/Tizen.Applications.RPCPort.Tests/code/org.tizen.example.RpcPortStub/RpcPortStub/RpcPortStub.csproj new file mode 100755 index 000000000..bfbbbf8c6 --- /dev/null +++ b/tct-suite-vs/Resource/Tizen.Applications.RPCPort.Tests/code/org.tizen.example.RpcPortStub/RpcPortStub/RpcPortStub.csproj @@ -0,0 +1,44 @@ + + + + + + $(MSBuildExtensionsPath)\Tizen\VisualStudio\ + + + + + + + + Exe + netcoreapp2.0 + + + + portable + + + None + + + + + + + + + + + + + + + + + + + + + + diff --git a/tct-suite-vs/Resource/Tizen.Applications.RPCPort.Tests/code/org.tizen.example.RpcPortStub/RpcPortStub/RpcPortStub_App.cs b/tct-suite-vs/Resource/Tizen.Applications.RPCPort.Tests/code/org.tizen.example.RpcPortStub/RpcPortStub/RpcPortStub_App.cs new file mode 100755 index 000000000..a8d963c4d --- /dev/null +++ b/tct-suite-vs/Resource/Tizen.Applications.RPCPort.Tests/code/org.tizen.example.RpcPortStub/RpcPortStub/RpcPortStub_App.cs @@ -0,0 +1,114 @@ +using System; +using Tizen; +using Tizen.Applications; +using Tizen.Applications.RPCPort; + +namespace RpcPortStub +{ + class App : ServiceApplication + { + private Stub _stub; + + private class Stub : StubBase + { + public Stub(string portName) : base(portName) + { + Listen(); + } + + protected override void OnConnectedEvent(string sender, string instance) + { + Log.Debug("RPCPortStub", "OnConnectedEvent: sender::" + sender + " instance::" + instance); + } + + protected override void OnDisconnectedEvent(string sender, string instance) + { + Log.Debug("RPCPortStub", "OnDisconnectedEvent: sender::" + sender + " instance::" + instance); + } + + protected override bool OnReceivedEvent(string sender, string instance, Port port) + { + Log.Debug("RPCPortStub", "OnReceivedEvent: sender::" + sender + " instance::" + instance); + try + { + using (Parcel p = new Parcel(port)) + { + string str = p.ReadString(); + using (Parcel ret = new Parcel()) + { + ret.WriteString(str); + ret.Send(GetPort(Port.Type.Callback, instance)); + } + } + } + catch (Exception) + { + Log.Error("RPCPortStub", "Exception happens"); + return false; + } + + return true; + } + + protected override void OnTerminatedEvent() + { + Log.Debug("RPCPortStub", "OnTerminatedEvent"); + } + } + + protected override void OnCreate() + { + base.OnCreate(); + _stub = new Stub("Test"); + } + + protected override void OnAppControlReceived(AppControlReceivedEventArgs e) + { + base.OnAppControlReceived(e); + if (e.ReceivedAppControl.ExtraData.TryGet("Test", out string val)) + { + if (val.Equals("finish")) { + Log.Debug("RPCPortStub", "Finish"); + Exit(); + } + } + } + + protected override void OnDeviceOrientationChanged(DeviceOrientationEventArgs e) + { + base.OnDeviceOrientationChanged(e); + } + + protected override void OnLocaleChanged(LocaleChangedEventArgs e) + { + base.OnLocaleChanged(e); + } + + protected override void OnLowBattery(LowBatteryEventArgs e) + { + base.OnLowBattery(e); + } + + protected override void OnLowMemory(LowMemoryEventArgs e) + { + base.OnLowMemory(e); + } + + protected override void OnRegionFormatChanged(RegionFormatChangedEventArgs e) + { + base.OnRegionFormatChanged(e); + } + + protected override void OnTerminate() + { + base.OnTerminate(); + _stub?.Dispose(); + } + + static void Main(string[] args) + { + App app = new App(); + app.Run(args); + } + } +} diff --git a/tct-suite-vs/Resource/Tizen.Applications.RPCPort.Tests/code/org.tizen.example.RpcPortStub/RpcPortStub/shared/res/RpcPortStub.png b/tct-suite-vs/Resource/Tizen.Applications.RPCPort.Tests/code/org.tizen.example.RpcPortStub/RpcPortStub/shared/res/RpcPortStub.png new file mode 100755 index 000000000..9f3cb9860 Binary files /dev/null and b/tct-suite-vs/Resource/Tizen.Applications.RPCPort.Tests/code/org.tizen.example.RpcPortStub/RpcPortStub/shared/res/RpcPortStub.png differ diff --git a/tct-suite-vs/Resource/Tizen.Applications.RPCPort.Tests/code/org.tizen.example.RpcPortStub/RpcPortStub/tizen-manifest.xml b/tct-suite-vs/Resource/Tizen.Applications.RPCPort.Tests/code/org.tizen.example.RpcPortStub/RpcPortStub/tizen-manifest.xml new file mode 100755 index 000000000..0f7f97c9c --- /dev/null +++ b/tct-suite-vs/Resource/Tizen.Applications.RPCPort.Tests/code/org.tizen.example.RpcPortStub/RpcPortStub/tizen-manifest.xml @@ -0,0 +1,13 @@ + + + + + + RpcPortStub.png + + + + + + + diff --git a/tct-suite-vs/Resource/Tizen.Applications.RPCPort.Tests/code/org.tizen.example.RpcPortStub2/RpcPortStub2.sln b/tct-suite-vs/Resource/Tizen.Applications.RPCPort.Tests/code/org.tizen.example.RpcPortStub2/RpcPortStub2.sln new file mode 100755 index 000000000..dc3612664 --- /dev/null +++ b/tct-suite-vs/Resource/Tizen.Applications.RPCPort.Tests/code/org.tizen.example.RpcPortStub2/RpcPortStub2.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +VisualStudioVersion = 15.0.27703.2035 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RpcPortStub2", "RpcPortStub2\RpcPortStub2.csproj", "{D84E03B5-7EFF-40B6-981A-BC0316180DAE}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {D84E03B5-7EFF-40B6-981A-BC0316180DAE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D84E03B5-7EFF-40B6-981A-BC0316180DAE}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D84E03B5-7EFF-40B6-981A-BC0316180DAE}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D84E03B5-7EFF-40B6-981A-BC0316180DAE}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {934AC992-DE63-472C-AD51-4386E224BCD4} + EndGlobalSection +EndGlobal diff --git a/tct-suite-vs/Resource/Tizen.Applications.RPCPort.Tests/code/org.tizen.example.RpcPortStub2/RpcPortStub2/RpcPortStub2.csproj b/tct-suite-vs/Resource/Tizen.Applications.RPCPort.Tests/code/org.tizen.example.RpcPortStub2/RpcPortStub2/RpcPortStub2.csproj new file mode 100755 index 000000000..e6d2acded --- /dev/null +++ b/tct-suite-vs/Resource/Tizen.Applications.RPCPort.Tests/code/org.tizen.example.RpcPortStub2/RpcPortStub2/RpcPortStub2.csproj @@ -0,0 +1,44 @@ + + + + + + $(MSBuildExtensionsPath)\Tizen\VisualStudio\ + + + + + + + + Exe + netcoreapp2.0 + + + + portable + + + None + + + + + + + + + + + + + + + + + + + + + + diff --git a/tct-suite-vs/Resource/Tizen.Applications.RPCPort.Tests/code/org.tizen.example.RpcPortStub2/RpcPortStub2/RpcPortStub2_App.cs b/tct-suite-vs/Resource/Tizen.Applications.RPCPort.Tests/code/org.tizen.example.RpcPortStub2/RpcPortStub2/RpcPortStub2_App.cs new file mode 100755 index 000000000..ba8a2b5a9 --- /dev/null +++ b/tct-suite-vs/Resource/Tizen.Applications.RPCPort.Tests/code/org.tizen.example.RpcPortStub2/RpcPortStub2/RpcPortStub2_App.cs @@ -0,0 +1,101 @@ +using Tizen; +using Tizen.Applications; +using Tizen.Applications.RPCPort; + +namespace RpcPortStub +{ + class App : ServiceApplication + { + private Stub _stub; + + private class Stub : StubBase + { + public Stub(string portName) : base(portName) + { + AddPrivilege("my.privilege"); + Listen(); + } + + protected override void OnConnectedEvent(string sender, string instance) + { + Log.Debug("RPCPortStub2", "OnConnectedEvent: sender::" + sender + " instance::" + instance); + } + + protected override void OnDisconnectedEvent(string sender, string instance) + { + Log.Debug("RPCPortStub2", "OnDisconnectedEvent: sender::" + sender + " instance::" + instance); + } + + protected override bool OnReceivedEvent(string sender, string instance, Port port) + { + Log.Debug("RPCPortStub2", "OnReceivedEvent: sender::" + sender + " instance::" + instance); + using (Parcel p = new Parcel(port)) + { + } + + return true; + } + + protected override void OnTerminatedEvent() + { + Log.Debug("RPCPortStub2", "OnTerminatedEvent"); + } + } + + protected override void OnCreate() + { + base.OnCreate(); + _stub = new Stub("Test"); + } + + protected override void OnAppControlReceived(AppControlReceivedEventArgs e) + { + base.OnAppControlReceived(e); + if (e.ReceivedAppControl.ExtraData.TryGet("Test", out string val)) + { + if (val.Equals("finish")) + { + Log.Debug("RPCPortStub2", "Finish"); + Exit(); + } + } + } + + protected override void OnDeviceOrientationChanged(DeviceOrientationEventArgs e) + { + base.OnDeviceOrientationChanged(e); + } + + protected override void OnLocaleChanged(LocaleChangedEventArgs e) + { + base.OnLocaleChanged(e); + } + + protected override void OnLowBattery(LowBatteryEventArgs e) + { + base.OnLowBattery(e); + } + + protected override void OnLowMemory(LowMemoryEventArgs e) + { + base.OnLowMemory(e); + } + + protected override void OnRegionFormatChanged(RegionFormatChangedEventArgs e) + { + base.OnRegionFormatChanged(e); + } + + protected override void OnTerminate() + { + base.OnTerminate(); + _stub?.Dispose(); + } + + static void Main(string[] args) + { + App app = new App(); + app.Run(args); + } + } +} diff --git a/tct-suite-vs/Resource/Tizen.Applications.RPCPort.Tests/code/org.tizen.example.RpcPortStub2/RpcPortStub2/shared/res/RpcPortStub2.png b/tct-suite-vs/Resource/Tizen.Applications.RPCPort.Tests/code/org.tizen.example.RpcPortStub2/RpcPortStub2/shared/res/RpcPortStub2.png new file mode 100755 index 000000000..9f3cb9860 Binary files /dev/null and b/tct-suite-vs/Resource/Tizen.Applications.RPCPort.Tests/code/org.tizen.example.RpcPortStub2/RpcPortStub2/shared/res/RpcPortStub2.png differ diff --git a/tct-suite-vs/Resource/Tizen.Applications.RPCPort.Tests/code/org.tizen.example.RpcPortStub2/RpcPortStub2/tizen-manifest.xml b/tct-suite-vs/Resource/Tizen.Applications.RPCPort.Tests/code/org.tizen.example.RpcPortStub2/RpcPortStub2/tizen-manifest.xml new file mode 100755 index 000000000..d54451749 --- /dev/null +++ b/tct-suite-vs/Resource/Tizen.Applications.RPCPort.Tests/code/org.tizen.example.RpcPortStub2/RpcPortStub2/tizen-manifest.xml @@ -0,0 +1,13 @@ + + + + + + RpcPortStub2.png + + + + + + + diff --git a/tct-suite-vs/Resource/Tizen.Applications.RPCPort.Tests/org.tizen.example.RpcPortProxy-1.0.0.tpk b/tct-suite-vs/Resource/Tizen.Applications.RPCPort.Tests/org.tizen.example.RpcPortProxy-1.0.0.tpk new file mode 100755 index 000000000..3558160c0 Binary files /dev/null and b/tct-suite-vs/Resource/Tizen.Applications.RPCPort.Tests/org.tizen.example.RpcPortProxy-1.0.0.tpk differ diff --git a/tct-suite-vs/Resource/Tizen.Applications.RPCPort.Tests/org.tizen.example.RpcPortProxy2-1.0.0.tpk b/tct-suite-vs/Resource/Tizen.Applications.RPCPort.Tests/org.tizen.example.RpcPortProxy2-1.0.0.tpk new file mode 100755 index 000000000..fa344415a Binary files /dev/null and b/tct-suite-vs/Resource/Tizen.Applications.RPCPort.Tests/org.tizen.example.RpcPortProxy2-1.0.0.tpk differ diff --git a/tct-suite-vs/Resource/Tizen.Applications.RPCPort.Tests/org.tizen.example.RpcPortStub-1.0.0.tpk b/tct-suite-vs/Resource/Tizen.Applications.RPCPort.Tests/org.tizen.example.RpcPortStub-1.0.0.tpk new file mode 100755 index 000000000..84c1134e0 Binary files /dev/null and b/tct-suite-vs/Resource/Tizen.Applications.RPCPort.Tests/org.tizen.example.RpcPortStub-1.0.0.tpk differ diff --git a/tct-suite-vs/Resource/Tizen.Applications.RPCPort.Tests/org.tizen.example.RpcPortStub2-1.0.0.tpk b/tct-suite-vs/Resource/Tizen.Applications.RPCPort.Tests/org.tizen.example.RpcPortStub2-1.0.0.tpk new file mode 100755 index 000000000..41056fda3 Binary files /dev/null and b/tct-suite-vs/Resource/Tizen.Applications.RPCPort.Tests/org.tizen.example.RpcPortStub2-1.0.0.tpk differ diff --git a/tct-suite-vs/Resource/Tizen.Applications.Tests/code/MsgPortApp.Tizen/MsgPortApp.Tizen.sln b/tct-suite-vs/Resource/Tizen.Applications.Tests/code/MsgPortApp.Tizen/MsgPortApp.Tizen.sln deleted file mode 100755 index 6017758ee..000000000 --- a/tct-suite-vs/Resource/Tizen.Applications.Tests/code/MsgPortApp.Tizen/MsgPortApp.Tizen.sln +++ /dev/null @@ -1,25 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26730.10 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MsgPortApp.Tizen", "MsgPortApp.Tizen\MsgPortApp.Tizen.csproj", "{7578B31D-7987-42F2-9B10-FDC30CBA8401}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {7578B31D-7987-42F2-9B10-FDC30CBA8401}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {7578B31D-7987-42F2-9B10-FDC30CBA8401}.Debug|Any CPU.Build.0 = Debug|Any CPU - {7578B31D-7987-42F2-9B10-FDC30CBA8401}.Release|Any CPU.ActiveCfg = Release|Any CPU - {7578B31D-7987-42F2-9B10-FDC30CBA8401}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {03C02E20-0C77-4660-A92A-A02CA346C8E8} - EndGlobalSection -EndGlobal diff --git a/tct-suite-vs/Resource/Tizen.Applications.Tests/code/MsgPortApp.Tizen/MsgPortApp.Tizen/MsgPortApp.Tizen.csproj b/tct-suite-vs/Resource/Tizen.Applications.Tests/code/MsgPortApp.Tizen/MsgPortApp.Tizen/MsgPortApp.Tizen.csproj deleted file mode 100755 index d94c91687..000000000 --- a/tct-suite-vs/Resource/Tizen.Applications.Tests/code/MsgPortApp.Tizen/MsgPortApp.Tizen/MsgPortApp.Tizen.csproj +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - $(MSBuildExtensionsPath)\Tizen\VisualStudio\ - - - - - - - - Exe - netcoreapp2.0 - - - - portable - - - None - - - - - - - - - - - - - - - - - - - - - - diff --git a/tct-suite-vs/Resource/Tizen.Applications.Tests/code/MsgPortApp.Tizen/MsgPortApp.Tizen/MsgPortApp.Tizen_App.cs b/tct-suite-vs/Resource/Tizen.Applications.Tests/code/MsgPortApp.Tizen/MsgPortApp.Tizen/MsgPortApp.Tizen_App.cs deleted file mode 100755 index 97f084433..000000000 --- a/tct-suite-vs/Resource/Tizen.Applications.Tests/code/MsgPortApp.Tizen/MsgPortApp.Tizen/MsgPortApp.Tizen_App.cs +++ /dev/null @@ -1,142 +0,0 @@ -using Tizen.Applications; -using ElmSharp; -using Tizen.Applications.Messages; -using Tizen; - -namespace MsgPortApp.Tizen -{ - class App : CoreUIApplication - { - private static MessagePort _remotePort; - private static MessagePort _remotePort1; - private static MessagePort _testRemotePort; - private static MessagePort _controlRemotePort; - private Bundle _confirmMsg; - private static bool _flag; - - private string TAG; - protected override void OnCreate() - { - base.OnCreate(); - Initialize(); - - _confirmMsg = new Bundle(); - _confirmMsg.AddItem("ConfirmMessage", "Message is received"); - TAG = "MSGPORTAPP"; - - Log.Debug(TAG, "@@@@@@@ Create"); - _remotePort = new MessagePort("RemotePort", false); - Log.Debug(TAG, "@@@@@@@ MessagePort Create : " + _remotePort.PortName + "Trusted : " + _remotePort.Trusted); - - _remotePort.MessageReceived += MessageReceived_Callback; - _remotePort.Listen(); - - _remotePort1 = new MessagePort("RemotePort1", true); - _remotePort1.MessageReceived += TrustedMessageReceived_Callback; - _remotePort1.Listen(); - - Log.Debug(TAG, "@@### RemotePort Test MessagePort Create"); - - _testRemotePort = new MessagePort("TestRemotePort", false); - _testRemotePort.MessageReceived += RemotePortMessageReceived_Callback; - _testRemotePort.Listen(); - - _flag = true; - _controlRemotePort = new MessagePort("ControlRemotePort", false); - _controlRemotePort.MessageReceived += ControlRemotePortMessageReceived_Callback; - _controlRemotePort.Listen(); - } - - void Initialize() - { - Window window = new Window("ElmSharpApp") - { - AvailableRotations = DisplayRotation.Degree_0 | DisplayRotation.Degree_180 | DisplayRotation.Degree_270 | DisplayRotation.Degree_90 - }; - window.BackButtonPressed += (s, e) => - { - Exit(); - }; - window.Show(); - - var box = new Box(window) - { - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1, - }; - box.Show(); - - var bg = new Background(window) - { - Color = Color.White - }; - bg.SetContent(box); - - var conformant = new Conformant(window); - conformant.Show(); - conformant.SetContent(bg); - - var label = new Label(window) - { - Text = "Hello, Tizen", - }; - label.Show(); - box.PackEnd(label); - } - - private void MessageReceived_Callback(object sender, MessageReceivedEventArgs e) - { - Log.Debug(TAG, "@@@@@@@ Message Received"); - Log.Debug(TAG, "@@@@@@@ App ID : " + e.Remote.AppId); - Log.Debug(TAG, "@@@@@@@ PortName : " + e.Remote.PortName); - Log.Debug(TAG, "@@@@@@@ Trusted : " + e.Remote.Trusted); - Log.Debug(TAG, "@@@@@@@ message: " + e.Message.GetItem("message")); - - _remotePort.Send(_confirmMsg, "Tizen.Applications.Tests", "LocalPort"); - } - - private void TrustedMessageReceived_Callback(object sender, MessageReceivedEventArgs e) - { - Log.Debug(TAG, "@@@@@@@ Message Received"); - Log.Debug(TAG, "@@@@@@@ App ID : " + e.Remote.AppId); - Log.Debug(TAG, "@@@@@@@ PortName : " + e.Remote.PortName); - Log.Debug(TAG, "@@@@@@@ Trusted : " + e.Remote.Trusted); - Log.Debug(TAG, "@@@@@@@ message: " + e.Message.GetItem("message")); - - _remotePort1.Send(_confirmMsg, "Tizen.Applications.Tests", "LocalPort", true); - } - - private void RemotePortMessageReceived_Callback(object sender, MessageReceivedEventArgs e) - { - Log.Debug(TAG, "@@@### RemotePortMessageReceived_Callback Received"); - } - - private void ControlRemotePortMessageReceived_Callback(object sender, MessageReceivedEventArgs e) - { - Log.Debug(TAG, "@@@@@@@ ControlRemotePortMessageReceived_Callback Received"); - - if (_flag == true) - { - Log.Debug(TAG, "@@@### Stop TestRemotePort"); - _flag = false; - _testRemotePort.StopListening(); - } - else - { - Log.Debug(TAG, "@@@### Listen TestRemotePort"); - _flag = true; - _testRemotePort.Listen(); - } - } - - static void Main(string[] args) - { - Elementary.Initialize(); - Elementary.ThemeOverlay(); - App app = new App(); - app.Run(args); - } - } -} diff --git a/tct-suite-vs/Resource/Tizen.Applications.Tests/code/MsgPortApp.Tizen/MsgPortApp.Tizen/shared/res/MsgPortApp.Tizen.png b/tct-suite-vs/Resource/Tizen.Applications.Tests/code/MsgPortApp.Tizen/MsgPortApp.Tizen/shared/res/MsgPortApp.Tizen.png deleted file mode 100755 index 9f3cb9860..000000000 Binary files a/tct-suite-vs/Resource/Tizen.Applications.Tests/code/MsgPortApp.Tizen/MsgPortApp.Tizen/shared/res/MsgPortApp.Tizen.png and /dev/null differ diff --git a/tct-suite-vs/Resource/Tizen.Applications.Tests/code/MsgPortApp.Tizen/MsgPortApp.Tizen/tizen-manifest.xml b/tct-suite-vs/Resource/Tizen.Applications.Tests/code/MsgPortApp.Tizen/MsgPortApp.Tizen/tizen-manifest.xml deleted file mode 100755 index 2cfd55b4a..000000000 --- a/tct-suite-vs/Resource/Tizen.Applications.Tests/code/MsgPortApp.Tizen/MsgPortApp.Tizen/tizen-manifest.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - MsgPortApp.Tizen.png - - - - - - - - - - diff --git a/tct-suite-vs/Resource/Tizen.Applications.Tests/code/MsgPortApp1.Tizen/MsgPortApp1.Tizen.sln b/tct-suite-vs/Resource/Tizen.Applications.Tests/code/MsgPortApp1.Tizen/MsgPortApp1.Tizen.sln deleted file mode 100755 index db67ff5a0..000000000 --- a/tct-suite-vs/Resource/Tizen.Applications.Tests/code/MsgPortApp1.Tizen/MsgPortApp1.Tizen.sln +++ /dev/null @@ -1,25 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26730.10 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MsgPortApp1.Tizen", "MsgPortApp1.Tizen\MsgPortApp1.Tizen.csproj", "{1A3B63B0-6674-4FF1-AA59-A4CFD65E0A94}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {1A3B63B0-6674-4FF1-AA59-A4CFD65E0A94}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {1A3B63B0-6674-4FF1-AA59-A4CFD65E0A94}.Debug|Any CPU.Build.0 = Debug|Any CPU - {1A3B63B0-6674-4FF1-AA59-A4CFD65E0A94}.Release|Any CPU.ActiveCfg = Release|Any CPU - {1A3B63B0-6674-4FF1-AA59-A4CFD65E0A94}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {B71F68E2-8F43-4D76-A935-77EFB31BA1E3} - EndGlobalSection -EndGlobal diff --git a/tct-suite-vs/Resource/Tizen.Applications.Tests/code/MsgPortApp1.Tizen/MsgPortApp1.Tizen/MsgPortApp1.Tizen.csproj b/tct-suite-vs/Resource/Tizen.Applications.Tests/code/MsgPortApp1.Tizen/MsgPortApp1.Tizen/MsgPortApp1.Tizen.csproj deleted file mode 100755 index d94c91687..000000000 --- a/tct-suite-vs/Resource/Tizen.Applications.Tests/code/MsgPortApp1.Tizen/MsgPortApp1.Tizen/MsgPortApp1.Tizen.csproj +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - $(MSBuildExtensionsPath)\Tizen\VisualStudio\ - - - - - - - - Exe - netcoreapp2.0 - - - - portable - - - None - - - - - - - - - - - - - - - - - - - - - - diff --git a/tct-suite-vs/Resource/Tizen.Applications.Tests/code/MsgPortApp1.Tizen/MsgPortApp1.Tizen/MsgPortApp1.Tizen_App.cs b/tct-suite-vs/Resource/Tizen.Applications.Tests/code/MsgPortApp1.Tizen/MsgPortApp1.Tizen/MsgPortApp1.Tizen_App.cs deleted file mode 100755 index e05d2893f..000000000 --- a/tct-suite-vs/Resource/Tizen.Applications.Tests/code/MsgPortApp1.Tizen/MsgPortApp1.Tizen/MsgPortApp1.Tizen_App.cs +++ /dev/null @@ -1,88 +0,0 @@ -using Tizen.Applications; -using ElmSharp; -using Tizen; -using Tizen.Applications.Messages; - -namespace MsgPortApp1.Tizen -{ - class App : CoreUIApplication - { - private static MessagePort _remotePort; - private Bundle _confirmMsg; - private static string TAG; - protected override void OnCreate() - { - base.OnCreate(); - Initialize(); - - _confirmMsg = new Bundle(); - _confirmMsg.AddItem("ConfirmMessage", "Message is received"); - TAG = "MSGPORTAPP1"; - - Log.Debug(TAG, "@@@@@@@ Create"); - _remotePort = new MessagePort("RemotePort", false); - Log.Debug(TAG, "@@@@@@@ MessagePort-MsgPortApp1 Create : " + _remotePort.PortName + "Trusted : " + _remotePort.Trusted); - - _remotePort.MessageReceived += MessageReceived_Callback; - _remotePort.Listen(); - } - - void Initialize() - { - Window window = new Window("ElmSharpApp") - { - AvailableRotations = DisplayRotation.Degree_0 | DisplayRotation.Degree_180 | DisplayRotation.Degree_270 | DisplayRotation.Degree_90 - }; - window.BackButtonPressed += (s, e) => - { - Exit(); - }; - window.Show(); - - var box = new Box(window) - { - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1, - }; - box.Show(); - - var bg = new Background(window) - { - Color = Color.White - }; - bg.SetContent(box); - - var conformant = new Conformant(window); - conformant.Show(); - conformant.SetContent(bg); - - var label = new Label(window) - { - Text = "Hello, Tizen", - }; - label.Show(); - box.PackEnd(label); - } - - private void MessageReceived_Callback(object sender, MessageReceivedEventArgs e) - { - Log.Debug(TAG, "@@@@@@@ Message Received"); - Log.Debug(TAG, "@@@@@@@ App ID : " + e.Remote.AppId); - Log.Debug(TAG, "@@@@@@@ PortName : " + e.Remote.PortName); - Log.Debug(TAG, "@@@@@@@ Trusted : " + e.Remote.Trusted); - Log.Debug(TAG, "@@@@@@@ message: " + e.Message.GetItem("message")); - - _remotePort.Send(_confirmMsg, "Tizen.Applications.Tests", "LocalPort"); - } - - static void Main(string[] args) - { - Elementary.Initialize(); - Elementary.ThemeOverlay(); - App app = new App(); - app.Run(args); - } - } -} diff --git a/tct-suite-vs/Resource/Tizen.Applications.Tests/code/MsgPortApp1.Tizen/MsgPortApp1.Tizen/shared/res/MsgPortApp1.Tizen.png b/tct-suite-vs/Resource/Tizen.Applications.Tests/code/MsgPortApp1.Tizen/MsgPortApp1.Tizen/shared/res/MsgPortApp1.Tizen.png deleted file mode 100755 index 9f3cb9860..000000000 Binary files a/tct-suite-vs/Resource/Tizen.Applications.Tests/code/MsgPortApp1.Tizen/MsgPortApp1.Tizen/shared/res/MsgPortApp1.Tizen.png and /dev/null differ diff --git a/tct-suite-vs/Resource/Tizen.Applications.Tests/code/MsgPortApp1.Tizen/MsgPortApp1.Tizen/tizen-manifest.xml b/tct-suite-vs/Resource/Tizen.Applications.Tests/code/MsgPortApp1.Tizen/MsgPortApp1.Tizen/tizen-manifest.xml deleted file mode 100755 index 1a9c94c47..000000000 --- a/tct-suite-vs/Resource/Tizen.Applications.Tests/code/MsgPortApp1.Tizen/MsgPortApp1.Tizen/tizen-manifest.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - MsgPortApp1.Tizen.png - - - - - - - - - - diff --git a/tct-suite-vs/Resource/Tizen.Applications.Tests/code/org.tizen.example.RpcPortProxy/RpcPortProxy.sln b/tct-suite-vs/Resource/Tizen.Applications.Tests/code/org.tizen.example.RpcPortProxy/RpcPortProxy.sln deleted file mode 100755 index c93784213..000000000 --- a/tct-suite-vs/Resource/Tizen.Applications.Tests/code/org.tizen.example.RpcPortProxy/RpcPortProxy.sln +++ /dev/null @@ -1,25 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.27703.2035 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RpcPortProxy", "RpcPortProxy\RpcPortProxy.csproj", "{B4C8261C-D74F-43D1-A075-B9E242851D31}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {B4C8261C-D74F-43D1-A075-B9E242851D31}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {B4C8261C-D74F-43D1-A075-B9E242851D31}.Debug|Any CPU.Build.0 = Debug|Any CPU - {B4C8261C-D74F-43D1-A075-B9E242851D31}.Release|Any CPU.ActiveCfg = Release|Any CPU - {B4C8261C-D74F-43D1-A075-B9E242851D31}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {3E5007AD-1998-4272-8437-26CDC3729698} - EndGlobalSection -EndGlobal diff --git a/tct-suite-vs/Resource/Tizen.Applications.Tests/code/org.tizen.example.RpcPortProxy/RpcPortProxy/RpcPortProxy.csproj b/tct-suite-vs/Resource/Tizen.Applications.Tests/code/org.tizen.example.RpcPortProxy/RpcPortProxy/RpcPortProxy.csproj deleted file mode 100755 index bfbbbf8c6..000000000 --- a/tct-suite-vs/Resource/Tizen.Applications.Tests/code/org.tizen.example.RpcPortProxy/RpcPortProxy/RpcPortProxy.csproj +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - $(MSBuildExtensionsPath)\Tizen\VisualStudio\ - - - - - - - - Exe - netcoreapp2.0 - - - - portable - - - None - - - - - - - - - - - - - - - - - - - - - - diff --git a/tct-suite-vs/Resource/Tizen.Applications.Tests/code/org.tizen.example.RpcPortProxy/RpcPortProxy/RpcPortProxy_App.cs b/tct-suite-vs/Resource/Tizen.Applications.Tests/code/org.tizen.example.RpcPortProxy/RpcPortProxy/RpcPortProxy_App.cs deleted file mode 100755 index 552e0cab7..000000000 --- a/tct-suite-vs/Resource/Tizen.Applications.Tests/code/org.tizen.example.RpcPortProxy/RpcPortProxy/RpcPortProxy_App.cs +++ /dev/null @@ -1,125 +0,0 @@ -using System.Threading; -using Tizen; -using Tizen.Applications; -using Tizen.Applications.RPCPort; - -namespace RpcPortProxy -{ - class App : ServiceApplication - { - private Proxy _proxy; - - class Proxy : ProxyBase - { - private Timer _timer; - private bool _send; - - public Proxy(bool send) - { - _timer = new Timer(new TimerCallback(OnTimeout)); - _timer.Change(100, 0); - _send = send; - } - - private void OnTimeout(object state) - { - Connect("Tizen.Applications.Tests", "Test"); - _timer.Dispose(); - _timer = null; - } - - protected override void OnConnectedEvent(string endPoint, string portName, Port port) - { - Log.Debug("RPCPortProxy", "OnConnectedEvent: endPoint:" + endPoint + " port:" + portName); - if (_send) - { - using (var p = new Parcel()) - { - p.WriteString("hello"); - p.Send(port); - } - } - } - - protected override void OnDisconnectedEvent(string endPoint, string portName) - { - Log.Debug("RPCPortProxy", "OnDisconnectedEvent: endPoint:" + endPoint + " port:" + portName); - } - - protected override void OnReceivedEvent(string endPoint, string portName) - { - Log.Debug("RPCPortProxy", "OnReceivedEvent: endPoint:" + endPoint + " port:" + portName); - } - - protected override void OnRejectedEvent(string endPoint, string portName) - { - Log.Debug("RPCPortProxy", "OnRejectedEvent: endPoint:" + endPoint + " port:" + portName); - } - } - - protected override void OnCreate() - { - base.OnCreate(); - } - - protected override void OnAppControlReceived(AppControlReceivedEventArgs e) - { - base.OnAppControlReceived(e); - if (e.ReceivedAppControl.ExtraData.TryGet("Test", out string val)) - { - if (val.Equals("finish")) - { - Log.Debug("RPCPortProxy", "Finish"); - Exit(); - } - } - else - { - Log.Debug("RPCPortProxy", "Connecting"); - _proxy?.Dispose(); - if (e.ReceivedAppControl.ExtraData.TryGet("send", out string v)) - _proxy = new Proxy(true); - else - _proxy = new Proxy(false); - } - } - - protected override void OnDeviceOrientationChanged(DeviceOrientationEventArgs e) - { - base.OnDeviceOrientationChanged(e); - } - - protected override void OnLocaleChanged(LocaleChangedEventArgs e) - { - base.OnLocaleChanged(e); - } - - protected override void OnLowBattery(LowBatteryEventArgs e) - { - base.OnLowBattery(e); - } - - protected override void OnLowMemory(LowMemoryEventArgs e) - { - base.OnLowMemory(e); - } - - protected override void OnRegionFormatChanged(RegionFormatChangedEventArgs e) - { - base.OnRegionFormatChanged(e); - } - - protected override void OnTerminate() - { - _proxy?.Dispose(); - _proxy = null; - base.OnTerminate(); - } - - static void Main(string[] args) - { - App app = new App(); - app.Run(args); - } - } -} diff --git a/tct-suite-vs/Resource/Tizen.Applications.Tests/code/org.tizen.example.RpcPortProxy/RpcPortProxy/shared/res/RpcPortProxy.png b/tct-suite-vs/Resource/Tizen.Applications.Tests/code/org.tizen.example.RpcPortProxy/RpcPortProxy/shared/res/RpcPortProxy.png deleted file mode 100755 index 9f3cb9860..000000000 Binary files a/tct-suite-vs/Resource/Tizen.Applications.Tests/code/org.tizen.example.RpcPortProxy/RpcPortProxy/shared/res/RpcPortProxy.png and /dev/null differ diff --git a/tct-suite-vs/Resource/Tizen.Applications.Tests/code/org.tizen.example.RpcPortProxy/RpcPortProxy/tizen-manifest.xml b/tct-suite-vs/Resource/Tizen.Applications.Tests/code/org.tizen.example.RpcPortProxy/RpcPortProxy/tizen-manifest.xml deleted file mode 100755 index 14e26a947..000000000 --- a/tct-suite-vs/Resource/Tizen.Applications.Tests/code/org.tizen.example.RpcPortProxy/RpcPortProxy/tizen-manifest.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - RpcPortProxy.png - - - - - - http://tizen.org/privilege/appmanager.launch - http://tizen.org/privilege/datasharing - - - diff --git a/tct-suite-vs/Resource/Tizen.Applications.Tests/code/org.tizen.example.RpcPortProxy2/RpcPortProxy2.sln b/tct-suite-vs/Resource/Tizen.Applications.Tests/code/org.tizen.example.RpcPortProxy2/RpcPortProxy2.sln deleted file mode 100755 index df07963a6..000000000 --- a/tct-suite-vs/Resource/Tizen.Applications.Tests/code/org.tizen.example.RpcPortProxy2/RpcPortProxy2.sln +++ /dev/null @@ -1,25 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.27703.2035 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RpcPortProxy2", "RpcPortProxy2\RpcPortProxy2.csproj", "{E877EB41-209D-417B-9E72-7095BBBF7604}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {E877EB41-209D-417B-9E72-7095BBBF7604}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E877EB41-209D-417B-9E72-7095BBBF7604}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E877EB41-209D-417B-9E72-7095BBBF7604}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E877EB41-209D-417B-9E72-7095BBBF7604}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {E8C497F1-5425-439D-8021-3A6D9BF04ED4} - EndGlobalSection -EndGlobal diff --git a/tct-suite-vs/Resource/Tizen.Applications.Tests/code/org.tizen.example.RpcPortProxy2/RpcPortProxy2/RpcPortProxy2.csproj b/tct-suite-vs/Resource/Tizen.Applications.Tests/code/org.tizen.example.RpcPortProxy2/RpcPortProxy2/RpcPortProxy2.csproj deleted file mode 100755 index 490b33fa8..000000000 --- a/tct-suite-vs/Resource/Tizen.Applications.Tests/code/org.tizen.example.RpcPortProxy2/RpcPortProxy2/RpcPortProxy2.csproj +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - $(MSBuildExtensionsPath)\Tizen\VisualStudio\ - - - - - - - - Exe - netcoreapp2.0 - - - - portable - - - None - - - - - - - - - - - - - - - - - - - - - - diff --git a/tct-suite-vs/Resource/Tizen.Applications.Tests/code/org.tizen.example.RpcPortProxy2/RpcPortProxy2/RpcPortProxy2_App.cs b/tct-suite-vs/Resource/Tizen.Applications.Tests/code/org.tizen.example.RpcPortProxy2/RpcPortProxy2/RpcPortProxy2_App.cs deleted file mode 100755 index 0d79ff4f9..000000000 --- a/tct-suite-vs/Resource/Tizen.Applications.Tests/code/org.tizen.example.RpcPortProxy2/RpcPortProxy2/RpcPortProxy2_App.cs +++ /dev/null @@ -1,116 +0,0 @@ -using System; -using System.Threading; -using Tizen; -using Tizen.Applications; -using Tizen.Applications.RPCPort; - -namespace RpcPortProxy -{ - class App : ServiceApplication - { - private Proxy _proxy; - - class Proxy : ProxyBase - { - public Proxy() - { - Connect("org.tizen.example.RpcPortStub", "Test"); - } - - protected override void OnConnectedEvent(string endPoint, string portName, Port port) - { - Log.Debug("RPCPortProxy", "OnConnectedEvent: endPoint:" + endPoint + " port:" + portName); - } - - protected override void OnDisconnectedEvent(string endPoint, string portName) - { - Log.Debug("RPCPortProxy", "OnDisconnectedEvent: endPoint:" + endPoint + " port:" + portName); - } - - protected override void OnReceivedEvent(string endPoint, string portName) - { - Log.Debug("RPCPortProxy", "OnReceivedEvent: endPoint:" + endPoint + " port:" + portName); - } - - protected override void OnRejectedEvent(string endPoint, string portName) - { - Log.Debug("RPCPortProxy", "OnRejectedEvent: endPoint:" + endPoint + " port:" + portName); - } - } - - protected override void OnCreate() - { - base.OnCreate(); - } - - protected override void OnAppControlReceived(AppControlReceivedEventArgs e) - { - base.OnAppControlReceived(e); - if (e.ReceivedAppControl.ExtraData.TryGet("Test", out string val)) - { - if (val.Equals("finish")) - { - Log.Debug("RPCPortProxy", "Finish"); - Exit(); - } - } - else - { - Log.Debug("RPCPortProxy", "Connecting"); - _proxy?.Dispose(); - - try - { - _proxy = new Proxy(); - } - catch (PermissionDeniedException) - { - Log.Debug("RPCPortProxy", "PermissionDeniedException happened"); - e.ReceivedAppControl.ReplyToLaunchRequest(new AppControl(), AppControlReplyResult.Succeeded); - } - catch (Exception ex) - { - Log.Debug("RPCPortProxy", "Uncatched exception " + ex.ToString()); - } - } - } - - protected override void OnDeviceOrientationChanged(DeviceOrientationEventArgs e) - { - base.OnDeviceOrientationChanged(e); - } - - protected override void OnLocaleChanged(LocaleChangedEventArgs e) - { - base.OnLocaleChanged(e); - } - - protected override void OnLowBattery(LowBatteryEventArgs e) - { - base.OnLowBattery(e); - } - - protected override void OnLowMemory(LowMemoryEventArgs e) - { - base.OnLowMemory(e); - } - - protected override void OnRegionFormatChanged(RegionFormatChangedEventArgs e) - { - base.OnRegionFormatChanged(e); - } - - protected override void OnTerminate() - { - _proxy?.Dispose(); - _proxy = null; - base.OnTerminate(); - } - - static void Main(string[] args) - { - App app = new App(); - app.Run(args); - } - } -} diff --git a/tct-suite-vs/Resource/Tizen.Applications.Tests/code/org.tizen.example.RpcPortProxy2/RpcPortProxy2/shared/res/RpcPortProxy2.png b/tct-suite-vs/Resource/Tizen.Applications.Tests/code/org.tizen.example.RpcPortProxy2/RpcPortProxy2/shared/res/RpcPortProxy2.png deleted file mode 100755 index 9f3cb9860..000000000 Binary files a/tct-suite-vs/Resource/Tizen.Applications.Tests/code/org.tizen.example.RpcPortProxy2/RpcPortProxy2/shared/res/RpcPortProxy2.png and /dev/null differ diff --git a/tct-suite-vs/Resource/Tizen.Applications.Tests/code/org.tizen.example.RpcPortProxy2/RpcPortProxy2/tizen-manifest.xml b/tct-suite-vs/Resource/Tizen.Applications.Tests/code/org.tizen.example.RpcPortProxy2/RpcPortProxy2/tizen-manifest.xml deleted file mode 100755 index d597d546e..000000000 --- a/tct-suite-vs/Resource/Tizen.Applications.Tests/code/org.tizen.example.RpcPortProxy2/RpcPortProxy2/tizen-manifest.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - RpcPortProxy2.png - - - - - - http://tizen.org/privilege/appmanager.launch - - - diff --git a/tct-suite-vs/Resource/Tizen.Applications.Tests/code/org.tizen.example.RpcPortStub/RpcPortStub.sln b/tct-suite-vs/Resource/Tizen.Applications.Tests/code/org.tizen.example.RpcPortStub/RpcPortStub.sln deleted file mode 100755 index 4d59ee918..000000000 --- a/tct-suite-vs/Resource/Tizen.Applications.Tests/code/org.tizen.example.RpcPortStub/RpcPortStub.sln +++ /dev/null @@ -1,25 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.27703.2035 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RpcPortStub", "RpcPortStub\RpcPortStub.csproj", "{FE0280FD-12A8-4B3D-A035-D73CFF4C2ECF}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {FE0280FD-12A8-4B3D-A035-D73CFF4C2ECF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {FE0280FD-12A8-4B3D-A035-D73CFF4C2ECF}.Debug|Any CPU.Build.0 = Debug|Any CPU - {FE0280FD-12A8-4B3D-A035-D73CFF4C2ECF}.Release|Any CPU.ActiveCfg = Release|Any CPU - {FE0280FD-12A8-4B3D-A035-D73CFF4C2ECF}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {C6927ABD-FBB9-450E-BD87-9152B5AD5C22} - EndGlobalSection -EndGlobal diff --git a/tct-suite-vs/Resource/Tizen.Applications.Tests/code/org.tizen.example.RpcPortStub/RpcPortStub/RpcPortStub.csproj b/tct-suite-vs/Resource/Tizen.Applications.Tests/code/org.tizen.example.RpcPortStub/RpcPortStub/RpcPortStub.csproj deleted file mode 100755 index bfbbbf8c6..000000000 --- a/tct-suite-vs/Resource/Tizen.Applications.Tests/code/org.tizen.example.RpcPortStub/RpcPortStub/RpcPortStub.csproj +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - $(MSBuildExtensionsPath)\Tizen\VisualStudio\ - - - - - - - - Exe - netcoreapp2.0 - - - - portable - - - None - - - - - - - - - - - - - - - - - - - - - - diff --git a/tct-suite-vs/Resource/Tizen.Applications.Tests/code/org.tizen.example.RpcPortStub/RpcPortStub/RpcPortStub_App.cs b/tct-suite-vs/Resource/Tizen.Applications.Tests/code/org.tizen.example.RpcPortStub/RpcPortStub/RpcPortStub_App.cs deleted file mode 100755 index a8d963c4d..000000000 --- a/tct-suite-vs/Resource/Tizen.Applications.Tests/code/org.tizen.example.RpcPortStub/RpcPortStub/RpcPortStub_App.cs +++ /dev/null @@ -1,114 +0,0 @@ -using System; -using Tizen; -using Tizen.Applications; -using Tizen.Applications.RPCPort; - -namespace RpcPortStub -{ - class App : ServiceApplication - { - private Stub _stub; - - private class Stub : StubBase - { - public Stub(string portName) : base(portName) - { - Listen(); - } - - protected override void OnConnectedEvent(string sender, string instance) - { - Log.Debug("RPCPortStub", "OnConnectedEvent: sender::" + sender + " instance::" + instance); - } - - protected override void OnDisconnectedEvent(string sender, string instance) - { - Log.Debug("RPCPortStub", "OnDisconnectedEvent: sender::" + sender + " instance::" + instance); - } - - protected override bool OnReceivedEvent(string sender, string instance, Port port) - { - Log.Debug("RPCPortStub", "OnReceivedEvent: sender::" + sender + " instance::" + instance); - try - { - using (Parcel p = new Parcel(port)) - { - string str = p.ReadString(); - using (Parcel ret = new Parcel()) - { - ret.WriteString(str); - ret.Send(GetPort(Port.Type.Callback, instance)); - } - } - } - catch (Exception) - { - Log.Error("RPCPortStub", "Exception happens"); - return false; - } - - return true; - } - - protected override void OnTerminatedEvent() - { - Log.Debug("RPCPortStub", "OnTerminatedEvent"); - } - } - - protected override void OnCreate() - { - base.OnCreate(); - _stub = new Stub("Test"); - } - - protected override void OnAppControlReceived(AppControlReceivedEventArgs e) - { - base.OnAppControlReceived(e); - if (e.ReceivedAppControl.ExtraData.TryGet("Test", out string val)) - { - if (val.Equals("finish")) { - Log.Debug("RPCPortStub", "Finish"); - Exit(); - } - } - } - - protected override void OnDeviceOrientationChanged(DeviceOrientationEventArgs e) - { - base.OnDeviceOrientationChanged(e); - } - - protected override void OnLocaleChanged(LocaleChangedEventArgs e) - { - base.OnLocaleChanged(e); - } - - protected override void OnLowBattery(LowBatteryEventArgs e) - { - base.OnLowBattery(e); - } - - protected override void OnLowMemory(LowMemoryEventArgs e) - { - base.OnLowMemory(e); - } - - protected override void OnRegionFormatChanged(RegionFormatChangedEventArgs e) - { - base.OnRegionFormatChanged(e); - } - - protected override void OnTerminate() - { - base.OnTerminate(); - _stub?.Dispose(); - } - - static void Main(string[] args) - { - App app = new App(); - app.Run(args); - } - } -} diff --git a/tct-suite-vs/Resource/Tizen.Applications.Tests/code/org.tizen.example.RpcPortStub/RpcPortStub/shared/res/RpcPortStub.png b/tct-suite-vs/Resource/Tizen.Applications.Tests/code/org.tizen.example.RpcPortStub/RpcPortStub/shared/res/RpcPortStub.png deleted file mode 100755 index 9f3cb9860..000000000 Binary files a/tct-suite-vs/Resource/Tizen.Applications.Tests/code/org.tizen.example.RpcPortStub/RpcPortStub/shared/res/RpcPortStub.png and /dev/null differ diff --git a/tct-suite-vs/Resource/Tizen.Applications.Tests/code/org.tizen.example.RpcPortStub/RpcPortStub/tizen-manifest.xml b/tct-suite-vs/Resource/Tizen.Applications.Tests/code/org.tizen.example.RpcPortStub/RpcPortStub/tizen-manifest.xml deleted file mode 100755 index 8c3e00caa..000000000 --- a/tct-suite-vs/Resource/Tizen.Applications.Tests/code/org.tizen.example.RpcPortStub/RpcPortStub/tizen-manifest.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - RpcPortStub.png - - - - - - diff --git a/tct-suite-vs/Resource/Tizen.Applications.Tests/code/org.tizen.example.RpcPortStub2/RpcPortStub2.sln b/tct-suite-vs/Resource/Tizen.Applications.Tests/code/org.tizen.example.RpcPortStub2/RpcPortStub2.sln deleted file mode 100755 index dc3612664..000000000 --- a/tct-suite-vs/Resource/Tizen.Applications.Tests/code/org.tizen.example.RpcPortStub2/RpcPortStub2.sln +++ /dev/null @@ -1,25 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.27703.2035 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RpcPortStub2", "RpcPortStub2\RpcPortStub2.csproj", "{D84E03B5-7EFF-40B6-981A-BC0316180DAE}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {D84E03B5-7EFF-40B6-981A-BC0316180DAE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D84E03B5-7EFF-40B6-981A-BC0316180DAE}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D84E03B5-7EFF-40B6-981A-BC0316180DAE}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D84E03B5-7EFF-40B6-981A-BC0316180DAE}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {934AC992-DE63-472C-AD51-4386E224BCD4} - EndGlobalSection -EndGlobal diff --git a/tct-suite-vs/Resource/Tizen.Applications.Tests/code/org.tizen.example.RpcPortStub2/RpcPortStub2/RpcPortStub2.csproj b/tct-suite-vs/Resource/Tizen.Applications.Tests/code/org.tizen.example.RpcPortStub2/RpcPortStub2/RpcPortStub2.csproj deleted file mode 100755 index e6d2acded..000000000 --- a/tct-suite-vs/Resource/Tizen.Applications.Tests/code/org.tizen.example.RpcPortStub2/RpcPortStub2/RpcPortStub2.csproj +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - $(MSBuildExtensionsPath)\Tizen\VisualStudio\ - - - - - - - - Exe - netcoreapp2.0 - - - - portable - - - None - - - - - - - - - - - - - - - - - - - - - - diff --git a/tct-suite-vs/Resource/Tizen.Applications.Tests/code/org.tizen.example.RpcPortStub2/RpcPortStub2/RpcPortStub2_App.cs b/tct-suite-vs/Resource/Tizen.Applications.Tests/code/org.tizen.example.RpcPortStub2/RpcPortStub2/RpcPortStub2_App.cs deleted file mode 100755 index ba8a2b5a9..000000000 --- a/tct-suite-vs/Resource/Tizen.Applications.Tests/code/org.tizen.example.RpcPortStub2/RpcPortStub2/RpcPortStub2_App.cs +++ /dev/null @@ -1,101 +0,0 @@ -using Tizen; -using Tizen.Applications; -using Tizen.Applications.RPCPort; - -namespace RpcPortStub -{ - class App : ServiceApplication - { - private Stub _stub; - - private class Stub : StubBase - { - public Stub(string portName) : base(portName) - { - AddPrivilege("my.privilege"); - Listen(); - } - - protected override void OnConnectedEvent(string sender, string instance) - { - Log.Debug("RPCPortStub2", "OnConnectedEvent: sender::" + sender + " instance::" + instance); - } - - protected override void OnDisconnectedEvent(string sender, string instance) - { - Log.Debug("RPCPortStub2", "OnDisconnectedEvent: sender::" + sender + " instance::" + instance); - } - - protected override bool OnReceivedEvent(string sender, string instance, Port port) - { - Log.Debug("RPCPortStub2", "OnReceivedEvent: sender::" + sender + " instance::" + instance); - using (Parcel p = new Parcel(port)) - { - } - - return true; - } - - protected override void OnTerminatedEvent() - { - Log.Debug("RPCPortStub2", "OnTerminatedEvent"); - } - } - - protected override void OnCreate() - { - base.OnCreate(); - _stub = new Stub("Test"); - } - - protected override void OnAppControlReceived(AppControlReceivedEventArgs e) - { - base.OnAppControlReceived(e); - if (e.ReceivedAppControl.ExtraData.TryGet("Test", out string val)) - { - if (val.Equals("finish")) - { - Log.Debug("RPCPortStub2", "Finish"); - Exit(); - } - } - } - - protected override void OnDeviceOrientationChanged(DeviceOrientationEventArgs e) - { - base.OnDeviceOrientationChanged(e); - } - - protected override void OnLocaleChanged(LocaleChangedEventArgs e) - { - base.OnLocaleChanged(e); - } - - protected override void OnLowBattery(LowBatteryEventArgs e) - { - base.OnLowBattery(e); - } - - protected override void OnLowMemory(LowMemoryEventArgs e) - { - base.OnLowMemory(e); - } - - protected override void OnRegionFormatChanged(RegionFormatChangedEventArgs e) - { - base.OnRegionFormatChanged(e); - } - - protected override void OnTerminate() - { - base.OnTerminate(); - _stub?.Dispose(); - } - - static void Main(string[] args) - { - App app = new App(); - app.Run(args); - } - } -} diff --git a/tct-suite-vs/Resource/Tizen.Applications.Tests/code/org.tizen.example.RpcPortStub2/RpcPortStub2/shared/res/RpcPortStub2.png b/tct-suite-vs/Resource/Tizen.Applications.Tests/code/org.tizen.example.RpcPortStub2/RpcPortStub2/shared/res/RpcPortStub2.png deleted file mode 100755 index 9f3cb9860..000000000 Binary files a/tct-suite-vs/Resource/Tizen.Applications.Tests/code/org.tizen.example.RpcPortStub2/RpcPortStub2/shared/res/RpcPortStub2.png and /dev/null differ diff --git a/tct-suite-vs/Resource/Tizen.Applications.Tests/code/org.tizen.example.RpcPortStub2/RpcPortStub2/tizen-manifest.xml b/tct-suite-vs/Resource/Tizen.Applications.Tests/code/org.tizen.example.RpcPortStub2/RpcPortStub2/tizen-manifest.xml deleted file mode 100755 index 19d1292b9..000000000 --- a/tct-suite-vs/Resource/Tizen.Applications.Tests/code/org.tizen.example.RpcPortStub2/RpcPortStub2/tizen-manifest.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - RpcPortStub2.png - - - - - - diff --git a/tct-suite-vs/Resource/Tizen.Applications.Tests/org.tizen.MsgPortApp.Tizen-1.0.0.tpk b/tct-suite-vs/Resource/Tizen.Applications.Tests/org.tizen.MsgPortApp.Tizen-1.0.0.tpk deleted file mode 100755 index 4ff136168..000000000 Binary files a/tct-suite-vs/Resource/Tizen.Applications.Tests/org.tizen.MsgPortApp.Tizen-1.0.0.tpk and /dev/null differ diff --git a/tct-suite-vs/Resource/Tizen.Applications.Tests/org.tizen.MsgPortApp1.Tizen-1.0.0.tpk b/tct-suite-vs/Resource/Tizen.Applications.Tests/org.tizen.MsgPortApp1.Tizen-1.0.0.tpk deleted file mode 100755 index bde88fae0..000000000 Binary files a/tct-suite-vs/Resource/Tizen.Applications.Tests/org.tizen.MsgPortApp1.Tizen-1.0.0.tpk and /dev/null differ diff --git a/tct-suite-vs/Resource/Tizen.Applications.Tests/org.tizen.example.RpcPortProxy-1.0.0.tpk b/tct-suite-vs/Resource/Tizen.Applications.Tests/org.tizen.example.RpcPortProxy-1.0.0.tpk deleted file mode 100755 index 13c3956fb..000000000 Binary files a/tct-suite-vs/Resource/Tizen.Applications.Tests/org.tizen.example.RpcPortProxy-1.0.0.tpk and /dev/null differ diff --git a/tct-suite-vs/Resource/Tizen.Applications.Tests/org.tizen.example.RpcPortProxy2-1.0.0.tpk b/tct-suite-vs/Resource/Tizen.Applications.Tests/org.tizen.example.RpcPortProxy2-1.0.0.tpk deleted file mode 100755 index 156e82629..000000000 Binary files a/tct-suite-vs/Resource/Tizen.Applications.Tests/org.tizen.example.RpcPortProxy2-1.0.0.tpk and /dev/null differ diff --git a/tct-suite-vs/Resource/Tizen.Applications.Tests/org.tizen.example.RpcPortStub-1.0.0.tpk b/tct-suite-vs/Resource/Tizen.Applications.Tests/org.tizen.example.RpcPortStub-1.0.0.tpk deleted file mode 100755 index b41ad60f7..000000000 Binary files a/tct-suite-vs/Resource/Tizen.Applications.Tests/org.tizen.example.RpcPortStub-1.0.0.tpk and /dev/null differ diff --git a/tct-suite-vs/Resource/Tizen.Applications.Tests/org.tizen.example.RpcPortStub2-1.0.0.tpk b/tct-suite-vs/Resource/Tizen.Applications.Tests/org.tizen.example.RpcPortStub2-1.0.0.tpk deleted file mode 100755 index 393e8e3be..000000000 Binary files a/tct-suite-vs/Resource/Tizen.Applications.Tests/org.tizen.example.RpcPortStub2-1.0.0.tpk and /dev/null differ diff --git a/tct-suite-vs/Resource/Tizen.Applications.UI.Tests/UIApp.Tizen.tpk b/tct-suite-vs/Resource/Tizen.Applications.UI.Tests/UIApp.Tizen.tpk new file mode 100755 index 000000000..5c8350e5c Binary files /dev/null and b/tct-suite-vs/Resource/Tizen.Applications.UI.Tests/UIApp.Tizen.tpk differ diff --git a/tct-suite-vs/Resource/Tizen.Applications.UI.Tests/code/UIApp.Tizen/Properties/AssemblyInfo.cs b/tct-suite-vs/Resource/Tizen.Applications.UI.Tests/code/UIApp.Tizen/Properties/AssemblyInfo.cs new file mode 100755 index 000000000..62d6fd5c1 --- /dev/null +++ b/tct-suite-vs/Resource/Tizen.Applications.UI.Tests/code/UIApp.Tizen/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("UIApp.Tizen")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("UIApp.Tizen")] +[assembly: AssemblyCopyright("Copyright © 2017")] +[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("5b2a12a4-6ed7-4cd1-8371-46daf5c4e611")] + +// 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-suite-vs/Resource/Tizen.Applications.UI.Tests/code/UIApp.Tizen/UIApp.Tizen.cs b/tct-suite-vs/Resource/Tizen.Applications.UI.Tests/code/UIApp.Tizen/UIApp.Tizen.cs new file mode 100755 index 000000000..fb9afee52 --- /dev/null +++ b/tct-suite-vs/Resource/Tizen.Applications.UI.Tests/code/UIApp.Tizen/UIApp.Tizen.cs @@ -0,0 +1,20 @@ +using System; + +namespace UIApp.Tizen +{ + class Program : global::Xamarin.Forms.Platform.Tizen.FormsApplication + { + protected override void OnCreate() + { + base.OnCreate(); + LoadApplication(new App()); + } + + static void Main(string[] args) + { + var app = new Program(); + global::Xamarin.Forms.Platform.Tizen.Forms.Init(app); + app.Run(args); + } + } +} diff --git a/tct-suite-vs/Resource/Tizen.Applications.UI.Tests/code/UIApp.Tizen/UIApp.Tizen.csproj b/tct-suite-vs/Resource/Tizen.Applications.UI.Tests/code/UIApp.Tizen/UIApp.Tizen.csproj new file mode 100755 index 000000000..20ce55063 --- /dev/null +++ b/tct-suite-vs/Resource/Tizen.Applications.UI.Tests/code/UIApp.Tizen/UIApp.Tizen.csproj @@ -0,0 +1,91 @@ + + + + 14.0 + Debug + AnyCPU + 8.0.30703 + 2.0 + {2F98DAC9-6F16-457B-AED7-D43CAC379341};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + {5B2A12A4-6ED7-4CD1-8371-46DAF5C4E611} + Exe + Properties + UIApp.Tizen + UIApp.Tizen + 512 + en-US + + + .NETCoreApp + v2.0 + false + .NETCoreApp,Version=v2.0 + tizen.4.0.0-armel + true + $(NoWarn);1701 + false + + + true + portable + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + portable + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + + + + <_TargetFrameworkDirectories>$(MSBuildThisFileDirectory) + <_FullFrameworkReferenceAssemblyPaths>$(MSBuildThisFileDirectory) + true + + + + + + True + + + + + + + + \ No newline at end of file diff --git a/tct-suite-vs/Resource/Tizen.Applications.UI.Tests/code/UIApp.Tizen/UIApp.Tizen.project.json b/tct-suite-vs/Resource/Tizen.Applications.UI.Tests/code/UIApp.Tizen/UIApp.Tizen.project.json new file mode 100755 index 000000000..c76a98698 --- /dev/null +++ b/tct-suite-vs/Resource/Tizen.Applications.UI.Tests/code/UIApp.Tizen/UIApp.Tizen.project.json @@ -0,0 +1,26 @@ +{ + "buildOptions": { + "emitEntryPoint": true, + "debugType": "portable", + "platform": "AnyCPU", + "preserveCompilationContext": true + }, + "dependencies": { + "Microsoft.NETCore.App": "2.0.0-preview1-002111-00", + "Tizen.Applications.Common": "1.5.8", + "Tizen.Applications.UI": "1.5.8", + "Xamarin.Forms": "2.3.5.256-pre6", + "Xamarin.Forms.Platform.Tizen": "2.3.5-r256-001" + }, + "runtimes": { + "tizen.4.0.0-armel": {} + }, + "frameworks": { + "netcoreapp2.0": { + "imports": [ + "portable-net45+wp80+win81+wpa81", + "netstandard1.6" + ] + } + } +} \ No newline at end of file diff --git a/tct-suite-vs/Resource/Tizen.Applications.UI.Tests/code/UIApp.Tizen/UIApp.Tizen.sln b/tct-suite-vs/Resource/Tizen.Applications.UI.Tests/code/UIApp.Tizen/UIApp.Tizen.sln new file mode 100755 index 000000000..f2f935096 --- /dev/null +++ b/tct-suite-vs/Resource/Tizen.Applications.UI.Tests/code/UIApp.Tizen/UIApp.Tizen.sln @@ -0,0 +1,22 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 14 +VisualStudioVersion = 14.0.25420.1 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UIApp.Tizen", "UIApp.Tizen.csproj", "{5B2A12A4-6ED7-4CD1-8371-46DAF5C4E611}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {5B2A12A4-6ED7-4CD1-8371-46DAF5C4E611}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5B2A12A4-6ED7-4CD1-8371-46DAF5C4E611}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5B2A12A4-6ED7-4CD1-8371-46DAF5C4E611}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5B2A12A4-6ED7-4CD1-8371-46DAF5C4E611}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/tct-suite-vs/Resource/Tizen.Applications.UI.Tests/code/UIApp.Tizen/UIApp.cs b/tct-suite-vs/Resource/Tizen.Applications.UI.Tests/code/UIApp.Tizen/UIApp.cs new file mode 100755 index 000000000..cb5fa4410 --- /dev/null +++ b/tct-suite-vs/Resource/Tizen.Applications.UI.Tests/code/UIApp.Tizen/UIApp.cs @@ -0,0 +1,45 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +using Xamarin.Forms; + +namespace UIApp +{ + public class App : Application + { + public App() + { + // The root page of your application + MainPage = new ContentPage + { + Content = new StackLayout + { + VerticalOptions = LayoutOptions.Center, + Children = { + new Label { + HorizontalTextAlignment = TextAlignment.Center, + Text = "Welcome to Xamarin Forms!" + } + } + } + }; + } + + protected override void OnStart() + { + // Handle when your app starts + } + + protected override void OnSleep() + { + // Handle when your app sleeps + } + + protected override void OnResume() + { + // Handle when your app resumes + } + } +} diff --git a/tct-suite-vs/Resource/Tizen.Applications.UI.Tests/code/UIApp.Tizen/shared/res/UIApp.Tizen.png b/tct-suite-vs/Resource/Tizen.Applications.UI.Tests/code/UIApp.Tizen/shared/res/UIApp.Tizen.png new file mode 100755 index 000000000..9765b1bda Binary files /dev/null and b/tct-suite-vs/Resource/Tizen.Applications.UI.Tests/code/UIApp.Tizen/shared/res/UIApp.Tizen.png differ diff --git a/tct-suite-vs/Resource/Tizen.Applications.UI.Tests/code/UIApp.Tizen/tizen-manifest.xml b/tct-suite-vs/Resource/Tizen.Applications.UI.Tests/code/UIApp.Tizen/tizen-manifest.xml new file mode 100755 index 000000000..02d595f82 --- /dev/null +++ b/tct-suite-vs/Resource/Tizen.Applications.UI.Tests/code/UIApp.Tizen/tizen-manifest.xml @@ -0,0 +1,14 @@ + + + + + UIApp.Tizen.png + + + diff --git a/tct-suite-vs/Tizen.Applications.MessagePort.Tests/Program.cs b/tct-suite-vs/Tizen.Applications.MessagePort.Tests/Program.cs new file mode 100755 index 000000000..119c8b232 --- /dev/null +++ b/tct-suite-vs/Tizen.Applications.MessagePort.Tests/Program.cs @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2018 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 System; +using NUnitLite.TUnit; +using AutoTemplate; + +namespace XamarinForTizen.Tizen +{ + + class Program : global::Xamarin.Forms.Platform.Tizen.FormsApplication + { + private static App _app; + protected override void OnCreate() + { + base.OnCreate(); + + Console.WriteLine("TCT : OnCreate()"); + _app = new App(); + LoadApplication(_app); + + TRunner t = new TRunner(); + t.LoadTestsuite(); + t.Execute(); + } + + public static App getApp() + { + return _app; + } + static void Main(string[] args) + { + Console.WriteLine("TCT : Main()"); + var app = new Program(); + global::Xamarin.Forms.Forms.Init(app); + app.Run(args); + } + } +} diff --git a/tct-suite-vs/Tizen.Applications.MessagePort.Tests/Tizen.Applications.MessagePort.Tests.csproj b/tct-suite-vs/Tizen.Applications.MessagePort.Tests/Tizen.Applications.MessagePort.Tests.csproj new file mode 100755 index 000000000..dda4f4abb --- /dev/null +++ b/tct-suite-vs/Tizen.Applications.MessagePort.Tests/Tizen.Applications.MessagePort.Tests.csproj @@ -0,0 +1,41 @@ + + + + + Exe + tizen80 + Tizen + + + + + true + + + + portable + + + None + + + + + + + + + + + Runtime + + + + + + + + + + + diff --git a/tct-suite-vs/Tizen.Applications.MessagePort.Tests/Tizen.Applications.MessagePort.Tests.sln b/tct-suite-vs/Tizen.Applications.MessagePort.Tests/Tizen.Applications.MessagePort.Tests.sln new file mode 100755 index 000000000..261fb1520 --- /dev/null +++ b/tct-suite-vs/Tizen.Applications.MessagePort.Tests/Tizen.Applications.MessagePort.Tests.sln @@ -0,0 +1,78 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.30104.148 +MinimumVisualStudioVersion = 15.0.26124.0 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Applications.MessagePort.Tests", "Tizen.Applications.MessagePort.Tests.csproj", "{D92BEEAC-3B2A-45F8-8C53-53B92550404A}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "nunit.framework", "..\nunit.framework\nunit.framework.csproj", "{B9E7C1FD-CB38-42F7-AC43-7BD2E5B4D216}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "nunitlite", "..\nunitlite\nunitlite.csproj", "{FDB8025A-C029-461F-895E-287B4C65939B}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AutoTemplate", "..\Template\AutoTemplate\AutoTemplate.csproj", "{B11ABB0C-C3C1-4B5C-8251-A15628A775F3}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|Any CPU = Release|Any CPU + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {D92BEEAC-3B2A-45F8-8C53-53B92550404A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D92BEEAC-3B2A-45F8-8C53-53B92550404A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D92BEEAC-3B2A-45F8-8C53-53B92550404A}.Debug|x64.ActiveCfg = Debug|Any CPU + {D92BEEAC-3B2A-45F8-8C53-53B92550404A}.Debug|x64.Build.0 = Debug|Any CPU + {D92BEEAC-3B2A-45F8-8C53-53B92550404A}.Debug|x86.ActiveCfg = Debug|Any CPU + {D92BEEAC-3B2A-45F8-8C53-53B92550404A}.Debug|x86.Build.0 = Debug|Any CPU + {D92BEEAC-3B2A-45F8-8C53-53B92550404A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D92BEEAC-3B2A-45F8-8C53-53B92550404A}.Release|Any CPU.Build.0 = Release|Any CPU + {D92BEEAC-3B2A-45F8-8C53-53B92550404A}.Release|x64.ActiveCfg = Release|Any CPU + {D92BEEAC-3B2A-45F8-8C53-53B92550404A}.Release|x64.Build.0 = Release|Any CPU + {D92BEEAC-3B2A-45F8-8C53-53B92550404A}.Release|x86.ActiveCfg = Release|Any CPU + {D92BEEAC-3B2A-45F8-8C53-53B92550404A}.Release|x86.Build.0 = Release|Any CPU + {B9E7C1FD-CB38-42F7-AC43-7BD2E5B4D216}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B9E7C1FD-CB38-42F7-AC43-7BD2E5B4D216}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B9E7C1FD-CB38-42F7-AC43-7BD2E5B4D216}.Debug|x64.ActiveCfg = Debug|Any CPU + {B9E7C1FD-CB38-42F7-AC43-7BD2E5B4D216}.Debug|x64.Build.0 = Debug|Any CPU + {B9E7C1FD-CB38-42F7-AC43-7BD2E5B4D216}.Debug|x86.ActiveCfg = Debug|Any CPU + {B9E7C1FD-CB38-42F7-AC43-7BD2E5B4D216}.Debug|x86.Build.0 = Debug|Any CPU + {B9E7C1FD-CB38-42F7-AC43-7BD2E5B4D216}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B9E7C1FD-CB38-42F7-AC43-7BD2E5B4D216}.Release|Any CPU.Build.0 = Release|Any CPU + {B9E7C1FD-CB38-42F7-AC43-7BD2E5B4D216}.Release|x64.ActiveCfg = Release|Any CPU + {B9E7C1FD-CB38-42F7-AC43-7BD2E5B4D216}.Release|x64.Build.0 = Release|Any CPU + {B9E7C1FD-CB38-42F7-AC43-7BD2E5B4D216}.Release|x86.ActiveCfg = Release|Any CPU + {B9E7C1FD-CB38-42F7-AC43-7BD2E5B4D216}.Release|x86.Build.0 = Release|Any CPU + {FDB8025A-C029-461F-895E-287B4C65939B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FDB8025A-C029-461F-895E-287B4C65939B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FDB8025A-C029-461F-895E-287B4C65939B}.Debug|x64.ActiveCfg = Debug|Any CPU + {FDB8025A-C029-461F-895E-287B4C65939B}.Debug|x64.Build.0 = Debug|Any CPU + {FDB8025A-C029-461F-895E-287B4C65939B}.Debug|x86.ActiveCfg = Debug|Any CPU + {FDB8025A-C029-461F-895E-287B4C65939B}.Debug|x86.Build.0 = Debug|Any CPU + {FDB8025A-C029-461F-895E-287B4C65939B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FDB8025A-C029-461F-895E-287B4C65939B}.Release|Any CPU.Build.0 = Release|Any CPU + {FDB8025A-C029-461F-895E-287B4C65939B}.Release|x64.ActiveCfg = Release|Any CPU + {FDB8025A-C029-461F-895E-287B4C65939B}.Release|x64.Build.0 = Release|Any CPU + {FDB8025A-C029-461F-895E-287B4C65939B}.Release|x86.ActiveCfg = Release|Any CPU + {FDB8025A-C029-461F-895E-287B4C65939B}.Release|x86.Build.0 = Release|Any CPU + {B11ABB0C-C3C1-4B5C-8251-A15628A775F3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B11ABB0C-C3C1-4B5C-8251-A15628A775F3}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B11ABB0C-C3C1-4B5C-8251-A15628A775F3}.Debug|x64.ActiveCfg = Debug|Any CPU + {B11ABB0C-C3C1-4B5C-8251-A15628A775F3}.Debug|x64.Build.0 = Debug|Any CPU + {B11ABB0C-C3C1-4B5C-8251-A15628A775F3}.Debug|x86.ActiveCfg = Debug|Any CPU + {B11ABB0C-C3C1-4B5C-8251-A15628A775F3}.Debug|x86.Build.0 = Debug|Any CPU + {B11ABB0C-C3C1-4B5C-8251-A15628A775F3}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B11ABB0C-C3C1-4B5C-8251-A15628A775F3}.Release|Any CPU.Build.0 = Release|Any CPU + {B11ABB0C-C3C1-4B5C-8251-A15628A775F3}.Release|x64.ActiveCfg = Release|Any CPU + {B11ABB0C-C3C1-4B5C-8251-A15628A775F3}.Release|x64.Build.0 = Release|Any CPU + {B11ABB0C-C3C1-4B5C-8251-A15628A775F3}.Release|x86.ActiveCfg = Release|Any CPU + {B11ABB0C-C3C1-4B5C-8251-A15628A775F3}.Release|x86.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {ED382B91-9930-40B6-B3D7-362304C78680} + EndGlobalSection +EndGlobal diff --git a/tct-suite-vs/Tizen.Applications.MessagePort.Tests/shared/res/Tizen.Applications.MessagePort.Tests.png b/tct-suite-vs/Tizen.Applications.MessagePort.Tests/shared/res/Tizen.Applications.MessagePort.Tests.png new file mode 100755 index 000000000..9765b1bda Binary files /dev/null and b/tct-suite-vs/Tizen.Applications.MessagePort.Tests/shared/res/Tizen.Applications.MessagePort.Tests.png differ diff --git a/tct-suite-vs/Tizen.Applications.MessagePort.Tests/testcase/TSMessagePort.cs b/tct-suite-vs/Tizen.Applications.MessagePort.Tests/testcase/TSMessagePort.cs new file mode 100755 index 000000000..109338929 --- /dev/null +++ b/tct-suite-vs/Tizen.Applications.MessagePort.Tests/testcase/TSMessagePort.cs @@ -0,0 +1,438 @@ +using NUnit.Framework; +using NUnit.Framework.TUnit; +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Tizen.Applications.Messages; +using XamarinForTizen.Tizen; + +namespace Tizen.Applications.Tests +{ + + [TestFixture] + [Description("Tizen.Applications.Messages.MessagePort Test : send and receive messages between applications through MessagePort")] + public class MessagePortTests + { + protected readonly string LogTag = typeof(Program).Namespace; + private Tizen.Applications.Messages.MessagePort _messagePort; + private Task> _runningApps; + private Bundle _message; + private RemoteValues _remote; + private IEnumerable _list; + private const string PortName = "LocalPort"; + private const string MyRemoteAppId = "org.tizen.MsgPortApp.Tizen"; + private const string MyRemoteAppId1 = "org.tizen.MsgPortApp1.Tizen"; + private bool _flag; + + [SetUp] + public void Init() + { + _messagePort = null; + _flag = false; + } + + [TearDown] + public void Destroy() + { + _message = null; + _remote = null; + if (_messagePort != null) + { + _messagePort.Dispose(); + } + _flag = false; + if (_runningApps != null) + { + _runningApps = null; + } + } + + void MessageReceivedCallback(object sender, MessageReceivedEventArgs e) + { + Log.Debug(LogTag, "receive !! "); + _message = e.Message; + _remote = e.Remote; + LogUtils.Write(LogUtils.DEBUG, LogUtils.INFO, "Message Received "); + Console.WriteLine("TCT @@@ Message Received "); + if (e.Remote.AppId != null) + { + LogUtils.Write(LogUtils.DEBUG, LogUtils.INFO, "from :" + e.Remote.AppId); + _flag = true; + } + } + + void AppControlReplyCallback(Tizen.Applications.AppControl launchRequest, Tizen.Applications.AppControl replyRequest, AppControlReplyResult result) + { + + } + + [Test] + [Category("P1")] + [Description("Test : MessagePort Constructor")] + [Property("SPEC", " Tizen.Applications.Messages.MessagePort.MessagePort C")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "CONSTR")] + [Property("AUTHOR", "Nguyen Tien Dung, dung.nt5@samsung.com")] + public void MessagePort_INIT() + { + _messagePort = new Tizen.Applications.Messages.MessagePort(PortName, false); + + Assert.IsNotNull(_messagePort, "Object should not be null after initializing"); + Assert.IsInstanceOf(_messagePort.PortName); + Assert.AreEqual(PortName, _messagePort.PortName, "Value of \"PortName\" should be matched with value of \"portName\""); + Assert.IsInstanceOf(_messagePort.Trusted); + Assert.IsFalse(_messagePort.Trusted, "Value of \"Trusted\" should be false"); + } + + [Test] + [Category("P1")] + [Description("Test : MessagePort Property")] + [Property("SPEC", " Tizen.Applications.Messages.MessagePort.PortName A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PRW")] + [Property("AUTHOR", "Nguyen Tien Dung, dung.nt5@samsung.com")] + public void PortName_PROPERTY_SET_GET() + { + _messagePort = new Tizen.Applications.Messages.MessagePort(PortName, false); + + Assert.IsInstanceOf(_messagePort.PortName); + Assert.AreEqual(PortName, _messagePort.PortName, "Value of \"PortName\" should be matched with value of \"portName\""); + } + + [Test] + [Category("P1")] + [Description("Test : MessagePort Property")] + [Property("SPEC", " Tizen.Applications.Messages.MessagePort.Trusted A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PRW")] + [Property("AUTHOR", "Nguyen Tien Dung, dung.nt5@samsung.com")] + public void Trusted_PROPERTY_SET_GET() + { + _messagePort = new Tizen.Applications.Messages.MessagePort(PortName, false); + + Assert.IsInstanceOf(_messagePort.Trusted); + Assert.IsFalse(_messagePort.Trusted, "Value of \"Trusted\" should be false"); + } + + [Test] + [Category("P1")] + [Description("Test : MessagePort Property")] + [Property("SPEC", " Tizen.Applications.Messages.MessagePort.Listening A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PRO")] + [Property("AUTHOR", "Nguyen Tien Dung, dung.nt5@samsung.com")] + public void Listening_PROPERTY_GET() + { + /* PRECONDITION + * Init MessagePort + * Start listening + * */ + _messagePort = new Tizen.Applications.Messages.MessagePort(PortName, false); + + _messagePort.Listen(); + Assert.IsTrue(_messagePort.Listening, "The attribute \"Listening\" should be true"); + + /* TEST CODE */ + _messagePort.StopListening(); + Assert.IsFalse(_messagePort.Listening, "The attribute \"Listening\" should be false"); + } + + [Test] + [Category("P1")] + [Description("Test : Register a local message port - it should start listening message")] + [Property("SPEC", " Tizen.Applications.Messages.MessagePort.Listen M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Nguyen Tien Dung, dung.nt5@samsung.com")] + public void Listen_FROM_A_PORT() + { + /* PRECONDITION + * Init MessagePort + * */ + _messagePort = new Tizen.Applications.Messages.MessagePort(PortName, false); + + /* TEST CODE */ + _messagePort.Listen(); + Assert.IsTrue(_messagePort.Listening, "The attribute \"Listening\" should be true"); + + /* POSTCONDITION + * Unregisters the message port + * */ + _messagePort.StopListening(); + } + + [Test] + [Category("P1")] + [Description("Test : Unregister a local message port - it should stop listening message")] + [Property("SPEC", " Tizen.Applications.Messages.MessagePort.StopListening M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Nguyen Tien Dung, dung.nt5@samsung.com")] + public void StopListening_FROM_A_PORT() + { + /* PRECONDITION + * Init MessagePort + * Start listening + * */ + _messagePort = new Tizen.Applications.Messages.MessagePort(PortName, false); + + _messagePort.Listen(); + + /* TEST CODE */ + _messagePort.StopListening(); + Assert.IsFalse(_messagePort.Listening, "The attribute \"Listening\" should be false"); + } + + [Test] + [Category("P1")] + [Description("Test : Send a message to a remote application")] + [Property("SPEC", " Tizen.Applications.Messages.MessagePort.Send M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Nguyen Tien Dung, dung.nt5@samsung.com")] + [Property("COVPARAM", "Tizen.Applications.Bundle, string, string")] + public async Task Send_A_MESSAGE_TO_A_REMOTE_APP() + { + /* PRECONDITION + * 1)Install org.tizen.MsgPortApp.tpk and run it + * 2)Init MessagePort -> Start listening + * */ + string myRemotePort = "RemotePort"; + bool isRunning = false; + bool trusted = false; + + _runningApps = ApplicationManager.GetRunningApplicationsAsync(); + _list = await _runningApps; + foreach (var app in _list) + { + if (app.ApplicationId == MyRemoteAppId) + { + isRunning = true; + break; + } + + } + Assert.IsTrue(isRunning, MyRemoteAppId + "should be running"); + + _messagePort = new Tizen.Applications.Messages.MessagePort(PortName, trusted); + _messagePort.MessageReceived += MessageReceivedCallback; + _messagePort.Listen(); + + /* TEST CODE */ + var msg = new Bundle(); + Assert.IsNotNull(msg, "Object \"msg\" should not be null after initializing"); + msg.AddItem("message", "Send_A_MESSAGE_TO_A_REMOTE_APP"); + _messagePort.Send(msg, MyRemoteAppId, myRemotePort); + + Log.Debug(LogTag, "send !! "); + + + await Task.Delay(2000); + Assert.IsTrue(_flag, "Message is not sent"); + _messagePort.MessageReceived -= MessageReceivedCallback; + + /* POSTCONDITION + * Unregisters the message port + * */ + _messagePort.StopListening(); + } + + [Test] + [Category("P1")] + [Description("Test : Send a message to a remote application")] + [Property("SPEC", " Tizen.Applications.Messages.MessagePort.Send M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Nguyen Tien Dung, dung.nt5@samsung.com")] + [Property("COVPARAM", "Tizen.Applications.Bundle, string, string, bool")] + public async Task Send_A_TRUSTED_MESSAGE_TO_A_REMOTE_APP() + { + /* PRECONDITION + * 1)Install org.tizen.MsgPortApp.tpk and run it + * 2)Init MessagePort -> Start listening + * */ + string myRemotePort = "RemotePort1"; + bool isRunning = false; + bool trusted = true; + + _runningApps = ApplicationManager.GetRunningApplicationsAsync(); + _list = await _runningApps; + foreach (var app in _list) + { + if (app.ApplicationId == MyRemoteAppId) + { + isRunning = true; + break; + } + } + Assert.IsTrue(isRunning, MyRemoteAppId + "should be running"); + + _messagePort = new Tizen.Applications.Messages.MessagePort(PortName, trusted); + _messagePort.MessageReceived += MessageReceivedCallback; + _messagePort.Listen(); + + /* TEST CODE */ + var trustedMsg = new Bundle(); + Assert.IsNotNull(trustedMsg, "Object \"msg\" should not be null after initializing"); + trustedMsg.AddItem("message", "Send_A_TRUSTED_MESSAGE_TO_A_REMOTE_APP"); + _messagePort.Send(trustedMsg, MyRemoteAppId, myRemotePort, trusted); + + await Task.Delay(2000); + Assert.IsTrue(_flag, "Message is not sent"); + _messagePort.MessageReceived -= MessageReceivedCallback; + + /* POSTCONDITION + * Unregisters the message port + * */ + _messagePort.StopListening(); + } + + [Test] + [Category("P1")] + [Description("Test : Check MessageReceived event when receiving a message from a remote application")] + [Property("SPEC", " Tizen.Applications.Messages.MessagePort.MessageReceived E")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "EVL")] + [Property("AUTHOR", "Nguyen Tien Dung, dung.nt5@samsung.com")] + public async Task MessageReceived_CHECK_EVENT() + { + /* PRECONDITION + * 1)Install org.tizen.MsgPortApp.tpk and run it + * 2)Init MessagePort -> Start listening -> Send a message to remoteApp and wait for callback message to check event + * */ + string myRemotePort = "RemotePort"; + bool isRunning = false; + bool trusted = false; + + _runningApps = ApplicationManager.GetRunningApplicationsAsync(); + _list = await _runningApps; + foreach (var app in _list) + { + if (app.ApplicationId == MyRemoteAppId1) + { + isRunning = true; + break; + } + + } + Assert.IsTrue(isRunning, MyRemoteAppId1 + "should be running"); + + _messagePort = new Tizen.Applications.Messages.MessagePort(PortName, trusted); + _messagePort.MessageReceived += MessageReceivedCallback; + _messagePort.Listen(); + + var msg = new Bundle(); + Assert.IsNotNull(msg, "Object \"msg\" should not be null after initializing"); + msg.AddItem("message", "MessageReceived_CHECK_EVENT"); + _messagePort.Send(msg, MyRemoteAppId1, myRemotePort); + await Task.Delay(2000); + + /* TEST CODE */ + Assert.IsTrue(_flag, "MessageReceived event when receiving a message from a remote application"); + _messagePort.MessageReceived -= MessageReceivedCallback; + + /* POSTCONDITION + * Unregisters the message port + * */ + _messagePort.StopListening(); + } + + //[Test] + //[Category("P1")] + //[Description("Test Message Remote of MessageReceivedEventArgs.")] + //[Property("SPEC", " Tizen.Applications.Messages.MessageReceivedEventArgs.Message A")] + //[Property("SPEC_URL", "-")] + //[Property("CRITERIA", "PRO")] + //[Property("AUTHOR", "Pham Phuong Dong, dong.phuong@samsung.com")] + //public async Task Message_GET() { + // /* PRECONDITION + // * 1)Install org.tizen.MsgPortApp.tpk and run it + // * 2)Init MessagePort -> Start listening -> Send a message to remoteApp and wait for callback message to check event + // * */ + // if (s_message.Count == 0) { + // LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "message negative"); + // string myRemotePort = "RemotePort"; + // bool isRunning = false; + // bool trusted = false; + + // runningApps = ApplicationManager.GetRunningApplicationsAsync(); + // list = await runningApps; + // foreach (var app in list) { + // if (app.ApplicationId == myRemoteAppId1) { + // isRunning = true; + // break; + // } + + // } + // Assert.IsTrue(isRunning, myRemoteAppId1 + "should be running"); + + // messagePort = new Tizen.Applications.Messages.MessagePort(portName, trusted); + // Assert.IsNotNull(messagePort, "Object \"messagePort\" should not be null after initializing"); + // messagePort.MessageReceived += MessageReceivedCallback; + // messagePort.Listen(); + + // var msg = new Bundle(); + // Assert.IsNotNull(msg, "Object \"msg\" should not be null after initializing"); + // msg.AddItem("message", "MessageReceived_CHECK_EVENT"); + // messagePort.Send(msg, myRemoteAppId1, myRemotePort); + // await Task.Delay(2000); + // messagePort.MessageReceived -= MessageReceivedCallback; + // messagePort.StopListening(); + // } + + // /* TEST CODE */ + // Assert.Greater(s_message.Count, 0, "Message of MessageReceivedEventArgs should be more 0"); + //} + + //[Test] + //[Category("P1")] + //[Description("Test property Remote of MessageReceivedEventArgs.")] + //[Property("SPEC", " Tizen.Applications.Messages.MessageReceivedEventArgs.Remote A")] + //[Property("SPEC_URL", "-")] + //[Property("CRITERIA", "PRO")] + //[Property("AUTHOR", "Pham Phuong Dong, dong.phuong@samsung.com")] + //public async Task Remote_GET() { + // /* PRECONDITION + // * 1)Install org.tizen.MsgPortApp.tpk and run it + // * 2)Init MessagePort -> Start listening -> Send a message to remoteApp and wait for callback message to check event + // * */ + // LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Remote " + s_remote.AppId); + // if (s_remote.AppId == null) { + // LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Remote negative"); + // string myRemotePort = "RemotePort"; + // bool isRunning = false; + // bool trusted = false; + + // runningApps = ApplicationManager.GetRunningApplicationsAsync(); + // list = await runningApps; + // foreach (var app in list) { + // if (app.ApplicationId == myRemoteAppId1) { + // isRunning = true; + // break; + // } + + // } + // Assert.IsTrue(isRunning, myRemoteAppId1 + "should be running"); + + // messagePort = new Tizen.Applications.Messages.MessagePort(portName, trusted); + // Assert.IsNotNull(messagePort, "Object \"messagePort\" should not be null after initializing"); + // messagePort.MessageReceived += MessageReceivedCallback; + // messagePort.Listen(); + + // var msg = new Bundle(); + // Assert.IsNotNull(msg, "Object \"msg\" should not be null after initializing"); + // msg.AddItem("message", "MessageReceived_CHECK_EVENT"); + // messagePort.Send(msg, myRemoteAppId1, myRemotePort); + // await Task.Delay(2000); + // messagePort.MessageReceived -= MessageReceivedCallback; + // messagePort.StopListening(); + // } + + // /* TEST CODE */ + // string APP_ID = "org.tizen.MsgPortApp1"; + // Assert.AreEqual(APP_ID, s_remote.AppId, "AppId of Remote of MessageReceivedEventArgs should be " + APP_ID + "."); + // s_remote = null; + //} + } +} + diff --git a/tct-suite-vs/Tizen.Applications.MessagePort.Tests/testcase/TSMessageReceivedEventArgs.cs b/tct-suite-vs/Tizen.Applications.MessagePort.Tests/testcase/TSMessageReceivedEventArgs.cs new file mode 100755 index 000000000..0198e2079 --- /dev/null +++ b/tct-suite-vs/Tizen.Applications.MessagePort.Tests/testcase/TSMessageReceivedEventArgs.cs @@ -0,0 +1,178 @@ +using NUnit.Framework; +using NUnit.Framework.TUnit; +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Tizen.Applications.Messages; +using XamarinForTizen.Tizen; + +namespace Tizen.Applications.Tests +{ + + [TestFixture] + [Description("Test : argument of Received Message ")] + class MessageReceivedEventArgsTests + { + protected readonly string LogTag = typeof(Program).Namespace; + private Tizen.Applications.Messages.MessagePort _messagePort; + private Bundle _message; + private RemoteValues _remote; + private IEnumerable _list; + private const string PortName = "LocalPort"; + private const string MyRemoteAppId = "org.tizen.MsgPortApp.Tizen"; + private const string MyRemoteAppId1 = "org.tizen.MsgPortApp1.Tizen"; + private bool _flag; + + [SetUp] + public void Init() + { + _messagePort = null; + _flag = false; + } + + [TearDown] + public void Destroy() + { + if (_messagePort != null) + { + _messagePort.Dispose(); + } + } + + [Test] + [Category("P1")] + [Description("MessageReceivedEventArgs() constructor.")] + [Property("SPEC", "Tizen.Applications.Messages.MessageReceivedEventArgs.MessageReceivedEventArgs C")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "CONSTR")] + [Property("AUTHOR", "Dao Trong Hieu, tronghieu.d@samsung.com")] + public void MessageReceivedEventArgs_INIT() + { + /* TEST CODE */ + MessageReceivedEventArgs msgReceivedArgs = new MessageReceivedEventArgs(); + Assert.IsNotNull(msgReceivedArgs, "MessageReceivedEventArgs should be not null after init"); + } + + [Test] + [Category("P1")] + [Description("Test Message Remote of MessageReceivedEventArgs.")] + [Property("SPEC", " Tizen.Applications.Messages.MessageReceivedEventArgs.Message A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PRO")] + [Property("AUTHOR", "Pham Phuong Dong, dong.phuong@samsung.com")] + public async Task Message_GET() + { + /* PRECONDITION + * 1)Install org.tizen.MsgPortApp.tpk and run it + * 2)Init MessagePort -> Start listening -> Send a message to remoteApp and wait for callback message to check event + * */ + //LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "message start "); + if (_message == null) + { + //LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "message negative"); + string myRemotePort = "RemotePort"; + bool isRunning = false; + bool trusted = false; + + _list = await ApplicationManager.GetRunningApplicationsAsync(); + foreach (var app in _list) + { + if (app.ApplicationId == MyRemoteAppId1) + { + isRunning = true; + break; + } + + } + Assert.IsTrue(isRunning, MyRemoteAppId1 + "should be running"); + + _messagePort = new Tizen.Applications.Messages.MessagePort(PortName, trusted); + Assert.IsNotNull(_messagePort, "Object \"messagePort\" should not be null after initializing"); + _messagePort.MessageReceived += MessageReceivedCallback; + _messagePort.Listen(); + + var msg = new Bundle(); + Assert.IsNotNull(msg, "Object \"msg\" should not be null after initializing"); + msg.AddItem("message", "MessageReceived_CHECK_EVENT"); + _messagePort.Send(msg, MyRemoteAppId1, myRemotePort); + Log.Error(LogTag, "send !! "); + await Task.Delay(2000); + _messagePort.MessageReceived -= MessageReceivedCallback; + _messagePort.StopListening(); + } + + /* TEST CODE */ + //LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "message end"); + Assert.Greater(_message.Count, 0, "Message of MessageReceivedEventArgs should be more 0"); + } + + [Test] + [Category("P1")] + [Description("Test property Remote of MessageReceivedEventArgs.")] + [Property("SPEC", " Tizen.Applications.Messages.MessageReceivedEventArgs.Remote A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PRO")] + [Property("AUTHOR", "Pham Phuong Dong, dong.phuong@samsung.com")] + public async Task Remote_GET() + { + /* PRECONDITION + * 1)Install org.tizen.MsgPortApp.tpk and run it + * 2)Init MessagePort -> Start listening -> Send a message to remoteApp and wait for callback message to check event + * */ + //LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Remote start"); + if (_remote == null) + { + //LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Remote negative"); + string myRemotePort = "RemotePort"; + bool isRunning = false; + bool trusted = false; + + _list = await ApplicationManager.GetRunningApplicationsAsync(); + foreach (var app in _list) + { + if (app.ApplicationId == MyRemoteAppId1) + { + isRunning = true; + break; + } + + } + Assert.IsTrue(isRunning, MyRemoteAppId1 + "should be running"); + + _messagePort = new Tizen.Applications.Messages.MessagePort(PortName, trusted); + Assert.IsNotNull(_messagePort, "Object \"messagePort\" should not be null after initializing"); + _messagePort.MessageReceived += MessageReceivedCallback; + _messagePort.Listen(); + + var msg = new Bundle(); + Assert.IsNotNull(msg, "Object \"msg\" should not be null after initializing"); + msg.AddItem("message", "MessageReceived_CHECK_EVENT"); + _messagePort.Send(msg, MyRemoteAppId1, myRemotePort); + Log.Debug(LogTag, "send !! "); + await Task.Delay(2000); + _messagePort.MessageReceived -= MessageReceivedCallback; + _messagePort.StopListening(); + } + + /* TEST CODE */ + string APP_ID = "org.tizen.MsgPortApp1.Tizen"; + //LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Remote end"); + Assert.AreEqual(APP_ID, _remote.AppId, "AppId of Remote of MessageReceivedEventArgs should be " + APP_ID + "."); + _remote = null; + } + + void MessageReceivedCallback(object sender, MessageReceivedEventArgs e) + { + Log.Debug(LogTag, "receive !! "); + _message = e.Message; + _remote = e.Remote; + LogUtils.Write(LogUtils.DEBUG, LogUtils.INFO, "Message Received "); + Console.WriteLine("TCT @@@ Message Received "); + if (e.Remote.AppId != null) + { + LogUtils.Write(LogUtils.DEBUG, LogUtils.INFO, "from :" + e.Remote.AppId); + _flag = true; + } + } + } +} diff --git a/tct-suite-vs/Tizen.Applications.MessagePort.Tests/testcase/TSRemotePort.cs b/tct-suite-vs/Tizen.Applications.MessagePort.Tests/testcase/TSRemotePort.cs new file mode 100755 index 000000000..bf70cb2ac --- /dev/null +++ b/tct-suite-vs/Tizen.Applications.MessagePort.Tests/testcase/TSRemotePort.cs @@ -0,0 +1,197 @@ +using NUnit.Framework; +using NUnit.Framework.TUnit; +using Tizen.Applications.Messages; +using System.Threading.Tasks; +using System.Collections.Generic; + +namespace Tizen.Applications.Tests +{ + + [TestFixture] + [Description("RemotePort information Test")] + class RemotePortTests + { + public RemotePort _remotePort; + private MessagePort _messagePort; + public const string remoteAppId = "org.tizen.MsgPortApp.Tizen"; + public const string myRemotePort = "TestRemotePort"; + private Task> _runningApps; + private IEnumerable _list; + private bool _flag; + + [SetUp] + public void Init() + { + LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Preconditions for each TEST"); + } + + [TearDown] + public void Destroy() + { + LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Postconditions for each TEST"); + + _flag = false; + if (_remotePort != null) + { + _remotePort.Dispose(); + } + if (_messagePort != null) + { + _messagePort.Dispose(); + } + if (_runningApps != null) + { + _runningApps = null; + } + } + private void RemotePortStateChangedCallback(object sender, RemotePortStateChangedEventArgs e) + { + _flag = true; + Log.Debug("REMOTEPORT", "@@# RemotePortStateChangedCallback : " + _flag); + } + + [Test] + [Category("P1")] + [Description("RemotePort() constructor")] + [Property("SPEC", "Tizen.Applications.Messages.RemotePort.RemotePort C")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "CONSTR")] + [Property("AUTHOR", "Sukhyung Kang, shine.kang@samsung.com")] + public void RemotePort_INIT() + { + Log.Debug("REMOTEPORT", "@@# RemotePort_INIT"); + /* TEST CODE */ + _remotePort = new RemotePort(remoteAppId, myRemotePort, false); + Assert.IsNotNull(_remotePort, "_remotePort object should be not null after initializing"); + Assert.IsInstanceOf(_remotePort, "_remotePort object must be RemotePort instance"); + } + + [Test] + [Category("P1")] + [Description("Gets RemotePort AppId")] + [Property("SPEC", "Tizen.Applications.Messages.RemotePort.AppId A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PRW")] + [Property("AUTHOR", "Sukhyung Kang, shine.kang@samsung.com")] + public void AppId_PROPERTY_GET() + { + Log.Debug("REMOTEPORT", "@@# AppId_PROPERTY_GET"); + /* TEST CODE */ + _remotePort = new RemotePort(remoteAppId, myRemotePort, false); + + Assert.IsInstanceOf(_remotePort.AppId); + Assert.AreEqual(remoteAppId, _remotePort.AppId, "Value of _remotePort.AppId must be matched with remoteAppId"); + } + + [Test] + [Category("P1")] + [Description("RemotePort PortName.")] + [Property("SPEC", "Tizen.Applications.Messages.RemotePort.PortName A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PRW")] + [Property("AUTHOR", "Sukhyung Kang, shine.kang@samsung.com")] + public void PortName_PROPERTY_GET() + { + Log.Debug("REMOTEPORT", "@@# PortName_PROPERTY_GET"); + /* TEST CODE */ + _remotePort = new RemotePort(remoteAppId, myRemotePort, false); + + Assert.IsInstanceOf(_remotePort.PortName); + Assert.AreEqual(myRemotePort, _remotePort.PortName, "Value of _remotePort.PortName must be matched with myRemotePort"); + } + + [Test] + [Category("P1")] + [Description("RemotePort PortName.")] + [Property("SPEC", "Tizen.Applications.Messages.RemotePort.Trusted A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PRW")] + [Property("AUTHOR", "Sukhyung Kang, shine.kang@samsung.com")] + public void Trusted_PROPERTY_GET() + { + Log.Debug("REMOTEPORT", "@@# Trusted_PROPERTY_GET"); + /* TEST CODE */ + _remotePort = new RemotePort(remoteAppId, myRemotePort, false); + + Assert.IsInstanceOf(_remotePort.Trusted); + Assert.IsFalse(_remotePort.Trusted, "Value of _remotePort.PortName must be false"); + } + + [Test] + [Category("P1")] + [Description("RemotePort PortName.")] + [Property("SPEC", "Tizen.Applications.Messages.RemotePort.IsRunning M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Sukhyung Kang, shine.kang@samsung.com")] + public async Task IsRunning_CHECK_VALUE() + { + Log.Debug("REMOTEPORT", "@@# IsRunning_CHECK_VALUE"); + /* TEST CODE */ + bool appIsRunning = false; + bool portIsRunning = false; + + _runningApps = ApplicationManager.GetRunningApplicationsAsync(); + _list = await _runningApps; + foreach (var app in _list) + { + if (app.ApplicationId == remoteAppId) + { + appIsRunning = true; + break; + } + + } + Assert.IsTrue(appIsRunning, remoteAppId + " should be running"); + + _remotePort = new RemotePort(remoteAppId, myRemotePort, false); + + portIsRunning = _remotePort.IsRunning(); + + Assert.IsTrue(portIsRunning, "_remotePort must be running"); + } + + [Test] + [Category("P1")] + [Description("RemotePort RemotePortStateChanged.")] + [Property("SPEC", "Tizen.Applications.Messages.RemotePort.RemotePortStateChanged E")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "EVL")] + [Property("AUTHOR", "Sukhyung Kang, shine.kang@samsung.com")] + public async Task RemotePortStateChanged_EVENT() + { + Log.Debug("REMOTEPORT", "@@# RemotePortStateChanged_EVENT"); + bool isRunning = false; + _flag = false; + string controlRemotePort = "ControlRemotePort"; + + _runningApps = ApplicationManager.GetRunningApplicationsAsync(); + _list = await _runningApps; + foreach (var app in _list) + { + if (app.ApplicationId == remoteAppId) + { + isRunning = true; + break; + } + + } + Assert.IsTrue(isRunning, remoteAppId + " should be running"); + + _remotePort = new RemotePort(remoteAppId, myRemotePort, false); + _remotePort.RemotePortStateChanged += RemotePortStateChangedCallback; + + _messagePort = new MessagePort(controlRemotePort, false); + _messagePort.Listen(); + + var msg = new Bundle(); + Assert.IsNotNull(msg, "Object \"msg\" should not be null after initializing"); + + msg.AddItem("message", "ChangeState"); + _messagePort.Send(msg, remoteAppId, controlRemotePort); + await Task.Delay(5000); + + Assert.IsTrue(_flag, "RemotePortStateChanged callback is not called"); + } + } +} diff --git a/tct-suite-vs/Tizen.Applications.MessagePort.Tests/testcase/TSRemotePortStateChangedEventArgs.cs b/tct-suite-vs/Tizen.Applications.MessagePort.Tests/testcase/TSRemotePortStateChangedEventArgs.cs new file mode 100755 index 000000000..3a23de3d7 --- /dev/null +++ b/tct-suite-vs/Tizen.Applications.MessagePort.Tests/testcase/TSRemotePortStateChangedEventArgs.cs @@ -0,0 +1,123 @@ +using NUnit.Framework; +using NUnit.Framework.TUnit; +using Tizen.Applications.Messages; +using System.Threading.Tasks; +using System.Collections.Generic; + +namespace Tizen.Applications.Tests +{ + + [TestFixture] + [Description("RemotePortStateChangedEventArgs Test")] + class RemotePortStateChangedEventArgsTests + { + public RemotePort _remotePort; + private MessagePort _messagePort; + public const string remoteAppId = "org.tizen.MsgPortApp.Tizen"; + public const string myRemotePort = "TestRemotePort"; + private Task> _runningApps; + private IEnumerable _list; + private RemotePortStateChangedEventArgs _changeState; + private bool _flag; + private State _state; + + [SetUp] + public void Init() + { + LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Preconditions for each TEST"); + } + + [TearDown] + public void Destroy() + { + LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Postconditions for each TEST"); + + _flag = false; + if (_remotePort != null) + { + _remotePort.Dispose(); + } + if (_messagePort != null) + { + _messagePort.Dispose(); + } + if (_runningApps != null) + { + _runningApps = null; + } + if (_changeState != null) + { + _changeState = null; + } + } + + [Test] + [Category("P1")] + [Description("RemotePortStateChangedEventArgs() constructor")] + [Property("SPEC", "Tizen.Applications.Messages.RemotePortStateChangedEventArgs.RemotePortStateChangedEventArgs C")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "CONSTR")] + [Property("AUTHOR", "Sukhyung Kang, shine.kang@samsung.com")] + public void RemotePortStateChangedEventArgs_INIT() + { + Log.Debug("REMOTEPORT", "@@# RemotePortStateChangedEventArgs_INIT"); + /* TEST CODE */ + _changeState = new RemotePortStateChangedEventArgs(); + Assert.IsNotNull(_changeState, "_changeState object should be not null after initializing"); + Assert.IsInstanceOf(_changeState, "_changeState object must be RemotePortStateChangedEventArgs instance"); + } + + private void RemotePortStateChangedCallback(object sender, RemotePortStateChangedEventArgs e) + { + _flag = true; + _state = e.Status; + Log.Debug("REMOTEPORT", "@@# RemotePortStateChangedCallback : " + _flag); + } + + [Test] + [Category("P1")] + [Description("RemotePortStateChangedEventArgs Status check.")] + [Property("SPEC", "Tizen.Applications.Messages.RemotePortStateChangedEventArgs.Status A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PRW")] + [Property("AUTHOR", "Sukhyung Kang, shine.kang@samsung.com")] + public async Task Status_PROPERTY_GET() + { + Log.Debug("REMOTEPORT", "@@# Status_PROPERTY_GET"); + bool isRunning = false; + _flag = false; + string controlRemotePort = "ControlRemotePort"; + + _runningApps = ApplicationManager.GetRunningApplicationsAsync(); + _list = await _runningApps; + foreach (var app in _list) + { + if (app.ApplicationId == remoteAppId) + { + isRunning = true; + break; + } + + } + Assert.IsTrue(isRunning, remoteAppId + " should be running"); + + _remotePort = new RemotePort(remoteAppId, myRemotePort, false); + _remotePort.RemotePortStateChanged += RemotePortStateChangedCallback; + + _messagePort = new MessagePort(controlRemotePort, false); + _messagePort.Listen(); + + var msg = new Bundle(); + Assert.IsNotNull(msg, "Object \"msg\" should not be null after initializing"); + + msg.AddItem("message", "ChangeState"); + _messagePort.Send(msg, remoteAppId, controlRemotePort); + await Task.Delay(5000); + + Assert.IsTrue(_flag, "RemotePortStateChanged callback is not called"); + Assert.IsNotNull(_state, "RemotePortStateChangedEventArgs must not be null"); + + Log.Debug("REMOTEPORT", "@@# Status_PROPERTY_GET state : " + _state.ToString()); + } + } +} diff --git a/tct-suite-vs/Tizen.Applications.MessagePort.Tests/testcase/TSRemoteValues.cs b/tct-suite-vs/Tizen.Applications.MessagePort.Tests/testcase/TSRemoteValues.cs new file mode 100755 index 000000000..e23c79781 --- /dev/null +++ b/tct-suite-vs/Tizen.Applications.MessagePort.Tests/testcase/TSRemoteValues.cs @@ -0,0 +1,97 @@ +using NUnit.Framework; +using NUnit.Framework.TUnit; + +namespace Tizen.Applications.Tests +{ + + [TestFixture] + [Description("Test : Remote Values ")] + class RemoteValuesTests + { + public Tizen.Applications.Messages.RemoteValues _remoteValue; + public const string MyRemoteAppId = "org.tizen.myRemoteAppId"; + public const string MyRemotePortName = "myRemotePortName"; + + [SetUp] + public void Init() + { + LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Preconditions for each TEST"); + } + + [TearDown] + public void Destroy() + { + LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Postconditions for each TEST"); + + _remoteValue = null; + } + + [Test] + [Category("P1")] + [Description("RemoteValues() constructor.")] + [Property("SPEC", "Tizen.Applications.Messages.RemoteValues.RemoteValues C")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "CONSTR")] + [Property("AUTHOR", "Dao Trong Hieu, tronghieu.d@samsung.com")] + public void RemoteValues_INIT() + { + /* TEST CODE */ + _remoteValue = new Tizen.Applications.Messages.RemoteValues(); + Assert.IsNotNull(_remoteValue, "RemoteValues object should be not null after initializing"); + } + + [Test] + [Category("P1")] + [Description("Test : RemoteValues Properties.")] + [Property("SPEC", "Tizen.Applications.Messages.RemoteValues.AppId A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Nguyen Tien Dung, dung.nt5@samsung.com")] + public void AppId_PROPERTY_SET_GET() + { + /* TEST CODE */ + _remoteValue = new Tizen.Applications.Messages.RemoteValues(); + Assert.IsNotNull(_remoteValue, "RemoteValues object should be not null after initializing"); + + _remoteValue.AppId = MyRemoteAppId; + Assert.IsInstanceOf(_remoteValue.AppId); + Assert.AreEqual(MyRemoteAppId, _remoteValue.AppId, "Propety \"AppId\": the set value and the get value are not equal"); + } + + [Test] + [Category("P1")] + [Description("Test : RemoteValues Properties.")] + [Property("SPEC", "Tizen.Applications.Messages.RemoteValues.PortName A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Nguyen Tien Dung, dung.nt5@samsung.com")] + public void PortName_PROPERTY_SET_GET() + { + /* TEST CODE */ + _remoteValue = new Tizen.Applications.Messages.RemoteValues(); + Assert.IsNotNull(_remoteValue, "RemoteValues object should be not null after initializing"); + + _remoteValue.PortName = MyRemotePortName; + Assert.IsInstanceOf(_remoteValue.PortName); + Assert.AreEqual(MyRemotePortName, _remoteValue.PortName, "Property \"PortName\": the set value and the get value are not equal"); + } + + [Test] + [Category("P1")] + [Description("Test : RemoteValues Properties.")] + [Property("SPEC", "Tizen.Applications.Messages.RemoteValues.Trusted A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Nguyen Tien Dung, dung.nt5@samsung.com")] + public void Trusted_PROPERTY_SET_GET() + { + /* TEST CODE */ + _remoteValue = new Tizen.Applications.Messages.RemoteValues(); + Assert.IsNotNull(_remoteValue, "RemoteValues object should be not null after initializing"); + + _remoteValue.Trusted = false; + Assert.IsInstanceOf(_remoteValue.Trusted); + Assert.IsFalse(_remoteValue.Trusted, "Property \"Trusted\": the set value and the get value are not equal"); + } + } +} diff --git a/tct-suite-vs/Tizen.Applications.MessagePort.Tests/tizen-manifest.xml b/tct-suite-vs/Tizen.Applications.MessagePort.Tests/tizen-manifest.xml new file mode 100755 index 000000000..471ae80c7 --- /dev/null +++ b/tct-suite-vs/Tizen.Applications.MessagePort.Tests/tizen-manifest.xml @@ -0,0 +1,16 @@ + + + + + Tizen.Applications.MessagePort.Tests.png + + + + http://tizen.org/privilege/appmanager.launch + + diff --git a/tct-suite-vs/Tizen.Applications.Preference.Tests/Program.cs b/tct-suite-vs/Tizen.Applications.Preference.Tests/Program.cs new file mode 100755 index 000000000..129489a65 --- /dev/null +++ b/tct-suite-vs/Tizen.Applications.Preference.Tests/Program.cs @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2018 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 System; +using NUnitLite.TUnit; +using AutoTemplate; + +namespace XamarinForTizen.Tizen +{ + + class Program : global::Xamarin.Forms.Platform.Tizen.FormsApplication + { + private static App _app; + protected override void OnCreate() + { + base.OnCreate(); + + Console.WriteLine("TCT : OnCreate()"); + _app = new App(); + LoadApplication(_app); + + TRunner t = new TRunner(); + t.LoadTestsuite(); + t.Execute(); + } + + public static App getApp() + { + return _app; + } + static void Main(string[] args) + { + Console.WriteLine("TCT : Main()"); + var app = new Program(); + global::Xamarin.Forms.Forms.Init(app); + app.Run(args); + } + } +} diff --git a/tct-suite-vs/Tizen.Applications.Preference.Tests/Tizen.Applications.Preference.Tests.csproj b/tct-suite-vs/Tizen.Applications.Preference.Tests/Tizen.Applications.Preference.Tests.csproj new file mode 100755 index 000000000..f837ac3bf --- /dev/null +++ b/tct-suite-vs/Tizen.Applications.Preference.Tests/Tizen.Applications.Preference.Tests.csproj @@ -0,0 +1,40 @@ + + + + + Exe + tizen80 + Tizen + + + + + true + + + + portable + + + None + + + + + + + + + + + Runtime + + + + + + + + + + diff --git a/tct-suite-vs/Tizen.Applications.Preference.Tests/Tizen.Applications.Preference.Tests.sln b/tct-suite-vs/Tizen.Applications.Preference.Tests/Tizen.Applications.Preference.Tests.sln new file mode 100755 index 000000000..aa5741467 --- /dev/null +++ b/tct-suite-vs/Tizen.Applications.Preference.Tests/Tizen.Applications.Preference.Tests.sln @@ -0,0 +1,78 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.30104.148 +MinimumVisualStudioVersion = 15.0.26124.0 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Applications.Preference.Tests", "Tizen.Applications.Preference.Tests.csproj", "{D92BEEAC-3B2A-45F8-8C53-53B92550404A}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "nunit.framework", "..\nunit.framework\nunit.framework.csproj", "{B9E7C1FD-CB38-42F7-AC43-7BD2E5B4D216}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "nunitlite", "..\nunitlite\nunitlite.csproj", "{FDB8025A-C029-461F-895E-287B4C65939B}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AutoTemplate", "..\Template\AutoTemplate\AutoTemplate.csproj", "{B11ABB0C-C3C1-4B5C-8251-A15628A775F3}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|Any CPU = Release|Any CPU + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {D92BEEAC-3B2A-45F8-8C53-53B92550404A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D92BEEAC-3B2A-45F8-8C53-53B92550404A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D92BEEAC-3B2A-45F8-8C53-53B92550404A}.Debug|x64.ActiveCfg = Debug|Any CPU + {D92BEEAC-3B2A-45F8-8C53-53B92550404A}.Debug|x64.Build.0 = Debug|Any CPU + {D92BEEAC-3B2A-45F8-8C53-53B92550404A}.Debug|x86.ActiveCfg = Debug|Any CPU + {D92BEEAC-3B2A-45F8-8C53-53B92550404A}.Debug|x86.Build.0 = Debug|Any CPU + {D92BEEAC-3B2A-45F8-8C53-53B92550404A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D92BEEAC-3B2A-45F8-8C53-53B92550404A}.Release|Any CPU.Build.0 = Release|Any CPU + {D92BEEAC-3B2A-45F8-8C53-53B92550404A}.Release|x64.ActiveCfg = Release|Any CPU + {D92BEEAC-3B2A-45F8-8C53-53B92550404A}.Release|x64.Build.0 = Release|Any CPU + {D92BEEAC-3B2A-45F8-8C53-53B92550404A}.Release|x86.ActiveCfg = Release|Any CPU + {D92BEEAC-3B2A-45F8-8C53-53B92550404A}.Release|x86.Build.0 = Release|Any CPU + {B9E7C1FD-CB38-42F7-AC43-7BD2E5B4D216}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B9E7C1FD-CB38-42F7-AC43-7BD2E5B4D216}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B9E7C1FD-CB38-42F7-AC43-7BD2E5B4D216}.Debug|x64.ActiveCfg = Debug|Any CPU + {B9E7C1FD-CB38-42F7-AC43-7BD2E5B4D216}.Debug|x64.Build.0 = Debug|Any CPU + {B9E7C1FD-CB38-42F7-AC43-7BD2E5B4D216}.Debug|x86.ActiveCfg = Debug|Any CPU + {B9E7C1FD-CB38-42F7-AC43-7BD2E5B4D216}.Debug|x86.Build.0 = Debug|Any CPU + {B9E7C1FD-CB38-42F7-AC43-7BD2E5B4D216}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B9E7C1FD-CB38-42F7-AC43-7BD2E5B4D216}.Release|Any CPU.Build.0 = Release|Any CPU + {B9E7C1FD-CB38-42F7-AC43-7BD2E5B4D216}.Release|x64.ActiveCfg = Release|Any CPU + {B9E7C1FD-CB38-42F7-AC43-7BD2E5B4D216}.Release|x64.Build.0 = Release|Any CPU + {B9E7C1FD-CB38-42F7-AC43-7BD2E5B4D216}.Release|x86.ActiveCfg = Release|Any CPU + {B9E7C1FD-CB38-42F7-AC43-7BD2E5B4D216}.Release|x86.Build.0 = Release|Any CPU + {FDB8025A-C029-461F-895E-287B4C65939B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FDB8025A-C029-461F-895E-287B4C65939B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FDB8025A-C029-461F-895E-287B4C65939B}.Debug|x64.ActiveCfg = Debug|Any CPU + {FDB8025A-C029-461F-895E-287B4C65939B}.Debug|x64.Build.0 = Debug|Any CPU + {FDB8025A-C029-461F-895E-287B4C65939B}.Debug|x86.ActiveCfg = Debug|Any CPU + {FDB8025A-C029-461F-895E-287B4C65939B}.Debug|x86.Build.0 = Debug|Any CPU + {FDB8025A-C029-461F-895E-287B4C65939B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FDB8025A-C029-461F-895E-287B4C65939B}.Release|Any CPU.Build.0 = Release|Any CPU + {FDB8025A-C029-461F-895E-287B4C65939B}.Release|x64.ActiveCfg = Release|Any CPU + {FDB8025A-C029-461F-895E-287B4C65939B}.Release|x64.Build.0 = Release|Any CPU + {FDB8025A-C029-461F-895E-287B4C65939B}.Release|x86.ActiveCfg = Release|Any CPU + {FDB8025A-C029-461F-895E-287B4C65939B}.Release|x86.Build.0 = Release|Any CPU + {B11ABB0C-C3C1-4B5C-8251-A15628A775F3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B11ABB0C-C3C1-4B5C-8251-A15628A775F3}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B11ABB0C-C3C1-4B5C-8251-A15628A775F3}.Debug|x64.ActiveCfg = Debug|Any CPU + {B11ABB0C-C3C1-4B5C-8251-A15628A775F3}.Debug|x64.Build.0 = Debug|Any CPU + {B11ABB0C-C3C1-4B5C-8251-A15628A775F3}.Debug|x86.ActiveCfg = Debug|Any CPU + {B11ABB0C-C3C1-4B5C-8251-A15628A775F3}.Debug|x86.Build.0 = Debug|Any CPU + {B11ABB0C-C3C1-4B5C-8251-A15628A775F3}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B11ABB0C-C3C1-4B5C-8251-A15628A775F3}.Release|Any CPU.Build.0 = Release|Any CPU + {B11ABB0C-C3C1-4B5C-8251-A15628A775F3}.Release|x64.ActiveCfg = Release|Any CPU + {B11ABB0C-C3C1-4B5C-8251-A15628A775F3}.Release|x64.Build.0 = Release|Any CPU + {B11ABB0C-C3C1-4B5C-8251-A15628A775F3}.Release|x86.ActiveCfg = Release|Any CPU + {B11ABB0C-C3C1-4B5C-8251-A15628A775F3}.Release|x86.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {ED382B91-9930-40B6-B3D7-362304C78680} + EndGlobalSection +EndGlobal diff --git a/tct-suite-vs/Tizen.Applications.Preference.Tests/shared/res/Tizen.Applications.Preference.Tests.png b/tct-suite-vs/Tizen.Applications.Preference.Tests/shared/res/Tizen.Applications.Preference.Tests.png new file mode 100755 index 000000000..9765b1bda Binary files /dev/null and b/tct-suite-vs/Tizen.Applications.Preference.Tests/shared/res/Tizen.Applications.Preference.Tests.png differ diff --git a/tct-suite-vs/Tizen.Applications.Preference.Tests/testcase/TSPreference.EventContext.cs b/tct-suite-vs/Tizen.Applications.Preference.Tests/testcase/TSPreference.EventContext.cs new file mode 100755 index 000000000..42cadb6ab --- /dev/null +++ b/tct-suite-vs/Tizen.Applications.Preference.Tests/testcase/TSPreference.EventContext.cs @@ -0,0 +1,98 @@ +using System; +using NUnit.Framework; +using NUnit.Framework.TUnit; +using System.Collections.Generic; +using System.Threading.Tasks; + +namespace Tizen.Applications.Tests +{ + [TestFixture] + [Description("Tizen.Applications.Preference.EventContext test case")] + public class EventContextTests + { + private bool _callbackIsCalled; + private PreferenceChangedEventArgs _preferChEvent; + [SetUp] + public void Init() + { + _callbackIsCalled = false; + LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Preconditions for each TEST"); + } + + [TearDown] + public void Destroy() + { + LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Postconditions for each TEST"); + } + + private void PreferenceChangedCallback(object sender, PreferenceChangedEventArgs preEv) + { + Log.Debug("PREF", "@@## PreferenceChangedCallback"); + _preferChEvent = preEv; + + _callbackIsCalled = true; + } + public async Task WaitCallback() + { + int count = 0; + while (true) + { + if (count < 3) + count = count + 1; + else + break; + + if (_callbackIsCalled == true) + break; + + await Task.Delay(1000); + } + } + + [Test] + [Category("P1")] + [Description("Test Preference EventContext changed callback calling")] + [Property("SPEC", "Tizen.Applications.Preference.EventContext.Changed E")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "EVL")] + [Property("AUTHOR", "Sukhyung Kang, shine.kang@samsung.com")] + public async Task Changed_CALLBACK() + { + Log.Debug("PREF", "@@## EventContext Changed_CALLBACK"); + + string intKey = "Gunter"; + _callbackIsCalled = false; + + _preferChEvent = new PreferenceChangedEventArgs(); + + try + { + Preference.Set(intKey, 33); + Preference.EventContext context; + Preference.GetEventContext(intKey).TryGetTarget(out context); + if (context != null) + { + context.Changed += PreferenceChangedCallback; + } + + Preference.Set(intKey, 77); + + await WaitCallback(); + + Assert.AreEqual(_callbackIsCalled, true, "preference callback is not called"); + Assert.AreEqual(_preferChEvent.Key, intKey, "preference key is not matched"); + + if (context != null) + { + context.Changed -= PreferenceChangedCallback; + } + + Preference.Remove(intKey); + } + catch (Exception e) + { + Assert.Fail(e.ToString()); + } + } + } +} diff --git a/tct-suite-vs/Tizen.Applications.Preference.Tests/testcase/TSPreference.cs b/tct-suite-vs/Tizen.Applications.Preference.Tests/testcase/TSPreference.cs new file mode 100755 index 000000000..bfa2cdcc1 --- /dev/null +++ b/tct-suite-vs/Tizen.Applications.Preference.Tests/testcase/TSPreference.cs @@ -0,0 +1,605 @@ +using System; +using NUnit.Framework; +using NUnit.Framework.TUnit; +using System.Collections.Generic; +using System.Threading.Tasks; + +namespace Tizen.Applications.Tests +{ + [TestFixture] + [Description("Tizen.Applications.Preference test case")] + public class PreferenceTest + { + [SetUp] + public void Init() + { + LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Preconditions for each TEST"); + } + + [TearDown] + public void Destroy() + { + LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Postconditions for each TEST"); + } + + [Test] + [Category("P1")] + [Description("Test Preference int type set test")] + [Property("SPEC", "Tizen.Applications.Preference.Set M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MCST")] + [Property("AUTHOR", "Sukhyung Kang, shine.kang@samsung.com")] + public void Set_INT_TYPE() + { + Log.Debug("PREF", "@@## Preference set int value"); + + string intKey = "setintkey"; + int intVal = 33; + int val; + + try + { + Preference.Set(intKey, intVal); + val = Preference.Get(intKey); + Assert.AreEqual(intVal, val, "int value is not set properly"); + Preference.Remove(intKey); + } + catch (Exception e) + { + Assert.Fail(e.ToString()); + } + } + + [Test] + [Category("P1")] + [Description("Test Preference int type get test")] + [Property("SPEC", "Tizen.Applications.Preference.Get M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Sukhyung Kang, shine.kang@samsung.com")] + public void Get_INT_TYPE() + { + Log.Debug("PREF", "@@## Preference get int value "); + + string intKey = "getintkey"; + int intVal = 34; + int val; + + try + { + Preference.Set(intKey, intVal); + val = Preference.Get(intKey); + Assert.AreEqual(intVal, val, "int value is not set properly"); + Preference.Remove(intKey); + } + catch (Exception e) + { + Assert.Fail(e.ToString()); + } + } + + [Test] + [Category("P1")] + [Description("Test Preference int type remove test")] + [Property("SPEC", "Tizen.Applications.Preference.Remove M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MCST")] + [Property("AUTHOR", "Sukhyung Kang, shine.kang@samsung.com")] + public void Remove_INT_TYPE() + { + Log.Debug("PREF", "@@## Preference remove int value"); + + string intKey = "rmintkey"; + int intVal = 35; + int val; + + try + { + Preference.Set(intKey, intVal); + val = Preference.Get(intKey); + Preference.Remove(intKey); + } + catch (Exception e) + { + Assert.Fail(e.ToString()); + } + + Assert.Throws(() => Preference.Get(intKey)); + } + + [Test] + [Category("P1")] + [Description("Test Preference double type set test")] + [Property("SPEC", "Tizen.Applications.Preference.Set M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MCST")] + [Property("AUTHOR", "Sukhyung Kang, shine.kang@samsung.com")] + public void Set_DOUBLE_TYPE() + { + Log.Debug("PREF", "@@## Preference set double value"); + + string doubleKey = "setdoublekey"; + double doubleVal = 33.3; + double val; + + try + { + Preference.Set(doubleKey, doubleVal); + val = Preference.Get(doubleKey); + Assert.AreEqual(doubleVal, val, "double value is not set properly"); + Preference.Remove(doubleKey); + } + catch (Exception e) + { + Assert.Fail(e.ToString()); + } + } + + [Test] + [Category("P1")] + [Description("Test Preference double type get test")] + [Property("SPEC", "Tizen.Applications.Preference.Get M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Sukhyung Kang, shine.kang@samsung.com")] + public void Get_DOUBLE_TYPE() + { + Log.Debug("PREF", "@@## Preference get double value"); + + string doubleKey = "getdoublekey"; + double doubleVal = 34.4; + double val; + + try + { + Preference.Set(doubleKey, doubleVal); + val = Preference.Get(doubleKey); + Assert.AreEqual(doubleVal, val, "double value is not set properly"); + Preference.Remove(doubleKey); + } + catch (Exception e) + { + Assert.Fail(e.ToString()); + } + } + + [Test] + [Category("P1")] + [Description("Test Preference double type remove test")] + [Property("SPEC", "Tizen.Applications.Preference.Remove M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MCST")] + [Property("AUTHOR", "Sukhyung Kang, shine.kang@samsung.com")] + public void Remove_DOUBLE_TYPE() + { + Log.Debug("PREF", "@@## Preference get double value"); + + string doubleKey = "rmdoublekey"; + double doubleVal = 35.5; + double val; + + try + { + Preference.Set(doubleKey, doubleVal); + val = Preference.Get(doubleKey); + Preference.Remove(doubleKey); + } + catch (Exception e) + { + Assert.Fail(e.ToString()); + } + + Assert.Throws(() => Preference.Get(doubleKey)); + } + + [Test] + [Category("P1")] + [Description("Test Preference string type set test")] + [Property("SPEC", "Tizen.Applications.Preference.Set M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MCST")] + [Property("AUTHOR", "Sukhyung Kang, shine.kang@samsung.com")] + public void Set_STRING_TYPE() + { + Log.Debug("PREF", "@@## Preference set string value"); + + string stringKey = "setstringkey"; + string stringVal = "setPref"; + string val; + + try + { + Preference.Set(stringKey, stringVal); + val = Preference.Get(stringKey); + Assert.AreEqual(stringVal, val, "string value is not set properly"); + Preference.Remove(stringKey); + } + catch (Exception e) + { + Assert.Fail(e.ToString()); + } + } + + [Test] + [Category("P1")] + [Description("Test Preference string type get test")] + [Property("SPEC", "Tizen.Applications.Preference.Get M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Sukhyung Kang, shine.kang@samsung.com")] + public void Get_STRING_TYPE() + { + Log.Debug("PREF", "@@## Preference get string value"); + + string stringKey = "getstringkey"; + string stringVal = "getPref"; + string val; + + try + { + Preference.Set(stringKey, stringVal); + val = Preference.Get(stringKey); + Assert.AreEqual(stringVal, val, "string value is not set properly"); + Preference.Remove(stringKey); + } + catch (Exception e) + { + Assert.Fail(e.ToString()); + } + } + + [Test] + [Category("P1")] + [Description("Test Preference string type remove test")] + [Property("SPEC", "Tizen.Applications.Preference.Remove M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MCST")] + [Property("AUTHOR", "Sukhyung Kang, shine.kang@samsung.com")] + public void Remove_STRING_TYPE() + { + Log.Debug("PREF", "@@## Preference remove string value"); + + string stringKey = "rmstringkey"; + string stringVal = "rmPref"; + string val; + + try + { + Preference.Set(stringKey, stringVal); + val = Preference.Get(stringKey); + Preference.Remove(stringKey); + } + catch (Exception e) + { + Assert.Fail(e.ToString()); + } + + Assert.Throws(() => Preference.Get(stringKey)); + } + + [Test] + [Category("P1")] + [Description("Test Preference bool type set test")] + [Property("SPEC", "Tizen.Applications.Preference.Set M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MCST")] + [Property("AUTHOR", "Sukhyung Kang, shine.kang@samsung.com")] + public void Set_BOOL_TYPE() + { + Log.Debug("PREF", "@@## Preference set bool value"); + + string boolKey = "setboolKey"; + bool boolVal = true; + bool val; + + try + { + Preference.Set(boolKey, boolVal); + val = Preference.Get(boolKey); + Assert.AreEqual(boolVal, val, "bool value is not set properly"); + Preference.Remove(boolKey); + } + catch (Exception e) + { + Assert.Fail(e.ToString()); + } + } + + [Test] + [Category("P1")] + [Description("Test Preference bool type get test")] + [Property("SPEC", "Tizen.Applications.Preference.Get M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Sukhyung Kang, shine.kang@samsung.com")] + public void Get_BOOL_TYPE() + { + Log.Debug("PREF", "@@## Preference get bool value"); + + string boolKey = "getboolKey"; + bool boolVal = true; + bool val; + + try + { + Preference.Set(boolKey, boolVal); + val = Preference.Get(boolKey); + Assert.AreEqual(boolVal, val, "bool value is not set properly"); + Preference.Remove(boolKey); + } + catch (Exception e) + { + Assert.Fail(e.ToString()); + } + } + + [Test] + [Category("P1")] + [Description("Test Preference bool type remove test")] + [Property("SPEC", "Tizen.Applications.Preference.Remove M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MCST")] + [Property("AUTHOR", "Sukhyung Kang, shine.kang@samsung.com")] + public void Remove_BOOL_TYPE() + { + Log.Debug("PREF", "@@## Preference remove bool value"); + + string boolKey = "rmboolKey"; + bool boolVal = true; + bool val; + + try + { + Preference.Set(boolKey, boolVal); + val = Preference.Get(boolKey); + Preference.Remove(boolKey); + } + catch (Exception e) + { + Assert.Fail(e.ToString()); + } + + Assert.Throws(() => Preference.Get(boolKey)); + } + + [Test] + [Category("P2")] + [Description("Test Preference set exception case because of wrong parameters")] + [Property("SPEC", "Tizen.Applications.Preference.Set M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MEX")] + [Property("AUTHOR", "Sukhyung Kang, shine.kang@samsung.com")] + public void Set_EXCEPTION_CASE() + { + Log.Debug("PREF", "@@## Preference set exception"); + + Assert.Throws(() => Preference.Set(null, 1)); + Assert.Throws(() => Preference.Set(null, 1.1)); + Assert.Throws(() => Preference.Set(null, true)); + Assert.Throws(() => Preference.Set("validkey", null)); + } + + [Test] + [Category("P2")] + [Description("Test Preference get exception case")] + [Property("SPEC", "Tizen.Applications.Preference.Get M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MEX")] + [Property("AUTHOR", "Sukhyung Kang, shine.kang@samsung.com")] + public void Get_EXCEPTION_CASE() + { + Log.Debug("PREF", "@@## Preference get exception"); + + Assert.Throws(() => Preference.Get(null)); + Assert.Throws(() => Preference.Get(null)); + Assert.Throws(() => Preference.Get("invalidkey")); + Assert.Throws(() => Preference.Get("invalidkey2")); + } + + [Test] + [Category("P2")] + [Description("Test Preference remove exception case")] + [Property("SPEC", "Tizen.Applications.Preference.Remove M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MEX")] + [Property("AUTHOR", "Sukhyung Kang, shine.kang@samsung.com")] + public void Remove_EXCEPTION_CASE() + { + Log.Debug("PREF", "@@## Preference remove exception"); + + Assert.Throws(() => Preference.Remove(null)); + Assert.Throws(() => Preference.Remove("invalidkey")); + } + + [Test] + [Category("P1")] + [Description("Test Preference contains test to check whether the key is exist or not")] + [Property("SPEC", "Tizen.Applications.Preference.Contains M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Sukhyung Kang, shine.kang@samsung.com")] + public void Contains_RETURN_TYPE_BOOL() + { + Log.Debug("PREF", "@@## Preference contains test"); + + string intKey = "Fin"; + string stringKey = "Jake"; + int intVal = 77; + string stringVal = "advan"; + bool result; + + try + { + Preference.Set(intKey, intVal); + Preference.Set(stringKey, stringVal); + + result = Preference.Contains(intKey); + Assert.AreEqual(result, true, "int value is not set properly"); + + result = Preference.Contains(stringKey); + Assert.AreEqual(result, true, "string value is not set properly"); + + Preference.Remove(intKey); + Preference.Remove(stringKey); + + result = Preference.Contains(intKey); + Assert.AreEqual(result, false, "int value is not removed properly"); + + result = Preference.Contains(stringKey); + Assert.AreEqual(result, false, "string value is not removed properly"); + } + catch (Exception e) + { + Assert.Fail(e.ToString()); + } + } + + [Test] + [Category("P2")] + [Description("Test Preference contains test exception case")] + [Property("SPEC", "Tizen.Applications.Preference.Contains M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MEX")] + [Property("AUTHOR", "Sukhyung Kang, shine.kang@samsung.com")] + public void Contains_EXCEPTION() + { + Log.Debug("PREF", "@@## Preference contains exception test"); + + Assert.Throws(() => Preference.Contains(null)); + } + + [Test] + [Category("P1")] + [Description("Test Preference removeall test to check whether all keys are removed properly")] + [Property("SPEC", "Tizen.Applications.Preference.RemoveAll M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MCST")] + [Property("AUTHOR", "Sukhyung Kang, shine.kang@samsung.com")] + public void RemoveAll_CHECK_WITHOUT_EXCEPTION() + { + Log.Debug("PREF", "@@## Preference removeall"); + + string intKey = "Gunter"; + int intVal = 77; + string stringKey = "Ice"; + string stringVal = "King"; + string doubleKey = "Fiona"; + double doubleVal = 33.3; + string boolKey = "Marcy"; + bool boolVal = true; + + bool result; + + try + { + Preference.Set(intKey, intVal); + Preference.Set(stringKey, stringVal); + Preference.Set(doubleKey, doubleVal); + Preference.Set(boolKey, boolVal); + Preference.RemoveAll(); + + result = Preference.Contains(intKey); + Assert.AreEqual(result, false, "int value is not removed properly"); + + result = Preference.Contains(stringKey); + Assert.AreEqual(result, false, "string value is not removed properly"); + + result = Preference.Contains(doubleKey); + Assert.AreEqual(result, false, "double value is not removed properly"); + + result = Preference.Contains(boolKey); + Assert.AreEqual(result, false, "bool value is not removed properly"); + } + catch (Exception e) + { + Assert.Fail(e.ToString()); + } + } + + [Test] + [Category("P1")] + [Description("Test Preference keys test to check get keys list")] + [Property("SPEC", "Tizen.Applications.Preference.Keys A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PRO")] + [Property("AUTHOR", "Sukhyung Kang, shine.kang@samsung.com")] + public void Keys_RETURN_TYPE_LIST() + { + Log.Debug("PREF", "@@## Preference keys"); + + string intKey = "Gunter"; + int intVal = 77; + string stringKey = "Ice"; + string stringVal = "King"; + string doubleKey = "Fiona"; + double doubleVal = 33.3; + string boolKey = "Marcy"; + bool boolVal = true; + + bool result; + + try + { + Preference.Set(intKey, intVal); + Preference.Set(stringKey, stringVal); + Preference.Set(doubleKey, doubleVal); + Preference.Set(boolKey, boolVal); + + foreach (string prefKey in Preference.Keys) + { + result = Preference.Contains(prefKey); + Assert.AreEqual(result, true, "key is not in Preference.Keys : " + prefKey); + } + + Preference.RemoveAll(); + } + catch (Exception e) + { + Assert.Fail(e.ToString()); + } + } + + [Test] + [Category("P2")] + [Description("Test Preference GetEventContext test exception case")] + [Property("SPEC", "Tizen.Applications.Preference.GetEventContext M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MEX")] + [Property("AUTHOR", "Sukhyung Kang, shine.kang@samsung.com")] + public void GetEventContext_EXCEPTION() + { + Log.Debug("PREF", "@@## Preference GetEventContext exception case"); + + Preference.EventContext context; + Assert.Throws(() => Preference.GetEventContext("invalidkey")); + } + + [Test] + [Category("P1")] + [Description("Test Preference GetEventContext test")] + [Property("SPEC", "Tizen.Applications.Preference.GetEventContext M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Sukhyung Kang, shine.kang@samsung.com")] + public void GetEventContext_CHECK_WITHOUT_EXCEPTION() + { + Log.Debug("PREF", "@@## Preference GetEventContext"); + + string intKey = "Fiona"; + Preference.EventContext context; + + try + { + Preference.Set(intKey, 33); + Preference.GetEventContext(intKey).TryGetTarget(out context); + Assert.IsNotNull(context, "Failed to get EventContext"); + + Preference.Remove(intKey); + } + catch (Exception e) + { + Assert.Fail(e.ToString()); + } + } + } +} diff --git a/tct-suite-vs/Tizen.Applications.Preference.Tests/testcase/TSPreferenceChangedEventArgs.cs b/tct-suite-vs/Tizen.Applications.Preference.Tests/testcase/TSPreferenceChangedEventArgs.cs new file mode 100755 index 000000000..7172ff78e --- /dev/null +++ b/tct-suite-vs/Tizen.Applications.Preference.Tests/testcase/TSPreferenceChangedEventArgs.cs @@ -0,0 +1,112 @@ +using System; +using NUnit.Framework; +using NUnit.Framework.TUnit; +using System.Threading.Tasks; + +namespace Tizen.Applications.Tests +{ + + [TestFixture] + [Description("Tizen.Application.PreferenceChangedEventArgs Tests")] + public class PreferenceChangedEventArgsTests + { + private bool _callbackIsCalled; + private PreferenceChangedEventArgs _preferChEvent; + + [SetUp] + public void Init() + { + LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Preconditions for each TEST"); + } + + [TearDown] + public void Destroy() + { + LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Postconditions for each TEST"); + } + + [Test] + [Category("P1")] + [Description("Test PreferenceChangedEventArgs method initialization")] + [Property("SPEC", "Tizen.Applications.PreferenceChangedEventArgs.PreferenceChangedEventArgs C")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "CONSTR")] + [Property("AUTHOR", "Sukhyung Kang, shine.kang@samsung.com")] + public void PreferenceChangedEventArgs_INIT() + { + var myPreferenceChangedEventArgs = new PreferenceChangedEventArgs(); + Assert.IsInstanceOf(myPreferenceChangedEventArgs); + Assert.IsNotNull(myPreferenceChangedEventArgs, "PreferenceChangedEventArgs should be not null after init."); + } + + private void PreferenceChangedCallback(object sender, PreferenceChangedEventArgs preEv) + { + Log.Debug("PREF", "@@## PreferenceChangedCallback"); + _preferChEvent = preEv; + + _callbackIsCalled = true; + } + public async Task WaitCallback() + { + int count = 0; + while (true) + { + if (count < 3) + count = count + 1; + else + break; + + if (_callbackIsCalled == true) + break; + + await Task.Delay(1000); + } + } + + [Test] + [Category("P1")] + [Description("Test PreferenceChangedEventArgs get Key test")] + [Property("SPEC", "Tizen.Applications.PreferenceChangedEventArgs.Key A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PRO")] + [Property("AUTHOR", "Sukhyung Kang, shine.kang@samsung.com")] + public async Task Key_PROPERTY_GET() + { + Log.Debug("PREF", "@@## PreferenceChangedEventArgs Key_PROPERTY_GET"); + + string intKey = "Candy"; + _callbackIsCalled = false; + + _preferChEvent = new PreferenceChangedEventArgs(); + + try + { + Preference.Set(intKey, 33); + Preference.EventContext context; + Preference.GetEventContext(intKey).TryGetTarget(out context); + if (context != null) + { + context.Changed += PreferenceChangedCallback; + } + + Preference.Set(intKey, 77); + + await WaitCallback(); + + Assert.AreEqual(_callbackIsCalled, true, "preference callback is not called"); + Assert.AreEqual(_preferChEvent.Key, intKey, "preference key is not matched"); + + if (context != null) + { + context.Changed -= PreferenceChangedCallback; + } + + Preference.Remove(intKey); + } + catch (Exception e) + { + Assert.Fail(e.ToString()); + } + } + } +} diff --git a/tct-suite-vs/Tizen.Applications.Preference.Tests/tizen-manifest.xml b/tct-suite-vs/Tizen.Applications.Preference.Tests/tizen-manifest.xml new file mode 100755 index 000000000..85578fcb2 --- /dev/null +++ b/tct-suite-vs/Tizen.Applications.Preference.Tests/tizen-manifest.xml @@ -0,0 +1,16 @@ + + + + + Tizen.Applications.Preference.Tests.png + + + + http://tizen.org/privilege/appmanager.launch + + diff --git a/tct-suite-vs/Tizen.Applications.RPCPort.Tests/Program.cs b/tct-suite-vs/Tizen.Applications.RPCPort.Tests/Program.cs new file mode 100755 index 000000000..129489a65 --- /dev/null +++ b/tct-suite-vs/Tizen.Applications.RPCPort.Tests/Program.cs @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2018 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 System; +using NUnitLite.TUnit; +using AutoTemplate; + +namespace XamarinForTizen.Tizen +{ + + class Program : global::Xamarin.Forms.Platform.Tizen.FormsApplication + { + private static App _app; + protected override void OnCreate() + { + base.OnCreate(); + + Console.WriteLine("TCT : OnCreate()"); + _app = new App(); + LoadApplication(_app); + + TRunner t = new TRunner(); + t.LoadTestsuite(); + t.Execute(); + } + + public static App getApp() + { + return _app; + } + static void Main(string[] args) + { + Console.WriteLine("TCT : Main()"); + var app = new Program(); + global::Xamarin.Forms.Forms.Init(app); + app.Run(args); + } + } +} diff --git a/tct-suite-vs/Tizen.Applications.RPCPort.Tests/Tizen.Applications.RPCPort.Tests.csproj b/tct-suite-vs/Tizen.Applications.RPCPort.Tests/Tizen.Applications.RPCPort.Tests.csproj new file mode 100755 index 000000000..f837ac3bf --- /dev/null +++ b/tct-suite-vs/Tizen.Applications.RPCPort.Tests/Tizen.Applications.RPCPort.Tests.csproj @@ -0,0 +1,40 @@ + + + + + Exe + tizen80 + Tizen + + + + + true + + + + portable + + + None + + + + + + + + + + + Runtime + + + + + + + + + + diff --git a/tct-suite-vs/Tizen.Applications.RPCPort.Tests/Tizen.Applications.RPCPort.Tests.sln b/tct-suite-vs/Tizen.Applications.RPCPort.Tests/Tizen.Applications.RPCPort.Tests.sln new file mode 100755 index 000000000..add578026 --- /dev/null +++ b/tct-suite-vs/Tizen.Applications.RPCPort.Tests/Tizen.Applications.RPCPort.Tests.sln @@ -0,0 +1,78 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.30104.148 +MinimumVisualStudioVersion = 15.0.26124.0 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Applications.RPCPort.Tests", "Tizen.Applications.RPCPort.Tests.csproj", "{D92BEEAC-3B2A-45F8-8C53-53B92550404A}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "nunit.framework", "..\nunit.framework\nunit.framework.csproj", "{B9E7C1FD-CB38-42F7-AC43-7BD2E5B4D216}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "nunitlite", "..\nunitlite\nunitlite.csproj", "{FDB8025A-C029-461F-895E-287B4C65939B}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AutoTemplate", "..\Template\AutoTemplate\AutoTemplate.csproj", "{B11ABB0C-C3C1-4B5C-8251-A15628A775F3}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|Any CPU = Release|Any CPU + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {D92BEEAC-3B2A-45F8-8C53-53B92550404A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D92BEEAC-3B2A-45F8-8C53-53B92550404A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D92BEEAC-3B2A-45F8-8C53-53B92550404A}.Debug|x64.ActiveCfg = Debug|Any CPU + {D92BEEAC-3B2A-45F8-8C53-53B92550404A}.Debug|x64.Build.0 = Debug|Any CPU + {D92BEEAC-3B2A-45F8-8C53-53B92550404A}.Debug|x86.ActiveCfg = Debug|Any CPU + {D92BEEAC-3B2A-45F8-8C53-53B92550404A}.Debug|x86.Build.0 = Debug|Any CPU + {D92BEEAC-3B2A-45F8-8C53-53B92550404A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D92BEEAC-3B2A-45F8-8C53-53B92550404A}.Release|Any CPU.Build.0 = Release|Any CPU + {D92BEEAC-3B2A-45F8-8C53-53B92550404A}.Release|x64.ActiveCfg = Release|Any CPU + {D92BEEAC-3B2A-45F8-8C53-53B92550404A}.Release|x64.Build.0 = Release|Any CPU + {D92BEEAC-3B2A-45F8-8C53-53B92550404A}.Release|x86.ActiveCfg = Release|Any CPU + {D92BEEAC-3B2A-45F8-8C53-53B92550404A}.Release|x86.Build.0 = Release|Any CPU + {B9E7C1FD-CB38-42F7-AC43-7BD2E5B4D216}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B9E7C1FD-CB38-42F7-AC43-7BD2E5B4D216}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B9E7C1FD-CB38-42F7-AC43-7BD2E5B4D216}.Debug|x64.ActiveCfg = Debug|Any CPU + {B9E7C1FD-CB38-42F7-AC43-7BD2E5B4D216}.Debug|x64.Build.0 = Debug|Any CPU + {B9E7C1FD-CB38-42F7-AC43-7BD2E5B4D216}.Debug|x86.ActiveCfg = Debug|Any CPU + {B9E7C1FD-CB38-42F7-AC43-7BD2E5B4D216}.Debug|x86.Build.0 = Debug|Any CPU + {B9E7C1FD-CB38-42F7-AC43-7BD2E5B4D216}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B9E7C1FD-CB38-42F7-AC43-7BD2E5B4D216}.Release|Any CPU.Build.0 = Release|Any CPU + {B9E7C1FD-CB38-42F7-AC43-7BD2E5B4D216}.Release|x64.ActiveCfg = Release|Any CPU + {B9E7C1FD-CB38-42F7-AC43-7BD2E5B4D216}.Release|x64.Build.0 = Release|Any CPU + {B9E7C1FD-CB38-42F7-AC43-7BD2E5B4D216}.Release|x86.ActiveCfg = Release|Any CPU + {B9E7C1FD-CB38-42F7-AC43-7BD2E5B4D216}.Release|x86.Build.0 = Release|Any CPU + {FDB8025A-C029-461F-895E-287B4C65939B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FDB8025A-C029-461F-895E-287B4C65939B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FDB8025A-C029-461F-895E-287B4C65939B}.Debug|x64.ActiveCfg = Debug|Any CPU + {FDB8025A-C029-461F-895E-287B4C65939B}.Debug|x64.Build.0 = Debug|Any CPU + {FDB8025A-C029-461F-895E-287B4C65939B}.Debug|x86.ActiveCfg = Debug|Any CPU + {FDB8025A-C029-461F-895E-287B4C65939B}.Debug|x86.Build.0 = Debug|Any CPU + {FDB8025A-C029-461F-895E-287B4C65939B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FDB8025A-C029-461F-895E-287B4C65939B}.Release|Any CPU.Build.0 = Release|Any CPU + {FDB8025A-C029-461F-895E-287B4C65939B}.Release|x64.ActiveCfg = Release|Any CPU + {FDB8025A-C029-461F-895E-287B4C65939B}.Release|x64.Build.0 = Release|Any CPU + {FDB8025A-C029-461F-895E-287B4C65939B}.Release|x86.ActiveCfg = Release|Any CPU + {FDB8025A-C029-461F-895E-287B4C65939B}.Release|x86.Build.0 = Release|Any CPU + {B11ABB0C-C3C1-4B5C-8251-A15628A775F3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B11ABB0C-C3C1-4B5C-8251-A15628A775F3}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B11ABB0C-C3C1-4B5C-8251-A15628A775F3}.Debug|x64.ActiveCfg = Debug|Any CPU + {B11ABB0C-C3C1-4B5C-8251-A15628A775F3}.Debug|x64.Build.0 = Debug|Any CPU + {B11ABB0C-C3C1-4B5C-8251-A15628A775F3}.Debug|x86.ActiveCfg = Debug|Any CPU + {B11ABB0C-C3C1-4B5C-8251-A15628A775F3}.Debug|x86.Build.0 = Debug|Any CPU + {B11ABB0C-C3C1-4B5C-8251-A15628A775F3}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B11ABB0C-C3C1-4B5C-8251-A15628A775F3}.Release|Any CPU.Build.0 = Release|Any CPU + {B11ABB0C-C3C1-4B5C-8251-A15628A775F3}.Release|x64.ActiveCfg = Release|Any CPU + {B11ABB0C-C3C1-4B5C-8251-A15628A775F3}.Release|x64.Build.0 = Release|Any CPU + {B11ABB0C-C3C1-4B5C-8251-A15628A775F3}.Release|x86.ActiveCfg = Release|Any CPU + {B11ABB0C-C3C1-4B5C-8251-A15628A775F3}.Release|x86.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {ED382B91-9930-40B6-B3D7-362304C78680} + EndGlobalSection +EndGlobal diff --git a/tct-suite-vs/Tizen.Applications.RPCPort.Tests/shared/res/Tizen.Applications.RPCPort.Tests.png b/tct-suite-vs/Tizen.Applications.RPCPort.Tests/shared/res/Tizen.Applications.RPCPort.Tests.png new file mode 100755 index 000000000..9765b1bda Binary files /dev/null and b/tct-suite-vs/Tizen.Applications.RPCPort.Tests/shared/res/Tizen.Applications.RPCPort.Tests.png differ diff --git a/tct-suite-vs/Tizen.Applications.RPCPort.Tests/testcase/TSRPCPort.Exceptions.cs b/tct-suite-vs/Tizen.Applications.RPCPort.Tests/testcase/TSRPCPort.Exceptions.cs new file mode 100755 index 000000000..f9788b9f1 --- /dev/null +++ b/tct-suite-vs/Tizen.Applications.RPCPort.Tests/testcase/TSRPCPort.Exceptions.cs @@ -0,0 +1,121 @@ +using NUnit.Framework; +using NUnit.Framework.TUnit; +using System; +using System.Threading.Tasks; +using Tizen.Applications.RPCPort; + +namespace Tizen.Applications.Tests +{ + [TestFixture] + [Description("Tizen.Application.RPCPort.Exceptions Tests")] + public class ExceptionTests + { + [SetUp] + public void Init() + { + LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Preconditions for each TEST"); + } + + [TearDown] + public void Destroy() + { + LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Postconditions for each TEST"); + } + + [Test] + [Category("P1")] + [Description("Test InvalidIOException initialization")] + [Property("SPEC", "Tizen.Applications.RPCPort.InvalidIOException.InvalidIOException C")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "CONSTR")] + [Property("AUTHOR", "Junghoon Park, jh9216.park@samsung.com")] + public void InvalidIOException_INIT() + { + /* TEST CODE */ + var e = new InvalidIOException(); + + Assert.IsNotNull(e, "InvalidIOException shouldn't be null after init"); + Assert.IsInstanceOf(e); + } + + [Test] + [Category("P1")] + [Description("Test InvalidIDException initialization")] + [Property("SPEC", "Tizen.Applications.RPCPort.InvalidIDException.InvalidIDException C")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "CONSTR")] + [Property("AUTHOR", "Junghoon Park, jh9216.park@samsung.com")] + public void InvalidIDException_INIT() + { + /* TEST CODE */ + var e = new InvalidIDException(); + + Assert.IsNotNull(e, "InvalidIDException shouldn't be null after init"); + Assert.IsInstanceOf(e); + } + + [Test] + [Category("P1")] + [Description("Test PermissionDeniedException initialization")] + [Property("SPEC", "Tizen.Applications.RPCPort.PermissionDeniedException.PermissionDeniedException C")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "CONSTR")] + [Property("AUTHOR", "Junghoon Park, jh9216.park@samsung.com")] + public void PermissionDeniedException_INIT() + { + /* TEST CODE */ + var e = new PermissionDeniedException(); + + Assert.IsNotNull(e, "PermissionDeniedException shouldn't be null after init"); + Assert.IsInstanceOf(e); + } + + [Test] + [Category("P1")] + [Description("Test InvalidProtocolException initialization")] + [Property("SPEC", "Tizen.Applications.RPCPort.InvalidProtocolException.InvalidProtocolException C")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "CONSTR")] + [Property("AUTHOR", "Junghoon Park, jh9216.park@samsung.com")] + public void InvalidProtocolException_INIT() + { + /* TEST CODE */ + var e = new InvalidProtocolException(); + + Assert.IsNotNull(e, "InvalidProtocolException shouldn't be null after init"); + Assert.IsInstanceOf(e); + } + + [Test] + [Category("P1")] + [Description("Test NotConnectedSocketException initialization")] + [Property("SPEC", "Tizen.Applications.RPCPort.NotConnectedSocketException.NotConnectedSocketException C")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "CONSTR")] + [Property("AUTHOR", "Junghoon Park, jh9216.park@samsung.com")] + public void NotConnectedSocketException_INIT() + { + /* TEST CODE */ + var e = new NotConnectedSocketException(); + + Assert.IsNotNull(e, "NotConnectedSocketException shouldn't be null after init"); + Assert.IsInstanceOf(e); + } + + [Test] + [Category("P1")] + [Description("Test InvalidCallbackException initialization")] + [Property("SPEC", "Tizen.Applications.RPCPort.InvalidCallbackException.InvalidCallbackException C")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "CONSTR")] + [Property("AUTHOR", "Junghoon Park, jh9216.park@samsung.com")] + public void InvalidCallbackException_INIT() + { + /* TEST CODE */ + var e = new InvalidCallbackException(); + + Assert.IsNotNull(e, "InvalidCallbackException shouldn't be null after init"); + Assert.IsInstanceOf(e); + } + } +} diff --git a/tct-suite-vs/Tizen.Applications.RPCPort.Tests/testcase/TSRPCPort.Parcel.cs b/tct-suite-vs/Tizen.Applications.RPCPort.Tests/testcase/TSRPCPort.Parcel.cs new file mode 100755 index 000000000..6055eddf1 --- /dev/null +++ b/tct-suite-vs/Tizen.Applications.RPCPort.Tests/testcase/TSRPCPort.Parcel.cs @@ -0,0 +1,699 @@ +using NUnit.Framework; +using NUnit.Framework.TUnit; +using System; +using System.Threading.Tasks; +using Tizen.Applications.RPCPort; + +namespace Tizen.Applications.Tests +{ + public class Proxy : ProxyBase + { + public bool Connected { get; set; } + + public bool Received { get; set; } + + public void SendTestMessage() + { + using (var p = new Parcel()) + { + p.WriteString("test"); + p.Send(Port); + } + } + + protected override void OnConnectedEvent(string endPoint, string portName, Port port) + { + Connected = true; + } + + protected override void OnDisconnectedEvent(string endPoint, string portName) + { + } + + protected override void OnReceivedEvent(string endPoint, string portName) + { + using (var p = new Parcel(CallbackPort)) + { + Assert.IsInstanceOf(p); + Assert.IsNotNull(p, "Parcel shouldn't be null after init."); + } + Received = true; + } + + protected override void OnRejectedEvent(string endPoint, string portName) + { + } + + public void TestConnect() + { + Connect("org.tizen.example.RpcPortStub", "Test"); + } + } + + + [TestFixture] + [Description("Tizen.Application.RPCPort.Parcel Tests")] + public class ParcelTests + { + private Proxy _proxy; + + [SetUp] + public void Init() + { + LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Preconditions for each TEST"); + _proxy = new Proxy(); + _proxy.TestConnect(); + } + + [TearDown] + public void Destroy() + { + LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Postconditions for each TEST"); + _proxy.Dispose(); + _proxy = null; + } + + [Test] + [Category("P1")] + [Description("Test Parcel initialization")] + [Property("SPEC", "Tizen.Applications.RPCPort.Parcel.Parcel C")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "CONSTR")] + [Property("AUTHOR", "Junghoon Park, jh9216.park@samsung.com")] + public void Parcel_INIT() + { + /* TEST CODE */ + using (var p = new Parcel()) + { + Assert.IsInstanceOf(p); + Assert.IsNotNull(p, "Parcel shouldn't be null after init."); + } + } + + [Test] + [Category("P1")] + [Description("Test Parcel initialization with port")] + [Property("SPEC", "Tizen.Applications.RPCPort.Parcel.Parcel C")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "CONSTR")] + [Property("COVPARAM", "Port")] + [Property("AUTHOR", "Junghoon Park, jh9216.park@samsung.com")] + public async Task Parcel_INIT_WITH_PARAMETER() + { + /* PRECONDITION + * */ + await Task.Delay(4000); + Assert.True(_proxy.Connected); + _proxy.SendTestMessage(); + await Task.Delay(2000); + + /* TEST CODE */ + Assert.True(_proxy.Received); + } + + [Test] + [Category("P2")] + [Description("Test constructor with null argument")] + [Property("SPEC", "Tizen.Applications.RPCPort.Parcel.Parcel C")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "CONSTN")] + [Property("COVPARAM", "Port")] + [Property("AUTHOR", "Junghoon Park, jh9216.park@samsung.com")] + public void Parcel_NULL_ARGUMENTS() + { + /* PRECONDITION */ + + /* TEST CODE */ + try + { + var p = new Parcel(null); + } + catch (InvalidIOException) + { + Assert.Pass(); + } + + Assert.Fail(); + } + + [Test] + [Category("P1")] + [Description("Send parcel to the other application which has been connected before")] + [Property("SPEC", "Tizen.Applications.RPCPort.Parcel.Send M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Junghoon Park, jh9216.park@samsung.com")] + public async Task Send_CHECK_WITHOUT_EXCEPTION() + { + try + { + /* PRECONDITION */ + await Task.Delay(2000); + Assert.True(_proxy.Connected); + + /* TEST CODE */ + _proxy.SendTestMessage(); + } + catch (Exception e) + { + Assert.Fail(e.ToString()); + } + } + + [Test] + [Category("P2")] + [Description("Send parcel with null Port object")] + [Property("SPEC", "Tizen.Applications.RPCPort.Parcel.Send M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MEX")] + [Property("AUTHOR", "Junghoon Park, jh9216.park@samsung.com")] + public void Send_WITH_NULL_ARGUMENTS() + { + /* PRECONDITION */ + using (var p = new Parcel()) + { + /* TEST CODE */ + try + { + p.Send(null); + } + catch (InvalidIOException) + { + Assert.Pass(); + } + } + + Assert.Fail(); + } + + [Test] + [Category("P1")] + [Description("Read a byte from parcel")] + [Property("SPEC", "Tizen.Applications.RPCPort.Parcel.ReadByte M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Junghoon Park, jh9216.park@samsung.com")] + public void ReadByte_RETURN() + { + using (var p = new Parcel()) + { + /* PRECONDITION */ + Assert.IsInstanceOf(p); + Assert.IsNotNull(p, "Parcel shouldn't be null after init."); + p.WriteByte(0x33); + + /* TEST CODE */ + byte b = p.ReadByte(); + Assert.IsTrue((b == 0x33), "ReadByte failed"); + } + } + + [Test] + [Category("P1")] + [Description("Read 'short' type value from parcel")] + [Property("SPEC", "Tizen.Applications.RPCPort.Parcel.ReadShort M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Junghoon Park, jh9216.park@samsung.com")] + public void ReadShort_RETURN() + { + using (var p = new Parcel()) + { + /* PRECONDITION */ + Assert.IsInstanceOf(p); + Assert.IsNotNull(p, "Parcel shouldn't be null after init."); + p.WriteShort(100); + + /* TEST CODE */ + short b = p.ReadShort(); + Assert.IsTrue((b == 100), "ReadShort failed"); + } + } + + [Test] + [Category("P1")] + [Description("Read 'int' type value from parcel")] + [Property("SPEC", "Tizen.Applications.RPCPort.Parcel.ReadInt M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Junghoon Park, jh9216.park@samsung.com")] + public void ReadInt_RETURN() + { + using (var p = new Parcel()) + { + /* PRECONDITION */ + Assert.IsInstanceOf(p); + Assert.IsNotNull(p, "Parcel shouldn't be null after init."); + p.WriteInt(100); + + /* TEST CODE */ + int b = p.ReadInt(); + Assert.IsTrue((b == 100), "ReadInt failed"); + } + } + + [Test] + [Category("P1")] + [Description("Read 'long' type value from parcel")] + [Property("SPEC", "Tizen.Applications.RPCPort.Parcel.ReadLong M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Junghoon Park, jh9216.park@samsung.com")] + public void ReadLong_RETURN() + { + using (var p = new Parcel()) + { + /* PRECONDITION */ + Assert.IsInstanceOf(p); + Assert.IsNotNull(p, "Parcel shouldn't be null after init."); + p.WriteLong(100); + + /* TEST CODE */ + long b = p.ReadLong(); + Assert.IsTrue((b == 100), "ReadLong failed"); + } + } + + [Test] + [Category("P1")] + [Description("Read 'float' type value from parcel")] + [Property("SPEC", "Tizen.Applications.RPCPort.Parcel.ReadFloat M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Junghoon Park, jh9216.park@samsung.com")] + public void ReadFloat_RETURN() + { + using (var p = new Parcel()) + { + /* PRECONDITION */ + Assert.IsInstanceOf(p); + Assert.IsNotNull(p, "Parcel shouldn't be null after init."); + p.WriteFloat(1.0f); + + /* TEST CODE */ + float b = p.ReadFloat(); + Assert.IsTrue((b == 1.0f), "ReadFloat failed"); + } + } + + [Test] + [Category("P1")] + [Description("Read 'double' type value from parcel")] + [Property("SPEC", "Tizen.Applications.RPCPort.Parcel.ReadDouble M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Junghoon Park, jh9216.park@samsung.com")] + public void ReadDouble_RETURN() + { + using (var p = new Parcel()) + { + /* PRECONDITION */ + Assert.IsInstanceOf(p); + Assert.IsNotNull(p, "Parcel shouldn't be null after init."); + p.WriteDouble(1.0); + + /* TEST CODE */ + double b = p.ReadDouble(); + Assert.IsTrue((b == 1.0), "ReadDouble failed"); + } + } + + [Test] + [Category("P1")] + [Description("Read 'string' type value from parcel")] + [Property("SPEC", "Tizen.Applications.RPCPort.Parcel.ReadString M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Junghoon Park, jh9216.park@samsung.com")] + public void ReadString_RETURN() + { + using (var p = new Parcel()) + { + /* PRECONDITION */ + Assert.IsInstanceOf(p); + Assert.IsNotNull(p, "Parcel shouldn't be null after init."); + p.WriteString("test"); + + /* TEST CODE */ + string b = p.ReadString(); + Assert.IsTrue((b == "test"), "ReadString failed"); + } + } + + [Test] + [Category("P1")] + [Description("Read 'bool' type value from parcel")] + [Property("SPEC", "Tizen.Applications.RPCPort.Parcel.ReadBool M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Junghoon Park, jh9216.park@samsung.com")] + public void ReadBool_RETURN() + { + using (var p = new Parcel()) + { + /* PRECONDITION */ + Assert.IsInstanceOf(p); + Assert.IsNotNull(p, "Parcel shouldn't be null after init."); + p.WriteBool(true); + + /* TEST CODE */ + bool b = p.ReadBool(); + Assert.IsTrue(b, "ReadBool failed"); + } + } + + [Test] + [Category("P1")] + [Description("Read 'Bundle' type value from parcel")] + [Property("SPEC", "Tizen.Applications.RPCPort.Parcel.ReadBundle M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Junghoon Park, jh9216.park@samsung.com")] + public void ReadBundle_RETURN() + { + using (var p = new Parcel()) + { + /* PRECONDITION */ + Assert.IsInstanceOf(p); + Assert.IsNotNull(p, "Parcel shouldn't be null after init."); + using (var b = new Bundle()) + { + b.AddItem("key", "value"); + p.WriteBundle(b); + } + + /* TEST CODE */ + using (Bundle b = p.ReadBundle()) + { + Assert.IsNotNull(b, "Bundle shouldn't be null"); + string val = b.GetItem("key"); + Assert.IsTrue(val == "value", "ReadBundle failed"); + } + } + } + + [Test] + [Category("P1")] + [Description("Read array count from parcel")] + [Property("SPEC", "Tizen.Applications.RPCPort.Parcel.ReadArrayCount M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Junghoon Park, jh9216.park@samsung.com")] + public void ReadArrayCount_RETURN() + { + using (var p = new Parcel()) + { + /* PRECONDITION */ + Assert.IsInstanceOf(p); + Assert.IsNotNull(p, "Parcel shouldn't be null after init."); + p.WriteArrayCount(10); + + /* TEST CODE */ + int b = p.ReadArrayCount(); + Assert.IsTrue(b == 10, "ReadArrayCount failed"); + } + } + + [Test] + [Category("P1")] + [Description("Read bytes from parcel")] + [Property("SPEC", "Tizen.Applications.RPCPort.Parcel.Read M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Junghoon Park, jh9216.park@samsung.com")] + public void Read_RETURN() + { + using (var p = new Parcel()) + { + /* PRECONDITION */ + Assert.IsInstanceOf(p); + Assert.IsNotNull(p, "Parcel shouldn't be null after init."); + var bts = new byte[10] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }; + p.Write(bts); + + /* TEST CODE */ + var b = p.Read(10); + for (int i = 0; i < 10; i++) + { + Assert.IsTrue(b[i] == i, "Read failed"); + } + } + } + + [Test] + [Category("P1")] + [Description("Write a byte to parcel")] + [Property("SPEC", "Tizen.Applications.RPCPort.Parcel.WriteByte M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Junghoon Park, jh9216.park@samsung.com")] + public void WriteByte_RETURN() + { + using (var p = new Parcel()) + { + /* PRECONDITION */ + Assert.IsInstanceOf(p); + Assert.IsNotNull(p, "Parcel shouldn't be null after init."); + + /* TEST CODE */ + p.WriteByte(0x33); + byte b = p.ReadByte(); + Assert.IsTrue((b == 0x33), "WriteByte failed"); + } + } + + [Test] + [Category("P1")] + [Description("Write 'short' type value to parcel")] + [Property("SPEC", "Tizen.Applications.RPCPort.Parcel.WriteShort M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Junghoon Park, jh9216.park@samsung.com")] + public void WriteShort_RETURN() + { + using (var p = new Parcel()) + { + /* PRECONDITION */ + Assert.IsInstanceOf(p); + Assert.IsNotNull(p, "Parcel shouldn't be null after init."); + + /* TEST CODE */ + p.WriteShort(100); + short b = p.ReadShort(); + Assert.IsTrue((b == 100), "WriteShort failed"); + } + } + + [Test] + [Category("P1")] + [Description("Write 'int' type value to parcel")] + [Property("SPEC", "Tizen.Applications.RPCPort.Parcel.WriteInt M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Junghoon Park, jh9216.park@samsung.com")] + public void WriteInt_RETURN() + { + using (var p = new Parcel()) + { + /* PRECONDITION */ + Assert.IsInstanceOf(p); + Assert.IsNotNull(p, "Parcel shouldn't be null after init."); + + /* TEST CODE */ + p.WriteInt(100); + int b = p.ReadInt(); + Assert.IsTrue((b == 100), "WriteInt failed"); + } + } + + [Test] + [Category("P1")] + [Description("Write 'long' type value to parcel")] + [Property("SPEC", "Tizen.Applications.RPCPort.Parcel.WriteLong M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Junghoon Park, jh9216.park@samsung.com")] + public void WriteLong_RETURN() + { + using (var p = new Parcel()) + { + /* PRECONDITION */ + Assert.IsInstanceOf(p); + Assert.IsNotNull(p, "Parcel shouldn't be null after init."); + + /* TEST CODE */ + p.WriteLong(100); + long b = p.ReadLong(); + Assert.IsTrue((b == 100), "WriteLong failed"); + } + } + + [Test] + [Category("P1")] + [Description("Write 'float' type value to parcel")] + [Property("SPEC", "Tizen.Applications.RPCPort.Parcel.WriteFloat M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Junghoon Park, jh9216.park@samsung.com")] + public void WriteFloat_RETURN() + { + using (var p = new Parcel()) + { + /* PRECONDITION */ + Assert.IsInstanceOf(p); + Assert.IsNotNull(p, "Parcel shouldn't be null after init."); + + /* TEST CODE */ + p.WriteFloat(1.0f); + float b = p.ReadFloat(); + Assert.IsTrue((b == 1.0f), "WriteFloat failed"); + } + } + + [Test] + [Category("P1")] + [Description("Write 'double' type value to parcel")] + [Property("SPEC", "Tizen.Applications.RPCPort.Parcel.WriteDouble M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Junghoon Park, jh9216.park@samsung.com")] + public void WriteDouble_RETURN() + { + using (var p = new Parcel()) + { + /* PRECONDITION */ + Assert.IsInstanceOf(p); + Assert.IsNotNull(p, "Parcel shouldn't be null after init."); + + /* TEST CODE */ + p.WriteDouble(1.0); + double b = p.ReadDouble(); + Assert.IsTrue((b == 1.0), "WriteDouble failed"); + } + } + + [Test] + [Category("P1")] + [Description("Wrtie 'string' type value to parcel")] + [Property("SPEC", "Tizen.Applications.RPCPort.Parcel.WriteString M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Junghoon Park, jh9216.park@samsung.com")] + public void WriteString_RETURN() + { + using (var p = new Parcel()) + { + /* PRECONDITION */ + Assert.IsInstanceOf(p); + Assert.IsNotNull(p, "Parcel shouldn't be null after init."); + + /* TEST CODE */ + p.WriteString("test"); + string b = p.ReadString(); + Assert.IsTrue((b == "test"), "WriteString failed"); + } + } + + [Test] + [Category("P1")] + [Description("Write 'bool' type value to parcel")] + [Property("SPEC", "Tizen.Applications.RPCPort.Parcel.WriteBool M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Junghoon Park, jh9216.park@samsung.com")] + public void WriteBool_RETURN() + { + using (var p = new Parcel()) + { + /* PRECONDITION */ + Assert.IsInstanceOf(p); + Assert.IsNotNull(p, "Parcel shouldn't be null after init."); + + /* TEST CODE */ + p.WriteBool(true); + bool b = p.ReadBool(); + Assert.IsTrue(b, "WriteBool failed"); + } + } + + [Test] + [Category("P1")] + [Description("Write 'Bundle' type value to parcel")] + [Property("SPEC", "Tizen.Applications.RPCPort.Parcel.WriteBundle M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Junghoon Park, jh9216.park@samsung.com")] + public void WriteBundle_RETURN() + { + using (var p = new Parcel()) + { + /* PRECONDITION */ + Assert.IsInstanceOf(p); + Assert.IsNotNull(p, "Parcel shouldn't be null after init."); + + using (var b = new Bundle()) + { + b.AddItem("key", "value"); + + /* TEST CODE */ + p.WriteBundle(b); + } + + using (Bundle b = p.ReadBundle()) + { + Assert.IsNotNull(b, "Bundle shouldn't be null"); + string val = b.GetItem("key"); + Assert.IsTrue(val == "value", "WriteBundle failed"); + } + } + } + + [Test] + [Category("P1")] + [Description("Write array count from parcel")] + [Property("SPEC", "Tizen.Applications.RPCPort.Parcel.WriteArrayCount M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Junghoon Park, jh9216.park@samsung.com")] + public void WriteArrayCount_RETURN() + { + using (var p = new Parcel()) + { + /* PRECONDITION */ + Assert.IsInstanceOf(p); + Assert.IsNotNull(p, "Parcel shouldn't be null after init."); + + /* TEST CODE */ + p.WriteArrayCount(10); + int b = p.ReadArrayCount(); + Assert.IsTrue(b == 10, "WriteArrayCount failed"); + } + } + + [Test] + [Category("P1")] + [Description("Write bytes to parcel")] + [Property("SPEC", "Tizen.Applications.RPCPort.Parcel.Write M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Junghoon Park, jh9216.park@samsung.com")] + public void Write_RETURN() + { + using (var p = new Parcel()) + { + /* PRECONDITION */ + Assert.IsInstanceOf(p); + Assert.IsNotNull(p, "Parcel shouldn't be null after init."); + var bts = new byte[10] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }; + + /* TEST CODE */ + p.Write(bts); + var b = p.Read(10); + for (int i = 0; i < 10; i++) + { + Assert.IsTrue(b[i] == i, "Write failed"); + } + } + } + } +} diff --git a/tct-suite-vs/Tizen.Applications.RPCPort.Tests/testcase/TSRPCPort.ProxyBase.cs b/tct-suite-vs/Tizen.Applications.RPCPort.Tests/testcase/TSRPCPort.ProxyBase.cs new file mode 100755 index 000000000..4743dbf29 --- /dev/null +++ b/tct-suite-vs/Tizen.Applications.RPCPort.Tests/testcase/TSRPCPort.ProxyBase.cs @@ -0,0 +1,400 @@ +using NUnit.Framework; +using NUnit.Framework.TUnit; +using System.Threading.Tasks; +using Tizen.Applications.RPCPort; + +namespace Tizen.Applications.Tests +{ + + [TestFixture] + [Description("Tizen.Application.RPCPort.ProxyBase Tests")] + public class ProxyBaseTests + { + private Proxy _proxy; + + public class Proxy : ProxyBase + { + public bool Connected { get; set; } + public bool Disconnected { get; set; } + public bool Rejected { get; set; } + + public string Result { get; set; } + + private Port _port; + + public void SendHello() + { + using (Parcel p = new Parcel()) + { + p.WriteString("hello"); + p.Send(_port); + } + } + + protected override void OnConnectedEvent(string endPoint, string portName, Port port) + { + Connected = true; + _port = port; + } + + protected override void OnDisconnectedEvent(string endPoint, string portName) + { + Disconnected = true; + } + + protected override void OnReceivedEvent(string endPoint, string portName) + { + using (Parcel p = new Parcel(GetPort(Port.Type.Callback))) + { + Result = p.ReadString(); + } + } + + protected override void OnRejectedEvent(string endPoint, string portName) + { + Rejected = true; + } + + public void TestConnect() + { + Connect("org.tizen.example.RpcPortStub", "Test"); + } + + public void ConnectForInvalidIOException() + { + Connect("invalid.app", "Test"); + } + public void ConnectForRejectedEvent() + { + Connect("org.tizen.example.RpcPortStub2", "Test"); + } + + public void TestGetPort() + { + Port p = GetPort(Port.Type.Main); + Assert.NotNull(p); + + p = GetPort(Port.Type.Callback); + Assert.NotNull(p); + } + + public Port GetPort() + { + return Port; + } + + public Port GetCallbackPort() + { + return CallbackPort; + } + } + + [SetUp] + public void Init() + { + LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Preconditions for each TEST"); + _proxy = new Proxy(); + _proxy.TestConnect(); + } + + [TearDown] + public void Destroy() + { + LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Postconditions for each TEST"); + _proxy?.Dispose(); + _proxy = null; + } + + [Test] + [Category("P1")] + [Description("Test ProxyBase initialization")] + [Property("SPEC", "Tizen.Applications.RPCPort.ProxyBase.ProxyBase C")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "CONSTR")] + [Property("AUTHOR", "Junghoon Park, jh9216.park@samsung.com")] + public void ProxyBase_INIT() + { + var p = new Proxy(); + + Assert.IsInstanceOf(p); + Assert.IsNotNull(p, "Proxy shouldn't be null"); + } + + [Test] + [Category("P1")] + [Description("Test : Connect to stub application")] + [Property("SPEC", " Tizen.Applications.RPCPort.ProxyBase.Connect M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Junghoon Park, jh9216.park@samsung.com")] + public async Task Connect_RETURN() + { + /* PRECONDITION */ + await Task.Delay(4000); + + /* TEST CODE */ + Assert.True(_proxy.Connected); + } + + [Test] + [Category("P2")] + [Description("Test : Try to reconnect to app without disposing")] + [Property("SPEC", " Tizen.Applications.RPCPort.ProxyBase.Connect M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MEX")] + [Property("AUTHOR", "Junghoon Park, jh9216.park@samsung.com")] + public async Task Connect_CHECK_INVALID_ID_EXCEPTION() + { + /* PRECONDITION */ + await Task.Delay(4000); + Assert.True(_proxy.Connected); + + try + { + /* TEST CODE */ + _proxy.TestConnect(); + } + catch (InvalidIDException) + { + Assert.Pass(); + } + + Assert.Fail(); + } + + [Test] + [Category("P2")] + [Description("Test : Connect to invalid stub application")] + [Property("SPEC", " Tizen.Applications.RPCPort.ProxyBase.Connect M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MEX")] + [Property("AUTHOR", "Junghoon Park, jh9216.park@samsung.com")] + public void Connect_CHECK_INVALID_IO_EXCEPTION() + { + /* PRECONDITION */ + _proxy?.Dispose(); + _proxy = new Proxy(); + + try + { + /* TEST CODE */ + _proxy.ConnectForInvalidIOException(); + } + catch (InvalidIOException) + { + Assert.Pass(); + } + + Assert.Fail(); + } + + [Test] + [Category("P2")] + [Description("Test : Connect to stub application with invalid permission")] + [Property("SPEC", " Tizen.Applications.RPCPort.ProxyBase.Connect M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MEX")] + [Property("AUTHOR", "Junghoon Park, jh9216.park@samsung.com")] + public async Task Connect_CHECK_PERMISSION_DENIED_EXCEPTION() + { + /* PRECONDITION */ + _proxy?.Dispose(); + _proxy = null; + AppControlReplyResult ret = AppControlReplyResult.Failed; + + var c = new AppControl() + { + ApplicationId = "org.tizen.example.RpcPortProxy2" + }; + + AppControl.SendLaunchRequest(c, (AppControl launchRequest, AppControl replyRequest, AppControlReplyResult result) => + { + ret = result; + }); + await Task.Delay(4000); + + /* TEST CODE */ + Assert.True(ret == AppControlReplyResult.Succeeded); + + /* POSTCONDITION */ + c = new AppControl() + { + ApplicationId = "org.tizen.example.RpcPortProxy2" + }; + + c.ExtraData.Add("Test", "finish"); + AppControl.SendLaunchRequest(c); + await Task.Delay(2000); + } + + [Test] + [Category("P1")] + [Description("Test : OnConnected events")] + [Property("SPEC", " Tizen.Applications.RPCPort.ProxyBase.OnConnectedEvent E")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "EVL")] + [Property("AUTHOR", "Junghoon Park, jh9216.park@samsung.com")] + public async Task OnConnectedEvent_CHECK_CB() + { + /* PRECONDITION */ + await Task.Delay(4000); + + /* TEST CODE */ + Assert.True(_proxy.Connected); + } + + [Test] + [Category("P1")] + [Description("Test : OnDisconnected events")] + [Property("SPEC", " Tizen.Applications.RPCPort.ProxyBase.OnDisconnectedEvent E")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "EVL")] + [Property("AUTHOR", "Junghoon Park, jh9216.park@samsung.com")] + public async Task OnDisconnectedEvent_CHECK_CB() + { + /* PRECONDITION */ + await Task.Delay(4000); + Assert.True(_proxy.Connected); + var c = new AppControl() + { + ApplicationId = "org.tizen.example.RpcPortStub" + }; + c.ExtraData.Add("Test", "finish"); + AppControl.SendLaunchRequest(c); + await Task.Delay(4000); + + /* TEST CODE */ + Assert.True(_proxy.Disconnected); + } + + [Test] + [Category("P1")] + [Description("Test : OnRejected events")] + [Property("SPEC", " Tizen.Applications.RPCPort.ProxyBase.OnRejectedEvent E")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "EVL")] + [Property("AUTHOR", "Junghoon Park, jh9216.park@samsung.com")] + public async Task OnRejectedEvent_CHECK_CB() + { + /* PRECONDITION */ + _proxy?.Dispose(); + _proxy = new Proxy(); + _proxy.ConnectForRejectedEvent(); + await Task.Delay(4000); + + /* TEST CODE */ + Assert.True(_proxy.Rejected); + + /* POSTCONDITION */ + var c = new AppControl() + { + ApplicationId = "org.tizen.example.RpcPortStub2" + }; + c.ExtraData.Add("Test", "finish"); + AppControl.SendLaunchRequest(c); + await Task.Delay(2000); + } + + [Test] + [Category("P1")] + [Description("Test : OnReceived events")] + [Property("SPEC", " Tizen.Applications.RPCPort.ProxyBase.OnReceivedEvent E")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "EVL")] + [Property("AUTHOR", "Junghoon Park, jh9216.park@samsung.com")] + public async Task OnReceivedEvent_CHECK_CB() + { + /* PRECONDITION */ + await Task.Delay(4000); + Assert.True(_proxy.Connected); + _proxy.SendHello(); + await Task.Delay(4000); + + /* TEST CODE */ + Assert.NotNull(_proxy.Result); + Assert.True(_proxy.Result.Equals("hello")); + } + + [Test] + [Category("P2")] + [Description("Test : GetPort from disconnected object")] + [Property("SPEC", " Tizen.Applications.RPCPort.ProxyBase.GetPort M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MEX")] + [Property("AUTHOR", "Junghoon Park, jh9216.park@samsung.com")] + public async Task GetPort_CHECK_EXCEPTION() + { + /* PRECONDITION */ + await Task.Delay(4000); + Assert.True(_proxy.Connected); + _proxy?.Dispose(); + + /* TEST CODE */ + try + { + _proxy.TestGetPort(); + } + catch (InvalidIOException) + { + Assert.Pass(); + } + finally + { + _proxy = null; + } + + Assert.Fail(); + } + + [Test] + [Category("P1")] + [Description("Test : GetPort from proxy object")] + [Property("SPEC", " Tizen.Applications.RPCPort.ProxyBase.GetPort M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Junghoon Park, jh9216.park@samsung.com")] + public async Task GetPort_RETURN() + { + /* PRECONDITION */ + await Task.Delay(4000); + Assert.True(_proxy.Connected); + + /* TEST CODE */ + _proxy.TestGetPort(); + } + + [Test] + [Category("P1")] + [Description("Test : Port Property")] + [Property("SPEC", "Tizen.Applications.RPCPort.ProxyBase.Port A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PRO")] + [Property("AUTHOR", "Junghoon Park, jh9216.park@samsung.com")] + public async Task Port_PROPERTY_GET() + { + /* PRECONDITION */ + await Task.Delay(4000); + Assert.True(_proxy.Connected); + + /* TEST CODE */ + Assert.NotNull(_proxy.GetPort()); + } + + [Test] + [Category("P1")] + [Description("Test : CallbackPort Property")] + [Property("SPEC", "Tizen.Applications.RPCPort.ProxyBase.CallbackPort A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PRO")] + [Property("AUTHOR", "Junghoon Park, jh9216.park@samsung.com")] + public async Task CallbackPort_PROPERTY_GET() + { + /* PRECONDITION */ + await Task.Delay(4000); + Assert.True(_proxy.Connected); + + /* TEST CODE */ + Assert.NotNull(_proxy.GetCallbackPort()); + } + } +} diff --git a/tct-suite-vs/Tizen.Applications.RPCPort.Tests/testcase/TSRPCPort.StubBase.cs b/tct-suite-vs/Tizen.Applications.RPCPort.Tests/testcase/TSRPCPort.StubBase.cs new file mode 100755 index 000000000..c5a388205 --- /dev/null +++ b/tct-suite-vs/Tizen.Applications.RPCPort.Tests/testcase/TSRPCPort.StubBase.cs @@ -0,0 +1,554 @@ +using NUnit.Framework; +using NUnit.Framework.TUnit; +using System; +using System.Threading; +using System.Threading.Tasks; +using Tizen.Applications.RPCPort; + +namespace Tizen.Applications.Tests +{ + [TestFixture] + [Description("Tizen.Application.RPCPort.StubBase Tests")] + public class StubBaseTests + { + private Stub _stub; + private static bool _disposed; + + public class Stub : StubBase + { + public bool Connected { get; set; } + public bool Disconnected { get; set; } + public bool Received { get; set; } + public string Instance { get; set; } + + public Stub(string portName) : base(portName) + { + } + + protected override void OnConnectedEvent(string sender, string instance) + { + Connected = true; + Instance = instance; + } + + protected override void OnDisconnectedEvent(string sender, string instance) + { + Disconnected = true; + } + + protected override bool OnReceivedEvent(string sender, string instance, Port port) + { + Received = true; + using (var p = new Parcel(port)) + { + + } + return true; + } + + protected override void OnTerminatedEvent() + { + _disposed = true; + } + + public void TestListen() + { + Listen(); + } + + public void TestGetPort(string inst) + { + Port p = GetPort(Port.Type.Main, inst); + Assert.NotNull(p); + + p = GetPort(Port.Type.Callback, inst); + Assert.NotNull(p); + } + + public void TestAddPrivilege() + { + AddPrivilege("test.privilege"); + } + + public void TestAddPrivilegeWithNull() + { + AddPrivilege(null); + } + + public void TestSetTrusted(bool trusted) + { + SetTrusted(trusted); + } + } + + [SetUp] + public void Init() + { + LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Preconditions for each TEST"); + _stub = new Stub("Test"); + } + + [TearDown] + public void Destroy() + { + LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Postconditions for each TEST"); + _stub?.Dispose(); + _stub = null; + } + + [Test] + [Category("P1")] + [Description("Test StubBase initialization")] + [Property("SPEC", "Tizen.Applications.RPCPort.StubBase.StubBase C")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "CONSTR")] + [Property("AUTHOR", "Junghoon Park, jh9216.park@samsung.com")] + public void StubBase_INIT() + { + Assert.IsInstanceOf(_stub); + Assert.IsNotNull(_stub, "Stub shouldn't be null"); + } + + [Test] + [Category("P1")] + [Description("Test : Listen to proxy application")] + [Property("SPEC", " Tizen.Applications.RPCPort.StubBase.Listen M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Junghoon Park, jh9216.park@samsung.com")] + public async Task Listen_CHECK_RETURN() + { + /* PRECONDITION */ + _stub.TestListen(); + var ctrl = new AppControl() + { + ApplicationId = "org.tizen.example.RpcPortProxy" + }; + + AppControl.SendLaunchRequest(ctrl); + + await Task.Delay(4000); + + /* TEST CODE */ + Assert.True(_stub.Connected); + + /* POSTCONDITION */ + var c = new AppControl() + { + ApplicationId = "org.tizen.example.RpcPortProxy" + }; + c.ExtraData.Add("Test", "finish"); + AppControl.SendLaunchRequest(c); + await Task.Delay(2000); + } + + [Test] + [Category("P2")] + [Description("Test : Listen to proxy application after being disposed")] + [Property("SPEC", " Tizen.Applications.RPCPort.StubBase.Listen M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MEX")] + [Property("AUTHOR", "Junghoon Park, jh9216.park@samsung.com")] + public void Listen_CHECK_WITH_EXCEPTION() + { + /* PRECONDITION */ + _stub?.Dispose(); + + try + { + /* TEST CODE */ + _stub.TestListen(); + } + catch (InvalidIOException) + { + Assert.Pass(); + } + finally + { + _stub = null; + } + + Assert.Fail(); + } + + [Test] + [Category("P1")] + [Description("Test : OnConnected events")] + [Property("SPEC", " Tizen.Applications.RPCPort.StubBase.OnConnectedEvent E")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "EVL")] + [Property("AUTHOR", "Junghoon Park, jh9216.park@samsung.com")] + public async Task OnConnectedEvent_CHECK_CB() + { + /* PRECONDITION */ + _stub.TestListen(); + var ctrl = new AppControl() + { + ApplicationId = "org.tizen.example.RpcPortProxy" + }; + + AppControl.SendLaunchRequest(ctrl); + await Task.Delay(4000); + + /* TEST CODE */ + Assert.True(_stub.Connected); + + /* POSTCONDITION */ + var c = new AppControl() + { + ApplicationId = "org.tizen.example.RpcPortProxy" + }; + c.ExtraData.Add("Test", "finish"); + AppControl.SendLaunchRequest(c); + await Task.Delay(2000); + } + + [Test] + [Category("P1")] + [Description("Test : OnDisconnected events")] + [Property("SPEC", " Tizen.Applications.RPCPort.StubBase.OnDisconnectedEvent E")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "EVL")] + [Property("AUTHOR", "Junghoon Park, jh9216.park@samsung.com")] + public async Task OnDisconnectedEvent_CHECK_CB() + { + /* PRECONDITION */ + _stub.TestListen(); + var ctrl = new AppControl() + { + ApplicationId = "org.tizen.example.RpcPortProxy" + }; + + AppControl.SendLaunchRequest(ctrl); + await Task.Delay(4000); + Assert.True(_stub.Connected); + var c = new AppControl() + { + ApplicationId = "org.tizen.example.RpcPortProxy" + }; + c.ExtraData.Add("Test", "finish"); + AppControl.SendLaunchRequest(c); + await Task.Delay(3000); + + /* TEST CODE */ + Assert.True(_stub.Disconnected); + } + + [Test] + [Category("P1")] + [Description("Test : OnReceived events")] + [Property("SPEC", " Tizen.Applications.RPCPort.StubBase.OnReceivedEvent E")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "EVL")] + [Property("AUTHOR", "Junghoon Park, jh9216.park@samsung.com")] + public async Task OnReceivedEvent_CHECK_CB() + { + /* PRECONDITION */ + _stub.TestListen(); + var ctrl = new AppControl() + { + ApplicationId = "org.tizen.example.RpcPortProxy" + }; + ctrl.ExtraData.Add("send", "hello"); + + AppControl.SendLaunchRequest(ctrl); + await Task.Delay(4000); + Assert.True(_stub.Connected); + + /* TEST CODE */ + Assert.True(_stub.Received); + + /* POSTCONDITION */ + var c = new AppControl() + { + ApplicationId = "org.tizen.example.RpcPortProxy" + }; + c.ExtraData.Add("Test", "finish"); + AppControl.SendLaunchRequest(c); + await Task.Delay(3000); + } + + [Test] + [Category("P1")] + [Description("Test : OnTerminated events")] + [Property("SPEC", " Tizen.Applications.RPCPort.StubBase.OnTerminatedEvent E")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "EVL")] + [Property("AUTHOR", "Junghoon Park, jh9216.park@samsung.com")] + public async Task OnTerminatedEvent_CHECK_CB() + { + /* PRECONDITION */ + _stub.TestListen(); + var ctrl = new AppControl() + { + ApplicationId = "org.tizen.example.RpcPortProxy" + }; + + AppControl.SendLaunchRequest(ctrl); + await Task.Delay(4000); + Assert.True(_stub.Connected); + _disposed = false; + + /* TEST CODE */ + _stub.Dispose(); + Assert.True(_disposed); + + /* POSTCONDITION */ + var c = new AppControl() + { + ApplicationId = "org.tizen.example.RpcPortProxy" + }; + c.ExtraData.Add("Test", "finish"); + AppControl.SendLaunchRequest(c); + await Task.Delay(3000); + } + + [Test] + [Category("P1")] + [Description("Test : GetPort from stub object")] + [Property("SPEC", " Tizen.Applications.RPCPort.StubBase.GetPort M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Junghoon Park, jh9216.park@samsung.com")] + public async Task GetPort_RETURN() + { + /* PRECONDITION */ + _stub.TestListen(); + var ctrl = new AppControl() + { + ApplicationId = "org.tizen.example.RpcPortProxy" + }; + + AppControl.SendLaunchRequest(ctrl); + + await Task.Delay(4000); + Assert.True(_stub.Connected); + Assert.NotNull(_stub.Instance); + + /* TEST CODE */ + _stub.TestGetPort(_stub.Instance); + + /* POSTCONDITION */ + var c = new AppControl() + { + ApplicationId = "org.tizen.example.RpcPortProxy" + }; + c.ExtraData.Add("Test", "finish"); + AppControl.SendLaunchRequest(c); + await Task.Delay(2000); + } + + [Test] + [Category("P2")] + [Description("Test : GetPort from wrong instance")] + [Property("SPEC", " Tizen.Applications.RPCPort.StubBase.GetPort M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MEX")] + [Property("AUTHOR", "Junghoon Park, jh9216.park@samsung.com")] + public async Task GetPort_CHECK_INVALID_IO_EXCEPTION() + { + /* PRECONDITION */ + _stub.TestListen(); + var ctrl = new AppControl() + { + ApplicationId = "org.tizen.example.RpcPortProxy" + }; + + AppControl.SendLaunchRequest(ctrl); + await Task.Delay(4000); + + Assert.True(_stub.Connected); + Assert.NotNull(_stub.Instance); + + try + { + /* TEST CODE */ + _stub.TestGetPort("wrong_inst"); + + } + catch (InvalidIOException) + { + Assert.Pass(); + } + finally + { + /* POSTCONDITION */ + var c = new AppControl() + { + ApplicationId = "org.tizen.example.RpcPortProxy" + }; + c.ExtraData.Add("Test", "finish"); + AppControl.SendLaunchRequest(c); + await Task.Delay(2000); + } + + Assert.Fail(); + } + + [Test] + [Category("P2")] + [Description("Test : GetPort from wrong stub object")] + [Property("SPEC", " Tizen.Applications.RPCPort.StubBase.GetPort M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MEX")] + [Property("AUTHOR", "Junghoon Park, jh9216.park@samsung.com")] + public void GetPort_CHECK_INVALID_ID_EXCEPTION() + { + /* PRECONDITION */ + _stub.TestListen(); + _stub.Dispose(); + + try + { + /* TEST CODE */ + _stub.TestGetPort("wrong_instance"); + } + catch (InvalidIDException) + { + Assert.Pass(); + } + finally + { + _stub = null; + } + + Assert.Fail(); + } + + [Test] + [Category("P1")] + [Description("Test : Add privilege to stub object")] + [Property("SPEC", "Tizen.Applications.RPCPort.StubBase.AddPrivilege M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Junghoon Park, jh9216.park@samsung.com")] + public async Task AddPrivilege_RETURN() + { + /* PRECONDITION */ + + /* TEST CODE */ + _stub.TestAddPrivilege(); + _stub.TestListen(); + var ctrl = new AppControl() + { + ApplicationId = "org.tizen.example.RpcPortProxy" + }; + + AppControl.SendLaunchRequest(ctrl); + + await Task.Delay(4000); + Assert.False(_stub.Connected); + + /* POSTCONDITION */ + var c = new AppControl() + { + ApplicationId = "org.tizen.example.RpcPortProxy" + }; + c.ExtraData.Add("Test", "finish"); + AppControl.SendLaunchRequest(c); + await Task.Delay(2000); + } + + [Test] + [Category("P2")] + [Description("Test : Add privilege with null argument")] + [Property("SPEC", "Tizen.Applications.RPCPort.StubBase.AddPrivilege M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MEX")] + [Property("AUTHOR", "Junghoon Park, jh9216.park@samsung.com")] + public void AddPrivilege_CHECK_WITH_EXCEPTION() + { + /* PRECONDITION */ + + /* TEST CODE */ + try + { + _stub.TestAddPrivilegeWithNull(); + } + catch (ArgumentNullException) + { + Assert.Pass(); + } + Assert.Fail(); + } + + [Test] + [Category("P1")] + [Description("Test : Set trusted flag as true")] + [Property("SPEC", "Tizen.Applications.RPCPort.StubBase.SetTrusted M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Junghoon Park, jh9216.park@samsung.com")] + public async Task SetTrusted_RETURN1() + { + /* PRECONDITION */ + + /* TEST CODE */ + _stub.TestSetTrusted(true); + _stub.TestListen(); + var ctrl = new AppControl() + { + ApplicationId = "org.tizen.example.RpcPortProxy" + }; + + AppControl.SendLaunchRequest(ctrl); + await Task.Delay(4000); + Assert.False(_stub.Connected); + + /* POSTCONDITION */ + var c = new AppControl() + { + ApplicationId = "org.tizen.example.RpcPortProxy" + }; + c.ExtraData.Add("Test", "finish"); + AppControl.SendLaunchRequest(c); + await Task.Delay(2000); + } + + [Test] + [Category("P1")] + [Description("Test : Set trusted flag as false")] + [Property("SPEC", "Tizen.Applications.RPCPort.StubBase.SetTrusted M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Junghoon Park, jh9216.park@samsung.com")] + public async Task SetTrusted_RETURN2() + { + /* PRECONDITION */ + + /* TEST CODE */ + _stub.TestSetTrusted(false); + _stub.TestListen(); + var ctrl = new AppControl() + { + ApplicationId = "org.tizen.example.RpcPortProxy" + }; + + AppControl.SendLaunchRequest(ctrl); + await Task.Delay(4000); + Assert.True(_stub.Connected); + + /* POSTCONDITION */ + var c = new AppControl() + { + ApplicationId = "org.tizen.example.RpcPortProxy" + }; + c.ExtraData.Add("Test", "finish"); + AppControl.SendLaunchRequest(c); + await Task.Delay(2000); + } + + [Test] + [Category("P1")] + [Description("Test : PortName Property")] + [Property("SPEC", "Tizen.Applications.RPCPort.StubBase.PortName A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PRO")] + [Property("AUTHOR", "Junghoon Park, jh9216.park@samsung.com")] + public void PortName_PROPERTY_GET() + { + Assert.NotNull(_stub.PortName); + Assert.True(_stub.PortName.Equals("Test")); + } + } +} diff --git a/tct-suite-vs/Tizen.Applications.RPCPort.Tests/tizen-manifest.xml b/tct-suite-vs/Tizen.Applications.RPCPort.Tests/tizen-manifest.xml new file mode 100755 index 000000000..17b179b45 --- /dev/null +++ b/tct-suite-vs/Tizen.Applications.RPCPort.Tests/tizen-manifest.xml @@ -0,0 +1,16 @@ + + + + + Tizen.Applications.RPCPort.Tests.png + + + + + + http://tizen.org/privilege/appmanager.launch + http://tizen.org/privilege/datasharing + + + + diff --git a/tct-suite-vs/Tizen.Applications.Service.Tests/Program.cs b/tct-suite-vs/Tizen.Applications.Service.Tests/Program.cs new file mode 100755 index 000000000..129489a65 --- /dev/null +++ b/tct-suite-vs/Tizen.Applications.Service.Tests/Program.cs @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2018 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 System; +using NUnitLite.TUnit; +using AutoTemplate; + +namespace XamarinForTizen.Tizen +{ + + class Program : global::Xamarin.Forms.Platform.Tizen.FormsApplication + { + private static App _app; + protected override void OnCreate() + { + base.OnCreate(); + + Console.WriteLine("TCT : OnCreate()"); + _app = new App(); + LoadApplication(_app); + + TRunner t = new TRunner(); + t.LoadTestsuite(); + t.Execute(); + } + + public static App getApp() + { + return _app; + } + static void Main(string[] args) + { + Console.WriteLine("TCT : Main()"); + var app = new Program(); + global::Xamarin.Forms.Forms.Init(app); + app.Run(args); + } + } +} diff --git a/tct-suite-vs/Tizen.Applications.Service.Tests/Tizen.Applications.Service.Tests.csproj b/tct-suite-vs/Tizen.Applications.Service.Tests/Tizen.Applications.Service.Tests.csproj new file mode 100755 index 000000000..f837ac3bf --- /dev/null +++ b/tct-suite-vs/Tizen.Applications.Service.Tests/Tizen.Applications.Service.Tests.csproj @@ -0,0 +1,40 @@ + + + + + Exe + tizen80 + Tizen + + + + + true + + + + portable + + + None + + + + + + + + + + + Runtime + + + + + + + + + + diff --git a/tct-suite-vs/Tizen.Applications.Service.Tests/Tizen.Applications.Service.Tests.sln b/tct-suite-vs/Tizen.Applications.Service.Tests/Tizen.Applications.Service.Tests.sln new file mode 100755 index 000000000..3a8d5c0f2 --- /dev/null +++ b/tct-suite-vs/Tizen.Applications.Service.Tests/Tizen.Applications.Service.Tests.sln @@ -0,0 +1,78 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.30104.148 +MinimumVisualStudioVersion = 15.0.26124.0 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Applications.Service.Tests", "Tizen.Applications.Service.Tests.csproj", "{D92BEEAC-3B2A-45F8-8C53-53B92550404A}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "nunit.framework", "..\nunit.framework\nunit.framework.csproj", "{B9E7C1FD-CB38-42F7-AC43-7BD2E5B4D216}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "nunitlite", "..\nunitlite\nunitlite.csproj", "{FDB8025A-C029-461F-895E-287B4C65939B}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AutoTemplate", "..\Template\AutoTemplate\AutoTemplate.csproj", "{B11ABB0C-C3C1-4B5C-8251-A15628A775F3}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|Any CPU = Release|Any CPU + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {D92BEEAC-3B2A-45F8-8C53-53B92550404A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D92BEEAC-3B2A-45F8-8C53-53B92550404A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D92BEEAC-3B2A-45F8-8C53-53B92550404A}.Debug|x64.ActiveCfg = Debug|Any CPU + {D92BEEAC-3B2A-45F8-8C53-53B92550404A}.Debug|x64.Build.0 = Debug|Any CPU + {D92BEEAC-3B2A-45F8-8C53-53B92550404A}.Debug|x86.ActiveCfg = Debug|Any CPU + {D92BEEAC-3B2A-45F8-8C53-53B92550404A}.Debug|x86.Build.0 = Debug|Any CPU + {D92BEEAC-3B2A-45F8-8C53-53B92550404A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D92BEEAC-3B2A-45F8-8C53-53B92550404A}.Release|Any CPU.Build.0 = Release|Any CPU + {D92BEEAC-3B2A-45F8-8C53-53B92550404A}.Release|x64.ActiveCfg = Release|Any CPU + {D92BEEAC-3B2A-45F8-8C53-53B92550404A}.Release|x64.Build.0 = Release|Any CPU + {D92BEEAC-3B2A-45F8-8C53-53B92550404A}.Release|x86.ActiveCfg = Release|Any CPU + {D92BEEAC-3B2A-45F8-8C53-53B92550404A}.Release|x86.Build.0 = Release|Any CPU + {B9E7C1FD-CB38-42F7-AC43-7BD2E5B4D216}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B9E7C1FD-CB38-42F7-AC43-7BD2E5B4D216}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B9E7C1FD-CB38-42F7-AC43-7BD2E5B4D216}.Debug|x64.ActiveCfg = Debug|Any CPU + {B9E7C1FD-CB38-42F7-AC43-7BD2E5B4D216}.Debug|x64.Build.0 = Debug|Any CPU + {B9E7C1FD-CB38-42F7-AC43-7BD2E5B4D216}.Debug|x86.ActiveCfg = Debug|Any CPU + {B9E7C1FD-CB38-42F7-AC43-7BD2E5B4D216}.Debug|x86.Build.0 = Debug|Any CPU + {B9E7C1FD-CB38-42F7-AC43-7BD2E5B4D216}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B9E7C1FD-CB38-42F7-AC43-7BD2E5B4D216}.Release|Any CPU.Build.0 = Release|Any CPU + {B9E7C1FD-CB38-42F7-AC43-7BD2E5B4D216}.Release|x64.ActiveCfg = Release|Any CPU + {B9E7C1FD-CB38-42F7-AC43-7BD2E5B4D216}.Release|x64.Build.0 = Release|Any CPU + {B9E7C1FD-CB38-42F7-AC43-7BD2E5B4D216}.Release|x86.ActiveCfg = Release|Any CPU + {B9E7C1FD-CB38-42F7-AC43-7BD2E5B4D216}.Release|x86.Build.0 = Release|Any CPU + {FDB8025A-C029-461F-895E-287B4C65939B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FDB8025A-C029-461F-895E-287B4C65939B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FDB8025A-C029-461F-895E-287B4C65939B}.Debug|x64.ActiveCfg = Debug|Any CPU + {FDB8025A-C029-461F-895E-287B4C65939B}.Debug|x64.Build.0 = Debug|Any CPU + {FDB8025A-C029-461F-895E-287B4C65939B}.Debug|x86.ActiveCfg = Debug|Any CPU + {FDB8025A-C029-461F-895E-287B4C65939B}.Debug|x86.Build.0 = Debug|Any CPU + {FDB8025A-C029-461F-895E-287B4C65939B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FDB8025A-C029-461F-895E-287B4C65939B}.Release|Any CPU.Build.0 = Release|Any CPU + {FDB8025A-C029-461F-895E-287B4C65939B}.Release|x64.ActiveCfg = Release|Any CPU + {FDB8025A-C029-461F-895E-287B4C65939B}.Release|x64.Build.0 = Release|Any CPU + {FDB8025A-C029-461F-895E-287B4C65939B}.Release|x86.ActiveCfg = Release|Any CPU + {FDB8025A-C029-461F-895E-287B4C65939B}.Release|x86.Build.0 = Release|Any CPU + {B11ABB0C-C3C1-4B5C-8251-A15628A775F3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B11ABB0C-C3C1-4B5C-8251-A15628A775F3}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B11ABB0C-C3C1-4B5C-8251-A15628A775F3}.Debug|x64.ActiveCfg = Debug|Any CPU + {B11ABB0C-C3C1-4B5C-8251-A15628A775F3}.Debug|x64.Build.0 = Debug|Any CPU + {B11ABB0C-C3C1-4B5C-8251-A15628A775F3}.Debug|x86.ActiveCfg = Debug|Any CPU + {B11ABB0C-C3C1-4B5C-8251-A15628A775F3}.Debug|x86.Build.0 = Debug|Any CPU + {B11ABB0C-C3C1-4B5C-8251-A15628A775F3}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B11ABB0C-C3C1-4B5C-8251-A15628A775F3}.Release|Any CPU.Build.0 = Release|Any CPU + {B11ABB0C-C3C1-4B5C-8251-A15628A775F3}.Release|x64.ActiveCfg = Release|Any CPU + {B11ABB0C-C3C1-4B5C-8251-A15628A775F3}.Release|x64.Build.0 = Release|Any CPU + {B11ABB0C-C3C1-4B5C-8251-A15628A775F3}.Release|x86.ActiveCfg = Release|Any CPU + {B11ABB0C-C3C1-4B5C-8251-A15628A775F3}.Release|x86.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {ED382B91-9930-40B6-B3D7-362304C78680} + EndGlobalSection +EndGlobal diff --git a/tct-suite-vs/Tizen.Applications.Service.Tests/shared/res/Tizen.Applications.Service.Tests.png b/tct-suite-vs/Tizen.Applications.Service.Tests/shared/res/Tizen.Applications.Service.Tests.png new file mode 100755 index 000000000..9765b1bda Binary files /dev/null and b/tct-suite-vs/Tizen.Applications.Service.Tests/shared/res/Tizen.Applications.Service.Tests.png differ diff --git a/tct-suite-vs/Tizen.Applications.Service.Tests/testcase/TSServiceApplication.cs b/tct-suite-vs/Tizen.Applications.Service.Tests/testcase/TSServiceApplication.cs new file mode 100755 index 000000000..375c07fce --- /dev/null +++ b/tct-suite-vs/Tizen.Applications.Service.Tests/testcase/TSServiceApplication.cs @@ -0,0 +1,37 @@ +using NUnit.Framework; +using NUnit.Framework.TUnit; + +namespace Tizen.Applications.Tests +{ + + [TestFixture] + [Description("ServiceApplication init test")] + public class ServiceApplicationTests + { + [SetUp] + public void Init() + { + LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Preconditions for each TEST"); + } + + [TearDown] + public void Destroy() + { + LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Postconditions for each TEST"); + } + + [Test] + [Category("P1")] + [Description("ServiceApplication() constructor.")] + [Property("SPEC", "Tizen.Applications.ServiceApplication.ServiceApplication C")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "CONSTR")] + [Property("AUTHOR", "Nguyen Duc Han, duchan.ng.d@samsung.com")] + public void ServiceApplication_INIT() + { + /* TEST CODE */ + Application App = new ServiceApplication(); + Assert.IsNotNull(App, "Application should be not null after init"); + } + } +} diff --git a/tct-suite-vs/Tizen.Applications.Service.Tests/tizen-manifest.xml b/tct-suite-vs/Tizen.Applications.Service.Tests/tizen-manifest.xml new file mode 100755 index 000000000..469608456 --- /dev/null +++ b/tct-suite-vs/Tizen.Applications.Service.Tests/tizen-manifest.xml @@ -0,0 +1,16 @@ + + + + + Tizen.Applications.Service.Tests.png + + + + http://tizen.org/privilege/appmanager.launch + + diff --git a/tct-suite-vs/Tizen.Applications.Tests/Tizen.Applications.Tests.sln b/tct-suite-vs/Tizen.Applications.Tests/Tizen.Applications.Tests.sln index d9a01af8e..3b986c642 100755 --- a/tct-suite-vs/Tizen.Applications.Tests/Tizen.Applications.Tests.sln +++ b/tct-suite-vs/Tizen.Applications.Tests/Tizen.Applications.Tests.sln @@ -1,6 +1,6 @@ Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26730.15 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.30104.148 MinimumVisualStudioVersion = 15.0.26124.0 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Applications.Tests", "Tizen.Applications.Tests.csproj", "{D92BEEAC-3B2A-45F8-8C53-53B92550404A}" EndProject @@ -58,10 +58,16 @@ Global {FDB8025A-C029-461F-895E-287B4C65939B}.Release|x86.Build.0 = Release|Any CPU {B11ABB0C-C3C1-4B5C-8251-A15628A775F3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {B11ABB0C-C3C1-4B5C-8251-A15628A775F3}.Debug|Any CPU.Build.0 = Debug|Any CPU - {B11ABB0C-C3C1-4B5C-8251-A15628A775F3}.NUI|Any CPU.ActiveCfg = Debug|Any CPU - {B11ABB0C-C3C1-4B5C-8251-A15628A775F3}.NUI|Any CPU.Build.0 = Debug|Any CPU + {B11ABB0C-C3C1-4B5C-8251-A15628A775F3}.Debug|x64.ActiveCfg = Debug|Any CPU + {B11ABB0C-C3C1-4B5C-8251-A15628A775F3}.Debug|x64.Build.0 = Debug|Any CPU + {B11ABB0C-C3C1-4B5C-8251-A15628A775F3}.Debug|x86.ActiveCfg = Debug|Any CPU + {B11ABB0C-C3C1-4B5C-8251-A15628A775F3}.Debug|x86.Build.0 = Debug|Any CPU {B11ABB0C-C3C1-4B5C-8251-A15628A775F3}.Release|Any CPU.ActiveCfg = Release|Any CPU {B11ABB0C-C3C1-4B5C-8251-A15628A775F3}.Release|Any CPU.Build.0 = Release|Any CPU + {B11ABB0C-C3C1-4B5C-8251-A15628A775F3}.Release|x64.ActiveCfg = Release|Any CPU + {B11ABB0C-C3C1-4B5C-8251-A15628A775F3}.Release|x64.Build.0 = Release|Any CPU + {B11ABB0C-C3C1-4B5C-8251-A15628A775F3}.Release|x86.ActiveCfg = Release|Any CPU + {B11ABB0C-C3C1-4B5C-8251-A15628A775F3}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/tct-suite-vs/Tizen.Applications.Tests/testcase/TSAppControl.cs b/tct-suite-vs/Tizen.Applications.Tests/testcase/TSAppControl.cs index 858a57ce5..cd705eee0 100755 --- a/tct-suite-vs/Tizen.Applications.Tests/testcase/TSAppControl.cs +++ b/tct-suite-vs/Tizen.Applications.Tests/testcase/TSAppControl.cs @@ -385,45 +385,6 @@ namespace Tizen.Applications.Tests //Assert.IsTrue (rFlag, " rFlag should be true after SendLaunchReques"); //this code will be used when API "AppControlReplyCallback" working } - [Test] - [Category("P1")] - [Description("Test : Send Terminate Request - UI app should be terminated")] - [Property("SPEC", "Tizen.Applications.AppControl.SendTerminateRequest M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Hwankyu Jhun, h.jhun@samsung.com")] - public async Task SendTerminateRequest_TO_A_UI_APP() - { - /* PRECONDITION - * Install org.tizen.example.UIApp.Tizen.tpk - * Privilege: http://tizen.org/privilege/appmanager.launch - * */ - - /* TEST CODE */ - AppControl MyAppControl = new Tizen.Applications.AppControl(true); - Assert.IsNotNull(MyAppControl, "Object should not be null after initializing"); - - MyAppControl.Operation = AppControlOperations.Default; - MyAppControl.ApplicationId = MyUIAppId; - MyAppControl.LaunchMode = AppControlLaunchMode.Group; - - Tizen.Applications.AppControl.SendLaunchRequest(MyAppControl, AppControlReplyReceivedCallback); - await waitFlag(); - Assert.IsTrue(_flag, MyUIAppId + "should be running after launching request has sent"); - - bool IsRunning = false; - Tizen.Applications.AppControl.SendTerminateRequest(MyAppControl); - _runningApps = ApplicationManager.GetRunningApplicationsAsync(); - - _list = await _runningApps; - foreach (var app in _list) - { - if (app.ApplicationId == MyUIAppId) - IsRunning = true; - } - Assert.IsTrue(!IsRunning, MyUIAppId + "should not be running after terminating request has sent"); - } - [Test] [Category("P2")] [Description("SendTerminateRequest - Send terminate request with null argument")] diff --git a/tct-suite-vs/Tizen.Applications.Tests/testcase/TSCoreUIApplication.cs b/tct-suite-vs/Tizen.Applications.Tests/testcase/TSCoreUIApplication.cs deleted file mode 100755 index 5afb321c7..000000000 --- a/tct-suite-vs/Tizen.Applications.Tests/testcase/TSCoreUIApplication.cs +++ /dev/null @@ -1,55 +0,0 @@ -using NUnit.Framework; -using NUnit.Framework.TUnit; - -namespace Tizen.Applications.Tests -{ - [TestFixture] - [Description("TSCoreUIApplication init test")] - public class CoreUIApplicationTests - { - [SetUp] - public void Init() - { - LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Preconditions for each TEST"); - } - - [TearDown] - public void Destroy() - { - LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Postconditions for each TEST"); - } - - [Test] - [Category("P1")] - [Description("UIApplication() constructor.")] - [Property("SPEC", "Tizen.Applications.CoreUIApplication.CoreUIApplication C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("AUTHOR", "Nguyen Duc Han, duchan.ng.d@samsung.com")] - public void CoreUIApplication_INIT() - { - /* TEST CODE */ - Application app = new CoreUIApplication(); - Assert.IsNotNull(app, "Application should be not null after init"); - } - - [Test] - [Category("P1")] - [Description("Test : Check whether CurrentDeviceOrientation returns expected value or not")] - [Property("SPEC", "Tizen.Applications.CoreUIApplication.CurrentDeviceOrientation A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRO")] - [Property("AUTHOR", "Hwankyu Jhun, h.jhun@samsung.com")] - public void CurrentDeviceOrientation_PROPERTY_GET() - { - CoreUIApplication app = new CoreUIApplication(); - var deviceOrientation = app.CurrentDeviceOrientation; - Assert.IsInstanceOf(deviceOrientation); - Assert.IsTrue((deviceOrientation == DeviceOrientation.Orientation_0) || - (deviceOrientation == DeviceOrientation.Orientation_90) || - (deviceOrientation == DeviceOrientation.Orientation_180) || - (deviceOrientation == DeviceOrientation.Orientation_270), - "Property \"CurrentDeviceOrientation\": should be Orientation_0 or Orientation_90 or Orientation_180 or Orientation_270"); - } - } -} diff --git a/tct-suite-vs/Tizen.Applications.Tests/testcase/TSMessagePort.cs b/tct-suite-vs/Tizen.Applications.Tests/testcase/TSMessagePort.cs deleted file mode 100755 index 109338929..000000000 --- a/tct-suite-vs/Tizen.Applications.Tests/testcase/TSMessagePort.cs +++ /dev/null @@ -1,438 +0,0 @@ -using NUnit.Framework; -using NUnit.Framework.TUnit; -using System; -using System.Collections.Generic; -using System.Threading.Tasks; -using Tizen.Applications.Messages; -using XamarinForTizen.Tizen; - -namespace Tizen.Applications.Tests -{ - - [TestFixture] - [Description("Tizen.Applications.Messages.MessagePort Test : send and receive messages between applications through MessagePort")] - public class MessagePortTests - { - protected readonly string LogTag = typeof(Program).Namespace; - private Tizen.Applications.Messages.MessagePort _messagePort; - private Task> _runningApps; - private Bundle _message; - private RemoteValues _remote; - private IEnumerable _list; - private const string PortName = "LocalPort"; - private const string MyRemoteAppId = "org.tizen.MsgPortApp.Tizen"; - private const string MyRemoteAppId1 = "org.tizen.MsgPortApp1.Tizen"; - private bool _flag; - - [SetUp] - public void Init() - { - _messagePort = null; - _flag = false; - } - - [TearDown] - public void Destroy() - { - _message = null; - _remote = null; - if (_messagePort != null) - { - _messagePort.Dispose(); - } - _flag = false; - if (_runningApps != null) - { - _runningApps = null; - } - } - - void MessageReceivedCallback(object sender, MessageReceivedEventArgs e) - { - Log.Debug(LogTag, "receive !! "); - _message = e.Message; - _remote = e.Remote; - LogUtils.Write(LogUtils.DEBUG, LogUtils.INFO, "Message Received "); - Console.WriteLine("TCT @@@ Message Received "); - if (e.Remote.AppId != null) - { - LogUtils.Write(LogUtils.DEBUG, LogUtils.INFO, "from :" + e.Remote.AppId); - _flag = true; - } - } - - void AppControlReplyCallback(Tizen.Applications.AppControl launchRequest, Tizen.Applications.AppControl replyRequest, AppControlReplyResult result) - { - - } - - [Test] - [Category("P1")] - [Description("Test : MessagePort Constructor")] - [Property("SPEC", " Tizen.Applications.Messages.MessagePort.MessagePort C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("AUTHOR", "Nguyen Tien Dung, dung.nt5@samsung.com")] - public void MessagePort_INIT() - { - _messagePort = new Tizen.Applications.Messages.MessagePort(PortName, false); - - Assert.IsNotNull(_messagePort, "Object should not be null after initializing"); - Assert.IsInstanceOf(_messagePort.PortName); - Assert.AreEqual(PortName, _messagePort.PortName, "Value of \"PortName\" should be matched with value of \"portName\""); - Assert.IsInstanceOf(_messagePort.Trusted); - Assert.IsFalse(_messagePort.Trusted, "Value of \"Trusted\" should be false"); - } - - [Test] - [Category("P1")] - [Description("Test : MessagePort Property")] - [Property("SPEC", " Tizen.Applications.Messages.MessagePort.PortName A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Nguyen Tien Dung, dung.nt5@samsung.com")] - public void PortName_PROPERTY_SET_GET() - { - _messagePort = new Tizen.Applications.Messages.MessagePort(PortName, false); - - Assert.IsInstanceOf(_messagePort.PortName); - Assert.AreEqual(PortName, _messagePort.PortName, "Value of \"PortName\" should be matched with value of \"portName\""); - } - - [Test] - [Category("P1")] - [Description("Test : MessagePort Property")] - [Property("SPEC", " Tizen.Applications.Messages.MessagePort.Trusted A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Nguyen Tien Dung, dung.nt5@samsung.com")] - public void Trusted_PROPERTY_SET_GET() - { - _messagePort = new Tizen.Applications.Messages.MessagePort(PortName, false); - - Assert.IsInstanceOf(_messagePort.Trusted); - Assert.IsFalse(_messagePort.Trusted, "Value of \"Trusted\" should be false"); - } - - [Test] - [Category("P1")] - [Description("Test : MessagePort Property")] - [Property("SPEC", " Tizen.Applications.Messages.MessagePort.Listening A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRO")] - [Property("AUTHOR", "Nguyen Tien Dung, dung.nt5@samsung.com")] - public void Listening_PROPERTY_GET() - { - /* PRECONDITION - * Init MessagePort - * Start listening - * */ - _messagePort = new Tizen.Applications.Messages.MessagePort(PortName, false); - - _messagePort.Listen(); - Assert.IsTrue(_messagePort.Listening, "The attribute \"Listening\" should be true"); - - /* TEST CODE */ - _messagePort.StopListening(); - Assert.IsFalse(_messagePort.Listening, "The attribute \"Listening\" should be false"); - } - - [Test] - [Category("P1")] - [Description("Test : Register a local message port - it should start listening message")] - [Property("SPEC", " Tizen.Applications.Messages.MessagePort.Listen M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Nguyen Tien Dung, dung.nt5@samsung.com")] - public void Listen_FROM_A_PORT() - { - /* PRECONDITION - * Init MessagePort - * */ - _messagePort = new Tizen.Applications.Messages.MessagePort(PortName, false); - - /* TEST CODE */ - _messagePort.Listen(); - Assert.IsTrue(_messagePort.Listening, "The attribute \"Listening\" should be true"); - - /* POSTCONDITION - * Unregisters the message port - * */ - _messagePort.StopListening(); - } - - [Test] - [Category("P1")] - [Description("Test : Unregister a local message port - it should stop listening message")] - [Property("SPEC", " Tizen.Applications.Messages.MessagePort.StopListening M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Nguyen Tien Dung, dung.nt5@samsung.com")] - public void StopListening_FROM_A_PORT() - { - /* PRECONDITION - * Init MessagePort - * Start listening - * */ - _messagePort = new Tizen.Applications.Messages.MessagePort(PortName, false); - - _messagePort.Listen(); - - /* TEST CODE */ - _messagePort.StopListening(); - Assert.IsFalse(_messagePort.Listening, "The attribute \"Listening\" should be false"); - } - - [Test] - [Category("P1")] - [Description("Test : Send a message to a remote application")] - [Property("SPEC", " Tizen.Applications.Messages.MessagePort.Send M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Nguyen Tien Dung, dung.nt5@samsung.com")] - [Property("COVPARAM", "Tizen.Applications.Bundle, string, string")] - public async Task Send_A_MESSAGE_TO_A_REMOTE_APP() - { - /* PRECONDITION - * 1)Install org.tizen.MsgPortApp.tpk and run it - * 2)Init MessagePort -> Start listening - * */ - string myRemotePort = "RemotePort"; - bool isRunning = false; - bool trusted = false; - - _runningApps = ApplicationManager.GetRunningApplicationsAsync(); - _list = await _runningApps; - foreach (var app in _list) - { - if (app.ApplicationId == MyRemoteAppId) - { - isRunning = true; - break; - } - - } - Assert.IsTrue(isRunning, MyRemoteAppId + "should be running"); - - _messagePort = new Tizen.Applications.Messages.MessagePort(PortName, trusted); - _messagePort.MessageReceived += MessageReceivedCallback; - _messagePort.Listen(); - - /* TEST CODE */ - var msg = new Bundle(); - Assert.IsNotNull(msg, "Object \"msg\" should not be null after initializing"); - msg.AddItem("message", "Send_A_MESSAGE_TO_A_REMOTE_APP"); - _messagePort.Send(msg, MyRemoteAppId, myRemotePort); - - Log.Debug(LogTag, "send !! "); - - - await Task.Delay(2000); - Assert.IsTrue(_flag, "Message is not sent"); - _messagePort.MessageReceived -= MessageReceivedCallback; - - /* POSTCONDITION - * Unregisters the message port - * */ - _messagePort.StopListening(); - } - - [Test] - [Category("P1")] - [Description("Test : Send a message to a remote application")] - [Property("SPEC", " Tizen.Applications.Messages.MessagePort.Send M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Nguyen Tien Dung, dung.nt5@samsung.com")] - [Property("COVPARAM", "Tizen.Applications.Bundle, string, string, bool")] - public async Task Send_A_TRUSTED_MESSAGE_TO_A_REMOTE_APP() - { - /* PRECONDITION - * 1)Install org.tizen.MsgPortApp.tpk and run it - * 2)Init MessagePort -> Start listening - * */ - string myRemotePort = "RemotePort1"; - bool isRunning = false; - bool trusted = true; - - _runningApps = ApplicationManager.GetRunningApplicationsAsync(); - _list = await _runningApps; - foreach (var app in _list) - { - if (app.ApplicationId == MyRemoteAppId) - { - isRunning = true; - break; - } - } - Assert.IsTrue(isRunning, MyRemoteAppId + "should be running"); - - _messagePort = new Tizen.Applications.Messages.MessagePort(PortName, trusted); - _messagePort.MessageReceived += MessageReceivedCallback; - _messagePort.Listen(); - - /* TEST CODE */ - var trustedMsg = new Bundle(); - Assert.IsNotNull(trustedMsg, "Object \"msg\" should not be null after initializing"); - trustedMsg.AddItem("message", "Send_A_TRUSTED_MESSAGE_TO_A_REMOTE_APP"); - _messagePort.Send(trustedMsg, MyRemoteAppId, myRemotePort, trusted); - - await Task.Delay(2000); - Assert.IsTrue(_flag, "Message is not sent"); - _messagePort.MessageReceived -= MessageReceivedCallback; - - /* POSTCONDITION - * Unregisters the message port - * */ - _messagePort.StopListening(); - } - - [Test] - [Category("P1")] - [Description("Test : Check MessageReceived event when receiving a message from a remote application")] - [Property("SPEC", " Tizen.Applications.Messages.MessagePort.MessageReceived E")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "EVL")] - [Property("AUTHOR", "Nguyen Tien Dung, dung.nt5@samsung.com")] - public async Task MessageReceived_CHECK_EVENT() - { - /* PRECONDITION - * 1)Install org.tizen.MsgPortApp.tpk and run it - * 2)Init MessagePort -> Start listening -> Send a message to remoteApp and wait for callback message to check event - * */ - string myRemotePort = "RemotePort"; - bool isRunning = false; - bool trusted = false; - - _runningApps = ApplicationManager.GetRunningApplicationsAsync(); - _list = await _runningApps; - foreach (var app in _list) - { - if (app.ApplicationId == MyRemoteAppId1) - { - isRunning = true; - break; - } - - } - Assert.IsTrue(isRunning, MyRemoteAppId1 + "should be running"); - - _messagePort = new Tizen.Applications.Messages.MessagePort(PortName, trusted); - _messagePort.MessageReceived += MessageReceivedCallback; - _messagePort.Listen(); - - var msg = new Bundle(); - Assert.IsNotNull(msg, "Object \"msg\" should not be null after initializing"); - msg.AddItem("message", "MessageReceived_CHECK_EVENT"); - _messagePort.Send(msg, MyRemoteAppId1, myRemotePort); - await Task.Delay(2000); - - /* TEST CODE */ - Assert.IsTrue(_flag, "MessageReceived event when receiving a message from a remote application"); - _messagePort.MessageReceived -= MessageReceivedCallback; - - /* POSTCONDITION - * Unregisters the message port - * */ - _messagePort.StopListening(); - } - - //[Test] - //[Category("P1")] - //[Description("Test Message Remote of MessageReceivedEventArgs.")] - //[Property("SPEC", " Tizen.Applications.Messages.MessageReceivedEventArgs.Message A")] - //[Property("SPEC_URL", "-")] - //[Property("CRITERIA", "PRO")] - //[Property("AUTHOR", "Pham Phuong Dong, dong.phuong@samsung.com")] - //public async Task Message_GET() { - // /* PRECONDITION - // * 1)Install org.tizen.MsgPortApp.tpk and run it - // * 2)Init MessagePort -> Start listening -> Send a message to remoteApp and wait for callback message to check event - // * */ - // if (s_message.Count == 0) { - // LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "message negative"); - // string myRemotePort = "RemotePort"; - // bool isRunning = false; - // bool trusted = false; - - // runningApps = ApplicationManager.GetRunningApplicationsAsync(); - // list = await runningApps; - // foreach (var app in list) { - // if (app.ApplicationId == myRemoteAppId1) { - // isRunning = true; - // break; - // } - - // } - // Assert.IsTrue(isRunning, myRemoteAppId1 + "should be running"); - - // messagePort = new Tizen.Applications.Messages.MessagePort(portName, trusted); - // Assert.IsNotNull(messagePort, "Object \"messagePort\" should not be null after initializing"); - // messagePort.MessageReceived += MessageReceivedCallback; - // messagePort.Listen(); - - // var msg = new Bundle(); - // Assert.IsNotNull(msg, "Object \"msg\" should not be null after initializing"); - // msg.AddItem("message", "MessageReceived_CHECK_EVENT"); - // messagePort.Send(msg, myRemoteAppId1, myRemotePort); - // await Task.Delay(2000); - // messagePort.MessageReceived -= MessageReceivedCallback; - // messagePort.StopListening(); - // } - - // /* TEST CODE */ - // Assert.Greater(s_message.Count, 0, "Message of MessageReceivedEventArgs should be more 0"); - //} - - //[Test] - //[Category("P1")] - //[Description("Test property Remote of MessageReceivedEventArgs.")] - //[Property("SPEC", " Tizen.Applications.Messages.MessageReceivedEventArgs.Remote A")] - //[Property("SPEC_URL", "-")] - //[Property("CRITERIA", "PRO")] - //[Property("AUTHOR", "Pham Phuong Dong, dong.phuong@samsung.com")] - //public async Task Remote_GET() { - // /* PRECONDITION - // * 1)Install org.tizen.MsgPortApp.tpk and run it - // * 2)Init MessagePort -> Start listening -> Send a message to remoteApp and wait for callback message to check event - // * */ - // LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Remote " + s_remote.AppId); - // if (s_remote.AppId == null) { - // LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Remote negative"); - // string myRemotePort = "RemotePort"; - // bool isRunning = false; - // bool trusted = false; - - // runningApps = ApplicationManager.GetRunningApplicationsAsync(); - // list = await runningApps; - // foreach (var app in list) { - // if (app.ApplicationId == myRemoteAppId1) { - // isRunning = true; - // break; - // } - - // } - // Assert.IsTrue(isRunning, myRemoteAppId1 + "should be running"); - - // messagePort = new Tizen.Applications.Messages.MessagePort(portName, trusted); - // Assert.IsNotNull(messagePort, "Object \"messagePort\" should not be null after initializing"); - // messagePort.MessageReceived += MessageReceivedCallback; - // messagePort.Listen(); - - // var msg = new Bundle(); - // Assert.IsNotNull(msg, "Object \"msg\" should not be null after initializing"); - // msg.AddItem("message", "MessageReceived_CHECK_EVENT"); - // messagePort.Send(msg, myRemoteAppId1, myRemotePort); - // await Task.Delay(2000); - // messagePort.MessageReceived -= MessageReceivedCallback; - // messagePort.StopListening(); - // } - - // /* TEST CODE */ - // string APP_ID = "org.tizen.MsgPortApp1"; - // Assert.AreEqual(APP_ID, s_remote.AppId, "AppId of Remote of MessageReceivedEventArgs should be " + APP_ID + "."); - // s_remote = null; - //} - } -} - diff --git a/tct-suite-vs/Tizen.Applications.Tests/testcase/TSMessageReceivedEventArgs.cs b/tct-suite-vs/Tizen.Applications.Tests/testcase/TSMessageReceivedEventArgs.cs deleted file mode 100755 index 0198e2079..000000000 --- a/tct-suite-vs/Tizen.Applications.Tests/testcase/TSMessageReceivedEventArgs.cs +++ /dev/null @@ -1,178 +0,0 @@ -using NUnit.Framework; -using NUnit.Framework.TUnit; -using System; -using System.Collections.Generic; -using System.Threading.Tasks; -using Tizen.Applications.Messages; -using XamarinForTizen.Tizen; - -namespace Tizen.Applications.Tests -{ - - [TestFixture] - [Description("Test : argument of Received Message ")] - class MessageReceivedEventArgsTests - { - protected readonly string LogTag = typeof(Program).Namespace; - private Tizen.Applications.Messages.MessagePort _messagePort; - private Bundle _message; - private RemoteValues _remote; - private IEnumerable _list; - private const string PortName = "LocalPort"; - private const string MyRemoteAppId = "org.tizen.MsgPortApp.Tizen"; - private const string MyRemoteAppId1 = "org.tizen.MsgPortApp1.Tizen"; - private bool _flag; - - [SetUp] - public void Init() - { - _messagePort = null; - _flag = false; - } - - [TearDown] - public void Destroy() - { - if (_messagePort != null) - { - _messagePort.Dispose(); - } - } - - [Test] - [Category("P1")] - [Description("MessageReceivedEventArgs() constructor.")] - [Property("SPEC", "Tizen.Applications.Messages.MessageReceivedEventArgs.MessageReceivedEventArgs C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("AUTHOR", "Dao Trong Hieu, tronghieu.d@samsung.com")] - public void MessageReceivedEventArgs_INIT() - { - /* TEST CODE */ - MessageReceivedEventArgs msgReceivedArgs = new MessageReceivedEventArgs(); - Assert.IsNotNull(msgReceivedArgs, "MessageReceivedEventArgs should be not null after init"); - } - - [Test] - [Category("P1")] - [Description("Test Message Remote of MessageReceivedEventArgs.")] - [Property("SPEC", " Tizen.Applications.Messages.MessageReceivedEventArgs.Message A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRO")] - [Property("AUTHOR", "Pham Phuong Dong, dong.phuong@samsung.com")] - public async Task Message_GET() - { - /* PRECONDITION - * 1)Install org.tizen.MsgPortApp.tpk and run it - * 2)Init MessagePort -> Start listening -> Send a message to remoteApp and wait for callback message to check event - * */ - //LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "message start "); - if (_message == null) - { - //LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "message negative"); - string myRemotePort = "RemotePort"; - bool isRunning = false; - bool trusted = false; - - _list = await ApplicationManager.GetRunningApplicationsAsync(); - foreach (var app in _list) - { - if (app.ApplicationId == MyRemoteAppId1) - { - isRunning = true; - break; - } - - } - Assert.IsTrue(isRunning, MyRemoteAppId1 + "should be running"); - - _messagePort = new Tizen.Applications.Messages.MessagePort(PortName, trusted); - Assert.IsNotNull(_messagePort, "Object \"messagePort\" should not be null after initializing"); - _messagePort.MessageReceived += MessageReceivedCallback; - _messagePort.Listen(); - - var msg = new Bundle(); - Assert.IsNotNull(msg, "Object \"msg\" should not be null after initializing"); - msg.AddItem("message", "MessageReceived_CHECK_EVENT"); - _messagePort.Send(msg, MyRemoteAppId1, myRemotePort); - Log.Error(LogTag, "send !! "); - await Task.Delay(2000); - _messagePort.MessageReceived -= MessageReceivedCallback; - _messagePort.StopListening(); - } - - /* TEST CODE */ - //LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "message end"); - Assert.Greater(_message.Count, 0, "Message of MessageReceivedEventArgs should be more 0"); - } - - [Test] - [Category("P1")] - [Description("Test property Remote of MessageReceivedEventArgs.")] - [Property("SPEC", " Tizen.Applications.Messages.MessageReceivedEventArgs.Remote A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRO")] - [Property("AUTHOR", "Pham Phuong Dong, dong.phuong@samsung.com")] - public async Task Remote_GET() - { - /* PRECONDITION - * 1)Install org.tizen.MsgPortApp.tpk and run it - * 2)Init MessagePort -> Start listening -> Send a message to remoteApp and wait for callback message to check event - * */ - //LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Remote start"); - if (_remote == null) - { - //LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Remote negative"); - string myRemotePort = "RemotePort"; - bool isRunning = false; - bool trusted = false; - - _list = await ApplicationManager.GetRunningApplicationsAsync(); - foreach (var app in _list) - { - if (app.ApplicationId == MyRemoteAppId1) - { - isRunning = true; - break; - } - - } - Assert.IsTrue(isRunning, MyRemoteAppId1 + "should be running"); - - _messagePort = new Tizen.Applications.Messages.MessagePort(PortName, trusted); - Assert.IsNotNull(_messagePort, "Object \"messagePort\" should not be null after initializing"); - _messagePort.MessageReceived += MessageReceivedCallback; - _messagePort.Listen(); - - var msg = new Bundle(); - Assert.IsNotNull(msg, "Object \"msg\" should not be null after initializing"); - msg.AddItem("message", "MessageReceived_CHECK_EVENT"); - _messagePort.Send(msg, MyRemoteAppId1, myRemotePort); - Log.Debug(LogTag, "send !! "); - await Task.Delay(2000); - _messagePort.MessageReceived -= MessageReceivedCallback; - _messagePort.StopListening(); - } - - /* TEST CODE */ - string APP_ID = "org.tizen.MsgPortApp1.Tizen"; - //LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Remote end"); - Assert.AreEqual(APP_ID, _remote.AppId, "AppId of Remote of MessageReceivedEventArgs should be " + APP_ID + "."); - _remote = null; - } - - void MessageReceivedCallback(object sender, MessageReceivedEventArgs e) - { - Log.Debug(LogTag, "receive !! "); - _message = e.Message; - _remote = e.Remote; - LogUtils.Write(LogUtils.DEBUG, LogUtils.INFO, "Message Received "); - Console.WriteLine("TCT @@@ Message Received "); - if (e.Remote.AppId != null) - { - LogUtils.Write(LogUtils.DEBUG, LogUtils.INFO, "from :" + e.Remote.AppId); - _flag = true; - } - } - } -} diff --git a/tct-suite-vs/Tizen.Applications.Tests/testcase/TSPreference.EventContext.cs b/tct-suite-vs/Tizen.Applications.Tests/testcase/TSPreference.EventContext.cs deleted file mode 100755 index 42cadb6ab..000000000 --- a/tct-suite-vs/Tizen.Applications.Tests/testcase/TSPreference.EventContext.cs +++ /dev/null @@ -1,98 +0,0 @@ -using System; -using NUnit.Framework; -using NUnit.Framework.TUnit; -using System.Collections.Generic; -using System.Threading.Tasks; - -namespace Tizen.Applications.Tests -{ - [TestFixture] - [Description("Tizen.Applications.Preference.EventContext test case")] - public class EventContextTests - { - private bool _callbackIsCalled; - private PreferenceChangedEventArgs _preferChEvent; - [SetUp] - public void Init() - { - _callbackIsCalled = false; - LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Preconditions for each TEST"); - } - - [TearDown] - public void Destroy() - { - LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Postconditions for each TEST"); - } - - private void PreferenceChangedCallback(object sender, PreferenceChangedEventArgs preEv) - { - Log.Debug("PREF", "@@## PreferenceChangedCallback"); - _preferChEvent = preEv; - - _callbackIsCalled = true; - } - public async Task WaitCallback() - { - int count = 0; - while (true) - { - if (count < 3) - count = count + 1; - else - break; - - if (_callbackIsCalled == true) - break; - - await Task.Delay(1000); - } - } - - [Test] - [Category("P1")] - [Description("Test Preference EventContext changed callback calling")] - [Property("SPEC", "Tizen.Applications.Preference.EventContext.Changed E")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "EVL")] - [Property("AUTHOR", "Sukhyung Kang, shine.kang@samsung.com")] - public async Task Changed_CALLBACK() - { - Log.Debug("PREF", "@@## EventContext Changed_CALLBACK"); - - string intKey = "Gunter"; - _callbackIsCalled = false; - - _preferChEvent = new PreferenceChangedEventArgs(); - - try - { - Preference.Set(intKey, 33); - Preference.EventContext context; - Preference.GetEventContext(intKey).TryGetTarget(out context); - if (context != null) - { - context.Changed += PreferenceChangedCallback; - } - - Preference.Set(intKey, 77); - - await WaitCallback(); - - Assert.AreEqual(_callbackIsCalled, true, "preference callback is not called"); - Assert.AreEqual(_preferChEvent.Key, intKey, "preference key is not matched"); - - if (context != null) - { - context.Changed -= PreferenceChangedCallback; - } - - Preference.Remove(intKey); - } - catch (Exception e) - { - Assert.Fail(e.ToString()); - } - } - } -} diff --git a/tct-suite-vs/Tizen.Applications.Tests/testcase/TSPreference.cs b/tct-suite-vs/Tizen.Applications.Tests/testcase/TSPreference.cs deleted file mode 100755 index bfa2cdcc1..000000000 --- a/tct-suite-vs/Tizen.Applications.Tests/testcase/TSPreference.cs +++ /dev/null @@ -1,605 +0,0 @@ -using System; -using NUnit.Framework; -using NUnit.Framework.TUnit; -using System.Collections.Generic; -using System.Threading.Tasks; - -namespace Tizen.Applications.Tests -{ - [TestFixture] - [Description("Tizen.Applications.Preference test case")] - public class PreferenceTest - { - [SetUp] - public void Init() - { - LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Preconditions for each TEST"); - } - - [TearDown] - public void Destroy() - { - LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Postconditions for each TEST"); - } - - [Test] - [Category("P1")] - [Description("Test Preference int type set test")] - [Property("SPEC", "Tizen.Applications.Preference.Set M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MCST")] - [Property("AUTHOR", "Sukhyung Kang, shine.kang@samsung.com")] - public void Set_INT_TYPE() - { - Log.Debug("PREF", "@@## Preference set int value"); - - string intKey = "setintkey"; - int intVal = 33; - int val; - - try - { - Preference.Set(intKey, intVal); - val = Preference.Get(intKey); - Assert.AreEqual(intVal, val, "int value is not set properly"); - Preference.Remove(intKey); - } - catch (Exception e) - { - Assert.Fail(e.ToString()); - } - } - - [Test] - [Category("P1")] - [Description("Test Preference int type get test")] - [Property("SPEC", "Tizen.Applications.Preference.Get M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Sukhyung Kang, shine.kang@samsung.com")] - public void Get_INT_TYPE() - { - Log.Debug("PREF", "@@## Preference get int value "); - - string intKey = "getintkey"; - int intVal = 34; - int val; - - try - { - Preference.Set(intKey, intVal); - val = Preference.Get(intKey); - Assert.AreEqual(intVal, val, "int value is not set properly"); - Preference.Remove(intKey); - } - catch (Exception e) - { - Assert.Fail(e.ToString()); - } - } - - [Test] - [Category("P1")] - [Description("Test Preference int type remove test")] - [Property("SPEC", "Tizen.Applications.Preference.Remove M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MCST")] - [Property("AUTHOR", "Sukhyung Kang, shine.kang@samsung.com")] - public void Remove_INT_TYPE() - { - Log.Debug("PREF", "@@## Preference remove int value"); - - string intKey = "rmintkey"; - int intVal = 35; - int val; - - try - { - Preference.Set(intKey, intVal); - val = Preference.Get(intKey); - Preference.Remove(intKey); - } - catch (Exception e) - { - Assert.Fail(e.ToString()); - } - - Assert.Throws(() => Preference.Get(intKey)); - } - - [Test] - [Category("P1")] - [Description("Test Preference double type set test")] - [Property("SPEC", "Tizen.Applications.Preference.Set M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MCST")] - [Property("AUTHOR", "Sukhyung Kang, shine.kang@samsung.com")] - public void Set_DOUBLE_TYPE() - { - Log.Debug("PREF", "@@## Preference set double value"); - - string doubleKey = "setdoublekey"; - double doubleVal = 33.3; - double val; - - try - { - Preference.Set(doubleKey, doubleVal); - val = Preference.Get(doubleKey); - Assert.AreEqual(doubleVal, val, "double value is not set properly"); - Preference.Remove(doubleKey); - } - catch (Exception e) - { - Assert.Fail(e.ToString()); - } - } - - [Test] - [Category("P1")] - [Description("Test Preference double type get test")] - [Property("SPEC", "Tizen.Applications.Preference.Get M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Sukhyung Kang, shine.kang@samsung.com")] - public void Get_DOUBLE_TYPE() - { - Log.Debug("PREF", "@@## Preference get double value"); - - string doubleKey = "getdoublekey"; - double doubleVal = 34.4; - double val; - - try - { - Preference.Set(doubleKey, doubleVal); - val = Preference.Get(doubleKey); - Assert.AreEqual(doubleVal, val, "double value is not set properly"); - Preference.Remove(doubleKey); - } - catch (Exception e) - { - Assert.Fail(e.ToString()); - } - } - - [Test] - [Category("P1")] - [Description("Test Preference double type remove test")] - [Property("SPEC", "Tizen.Applications.Preference.Remove M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MCST")] - [Property("AUTHOR", "Sukhyung Kang, shine.kang@samsung.com")] - public void Remove_DOUBLE_TYPE() - { - Log.Debug("PREF", "@@## Preference get double value"); - - string doubleKey = "rmdoublekey"; - double doubleVal = 35.5; - double val; - - try - { - Preference.Set(doubleKey, doubleVal); - val = Preference.Get(doubleKey); - Preference.Remove(doubleKey); - } - catch (Exception e) - { - Assert.Fail(e.ToString()); - } - - Assert.Throws(() => Preference.Get(doubleKey)); - } - - [Test] - [Category("P1")] - [Description("Test Preference string type set test")] - [Property("SPEC", "Tizen.Applications.Preference.Set M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MCST")] - [Property("AUTHOR", "Sukhyung Kang, shine.kang@samsung.com")] - public void Set_STRING_TYPE() - { - Log.Debug("PREF", "@@## Preference set string value"); - - string stringKey = "setstringkey"; - string stringVal = "setPref"; - string val; - - try - { - Preference.Set(stringKey, stringVal); - val = Preference.Get(stringKey); - Assert.AreEqual(stringVal, val, "string value is not set properly"); - Preference.Remove(stringKey); - } - catch (Exception e) - { - Assert.Fail(e.ToString()); - } - } - - [Test] - [Category("P1")] - [Description("Test Preference string type get test")] - [Property("SPEC", "Tizen.Applications.Preference.Get M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Sukhyung Kang, shine.kang@samsung.com")] - public void Get_STRING_TYPE() - { - Log.Debug("PREF", "@@## Preference get string value"); - - string stringKey = "getstringkey"; - string stringVal = "getPref"; - string val; - - try - { - Preference.Set(stringKey, stringVal); - val = Preference.Get(stringKey); - Assert.AreEqual(stringVal, val, "string value is not set properly"); - Preference.Remove(stringKey); - } - catch (Exception e) - { - Assert.Fail(e.ToString()); - } - } - - [Test] - [Category("P1")] - [Description("Test Preference string type remove test")] - [Property("SPEC", "Tizen.Applications.Preference.Remove M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MCST")] - [Property("AUTHOR", "Sukhyung Kang, shine.kang@samsung.com")] - public void Remove_STRING_TYPE() - { - Log.Debug("PREF", "@@## Preference remove string value"); - - string stringKey = "rmstringkey"; - string stringVal = "rmPref"; - string val; - - try - { - Preference.Set(stringKey, stringVal); - val = Preference.Get(stringKey); - Preference.Remove(stringKey); - } - catch (Exception e) - { - Assert.Fail(e.ToString()); - } - - Assert.Throws(() => Preference.Get(stringKey)); - } - - [Test] - [Category("P1")] - [Description("Test Preference bool type set test")] - [Property("SPEC", "Tizen.Applications.Preference.Set M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MCST")] - [Property("AUTHOR", "Sukhyung Kang, shine.kang@samsung.com")] - public void Set_BOOL_TYPE() - { - Log.Debug("PREF", "@@## Preference set bool value"); - - string boolKey = "setboolKey"; - bool boolVal = true; - bool val; - - try - { - Preference.Set(boolKey, boolVal); - val = Preference.Get(boolKey); - Assert.AreEqual(boolVal, val, "bool value is not set properly"); - Preference.Remove(boolKey); - } - catch (Exception e) - { - Assert.Fail(e.ToString()); - } - } - - [Test] - [Category("P1")] - [Description("Test Preference bool type get test")] - [Property("SPEC", "Tizen.Applications.Preference.Get M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Sukhyung Kang, shine.kang@samsung.com")] - public void Get_BOOL_TYPE() - { - Log.Debug("PREF", "@@## Preference get bool value"); - - string boolKey = "getboolKey"; - bool boolVal = true; - bool val; - - try - { - Preference.Set(boolKey, boolVal); - val = Preference.Get(boolKey); - Assert.AreEqual(boolVal, val, "bool value is not set properly"); - Preference.Remove(boolKey); - } - catch (Exception e) - { - Assert.Fail(e.ToString()); - } - } - - [Test] - [Category("P1")] - [Description("Test Preference bool type remove test")] - [Property("SPEC", "Tizen.Applications.Preference.Remove M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MCST")] - [Property("AUTHOR", "Sukhyung Kang, shine.kang@samsung.com")] - public void Remove_BOOL_TYPE() - { - Log.Debug("PREF", "@@## Preference remove bool value"); - - string boolKey = "rmboolKey"; - bool boolVal = true; - bool val; - - try - { - Preference.Set(boolKey, boolVal); - val = Preference.Get(boolKey); - Preference.Remove(boolKey); - } - catch (Exception e) - { - Assert.Fail(e.ToString()); - } - - Assert.Throws(() => Preference.Get(boolKey)); - } - - [Test] - [Category("P2")] - [Description("Test Preference set exception case because of wrong parameters")] - [Property("SPEC", "Tizen.Applications.Preference.Set M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MEX")] - [Property("AUTHOR", "Sukhyung Kang, shine.kang@samsung.com")] - public void Set_EXCEPTION_CASE() - { - Log.Debug("PREF", "@@## Preference set exception"); - - Assert.Throws(() => Preference.Set(null, 1)); - Assert.Throws(() => Preference.Set(null, 1.1)); - Assert.Throws(() => Preference.Set(null, true)); - Assert.Throws(() => Preference.Set("validkey", null)); - } - - [Test] - [Category("P2")] - [Description("Test Preference get exception case")] - [Property("SPEC", "Tizen.Applications.Preference.Get M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MEX")] - [Property("AUTHOR", "Sukhyung Kang, shine.kang@samsung.com")] - public void Get_EXCEPTION_CASE() - { - Log.Debug("PREF", "@@## Preference get exception"); - - Assert.Throws(() => Preference.Get(null)); - Assert.Throws(() => Preference.Get(null)); - Assert.Throws(() => Preference.Get("invalidkey")); - Assert.Throws(() => Preference.Get("invalidkey2")); - } - - [Test] - [Category("P2")] - [Description("Test Preference remove exception case")] - [Property("SPEC", "Tizen.Applications.Preference.Remove M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MEX")] - [Property("AUTHOR", "Sukhyung Kang, shine.kang@samsung.com")] - public void Remove_EXCEPTION_CASE() - { - Log.Debug("PREF", "@@## Preference remove exception"); - - Assert.Throws(() => Preference.Remove(null)); - Assert.Throws(() => Preference.Remove("invalidkey")); - } - - [Test] - [Category("P1")] - [Description("Test Preference contains test to check whether the key is exist or not")] - [Property("SPEC", "Tizen.Applications.Preference.Contains M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Sukhyung Kang, shine.kang@samsung.com")] - public void Contains_RETURN_TYPE_BOOL() - { - Log.Debug("PREF", "@@## Preference contains test"); - - string intKey = "Fin"; - string stringKey = "Jake"; - int intVal = 77; - string stringVal = "advan"; - bool result; - - try - { - Preference.Set(intKey, intVal); - Preference.Set(stringKey, stringVal); - - result = Preference.Contains(intKey); - Assert.AreEqual(result, true, "int value is not set properly"); - - result = Preference.Contains(stringKey); - Assert.AreEqual(result, true, "string value is not set properly"); - - Preference.Remove(intKey); - Preference.Remove(stringKey); - - result = Preference.Contains(intKey); - Assert.AreEqual(result, false, "int value is not removed properly"); - - result = Preference.Contains(stringKey); - Assert.AreEqual(result, false, "string value is not removed properly"); - } - catch (Exception e) - { - Assert.Fail(e.ToString()); - } - } - - [Test] - [Category("P2")] - [Description("Test Preference contains test exception case")] - [Property("SPEC", "Tizen.Applications.Preference.Contains M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MEX")] - [Property("AUTHOR", "Sukhyung Kang, shine.kang@samsung.com")] - public void Contains_EXCEPTION() - { - Log.Debug("PREF", "@@## Preference contains exception test"); - - Assert.Throws(() => Preference.Contains(null)); - } - - [Test] - [Category("P1")] - [Description("Test Preference removeall test to check whether all keys are removed properly")] - [Property("SPEC", "Tizen.Applications.Preference.RemoveAll M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MCST")] - [Property("AUTHOR", "Sukhyung Kang, shine.kang@samsung.com")] - public void RemoveAll_CHECK_WITHOUT_EXCEPTION() - { - Log.Debug("PREF", "@@## Preference removeall"); - - string intKey = "Gunter"; - int intVal = 77; - string stringKey = "Ice"; - string stringVal = "King"; - string doubleKey = "Fiona"; - double doubleVal = 33.3; - string boolKey = "Marcy"; - bool boolVal = true; - - bool result; - - try - { - Preference.Set(intKey, intVal); - Preference.Set(stringKey, stringVal); - Preference.Set(doubleKey, doubleVal); - Preference.Set(boolKey, boolVal); - Preference.RemoveAll(); - - result = Preference.Contains(intKey); - Assert.AreEqual(result, false, "int value is not removed properly"); - - result = Preference.Contains(stringKey); - Assert.AreEqual(result, false, "string value is not removed properly"); - - result = Preference.Contains(doubleKey); - Assert.AreEqual(result, false, "double value is not removed properly"); - - result = Preference.Contains(boolKey); - Assert.AreEqual(result, false, "bool value is not removed properly"); - } - catch (Exception e) - { - Assert.Fail(e.ToString()); - } - } - - [Test] - [Category("P1")] - [Description("Test Preference keys test to check get keys list")] - [Property("SPEC", "Tizen.Applications.Preference.Keys A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRO")] - [Property("AUTHOR", "Sukhyung Kang, shine.kang@samsung.com")] - public void Keys_RETURN_TYPE_LIST() - { - Log.Debug("PREF", "@@## Preference keys"); - - string intKey = "Gunter"; - int intVal = 77; - string stringKey = "Ice"; - string stringVal = "King"; - string doubleKey = "Fiona"; - double doubleVal = 33.3; - string boolKey = "Marcy"; - bool boolVal = true; - - bool result; - - try - { - Preference.Set(intKey, intVal); - Preference.Set(stringKey, stringVal); - Preference.Set(doubleKey, doubleVal); - Preference.Set(boolKey, boolVal); - - foreach (string prefKey in Preference.Keys) - { - result = Preference.Contains(prefKey); - Assert.AreEqual(result, true, "key is not in Preference.Keys : " + prefKey); - } - - Preference.RemoveAll(); - } - catch (Exception e) - { - Assert.Fail(e.ToString()); - } - } - - [Test] - [Category("P2")] - [Description("Test Preference GetEventContext test exception case")] - [Property("SPEC", "Tizen.Applications.Preference.GetEventContext M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MEX")] - [Property("AUTHOR", "Sukhyung Kang, shine.kang@samsung.com")] - public void GetEventContext_EXCEPTION() - { - Log.Debug("PREF", "@@## Preference GetEventContext exception case"); - - Preference.EventContext context; - Assert.Throws(() => Preference.GetEventContext("invalidkey")); - } - - [Test] - [Category("P1")] - [Description("Test Preference GetEventContext test")] - [Property("SPEC", "Tizen.Applications.Preference.GetEventContext M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Sukhyung Kang, shine.kang@samsung.com")] - public void GetEventContext_CHECK_WITHOUT_EXCEPTION() - { - Log.Debug("PREF", "@@## Preference GetEventContext"); - - string intKey = "Fiona"; - Preference.EventContext context; - - try - { - Preference.Set(intKey, 33); - Preference.GetEventContext(intKey).TryGetTarget(out context); - Assert.IsNotNull(context, "Failed to get EventContext"); - - Preference.Remove(intKey); - } - catch (Exception e) - { - Assert.Fail(e.ToString()); - } - } - } -} diff --git a/tct-suite-vs/Tizen.Applications.Tests/testcase/TSPreferenceChangedEventArgs.cs b/tct-suite-vs/Tizen.Applications.Tests/testcase/TSPreferenceChangedEventArgs.cs deleted file mode 100755 index 7172ff78e..000000000 --- a/tct-suite-vs/Tizen.Applications.Tests/testcase/TSPreferenceChangedEventArgs.cs +++ /dev/null @@ -1,112 +0,0 @@ -using System; -using NUnit.Framework; -using NUnit.Framework.TUnit; -using System.Threading.Tasks; - -namespace Tizen.Applications.Tests -{ - - [TestFixture] - [Description("Tizen.Application.PreferenceChangedEventArgs Tests")] - public class PreferenceChangedEventArgsTests - { - private bool _callbackIsCalled; - private PreferenceChangedEventArgs _preferChEvent; - - [SetUp] - public void Init() - { - LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Preconditions for each TEST"); - } - - [TearDown] - public void Destroy() - { - LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Postconditions for each TEST"); - } - - [Test] - [Category("P1")] - [Description("Test PreferenceChangedEventArgs method initialization")] - [Property("SPEC", "Tizen.Applications.PreferenceChangedEventArgs.PreferenceChangedEventArgs C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("AUTHOR", "Sukhyung Kang, shine.kang@samsung.com")] - public void PreferenceChangedEventArgs_INIT() - { - var myPreferenceChangedEventArgs = new PreferenceChangedEventArgs(); - Assert.IsInstanceOf(myPreferenceChangedEventArgs); - Assert.IsNotNull(myPreferenceChangedEventArgs, "PreferenceChangedEventArgs should be not null after init."); - } - - private void PreferenceChangedCallback(object sender, PreferenceChangedEventArgs preEv) - { - Log.Debug("PREF", "@@## PreferenceChangedCallback"); - _preferChEvent = preEv; - - _callbackIsCalled = true; - } - public async Task WaitCallback() - { - int count = 0; - while (true) - { - if (count < 3) - count = count + 1; - else - break; - - if (_callbackIsCalled == true) - break; - - await Task.Delay(1000); - } - } - - [Test] - [Category("P1")] - [Description("Test PreferenceChangedEventArgs get Key test")] - [Property("SPEC", "Tizen.Applications.PreferenceChangedEventArgs.Key A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRO")] - [Property("AUTHOR", "Sukhyung Kang, shine.kang@samsung.com")] - public async Task Key_PROPERTY_GET() - { - Log.Debug("PREF", "@@## PreferenceChangedEventArgs Key_PROPERTY_GET"); - - string intKey = "Candy"; - _callbackIsCalled = false; - - _preferChEvent = new PreferenceChangedEventArgs(); - - try - { - Preference.Set(intKey, 33); - Preference.EventContext context; - Preference.GetEventContext(intKey).TryGetTarget(out context); - if (context != null) - { - context.Changed += PreferenceChangedCallback; - } - - Preference.Set(intKey, 77); - - await WaitCallback(); - - Assert.AreEqual(_callbackIsCalled, true, "preference callback is not called"); - Assert.AreEqual(_preferChEvent.Key, intKey, "preference key is not matched"); - - if (context != null) - { - context.Changed -= PreferenceChangedCallback; - } - - Preference.Remove(intKey); - } - catch (Exception e) - { - Assert.Fail(e.ToString()); - } - } - } -} diff --git a/tct-suite-vs/Tizen.Applications.Tests/testcase/TSRPCPort.Exceptions.cs b/tct-suite-vs/Tizen.Applications.Tests/testcase/TSRPCPort.Exceptions.cs deleted file mode 100755 index f9788b9f1..000000000 --- a/tct-suite-vs/Tizen.Applications.Tests/testcase/TSRPCPort.Exceptions.cs +++ /dev/null @@ -1,121 +0,0 @@ -using NUnit.Framework; -using NUnit.Framework.TUnit; -using System; -using System.Threading.Tasks; -using Tizen.Applications.RPCPort; - -namespace Tizen.Applications.Tests -{ - [TestFixture] - [Description("Tizen.Application.RPCPort.Exceptions Tests")] - public class ExceptionTests - { - [SetUp] - public void Init() - { - LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Preconditions for each TEST"); - } - - [TearDown] - public void Destroy() - { - LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Postconditions for each TEST"); - } - - [Test] - [Category("P1")] - [Description("Test InvalidIOException initialization")] - [Property("SPEC", "Tizen.Applications.RPCPort.InvalidIOException.InvalidIOException C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("AUTHOR", "Junghoon Park, jh9216.park@samsung.com")] - public void InvalidIOException_INIT() - { - /* TEST CODE */ - var e = new InvalidIOException(); - - Assert.IsNotNull(e, "InvalidIOException shouldn't be null after init"); - Assert.IsInstanceOf(e); - } - - [Test] - [Category("P1")] - [Description("Test InvalidIDException initialization")] - [Property("SPEC", "Tizen.Applications.RPCPort.InvalidIDException.InvalidIDException C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("AUTHOR", "Junghoon Park, jh9216.park@samsung.com")] - public void InvalidIDException_INIT() - { - /* TEST CODE */ - var e = new InvalidIDException(); - - Assert.IsNotNull(e, "InvalidIDException shouldn't be null after init"); - Assert.IsInstanceOf(e); - } - - [Test] - [Category("P1")] - [Description("Test PermissionDeniedException initialization")] - [Property("SPEC", "Tizen.Applications.RPCPort.PermissionDeniedException.PermissionDeniedException C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("AUTHOR", "Junghoon Park, jh9216.park@samsung.com")] - public void PermissionDeniedException_INIT() - { - /* TEST CODE */ - var e = new PermissionDeniedException(); - - Assert.IsNotNull(e, "PermissionDeniedException shouldn't be null after init"); - Assert.IsInstanceOf(e); - } - - [Test] - [Category("P1")] - [Description("Test InvalidProtocolException initialization")] - [Property("SPEC", "Tizen.Applications.RPCPort.InvalidProtocolException.InvalidProtocolException C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("AUTHOR", "Junghoon Park, jh9216.park@samsung.com")] - public void InvalidProtocolException_INIT() - { - /* TEST CODE */ - var e = new InvalidProtocolException(); - - Assert.IsNotNull(e, "InvalidProtocolException shouldn't be null after init"); - Assert.IsInstanceOf(e); - } - - [Test] - [Category("P1")] - [Description("Test NotConnectedSocketException initialization")] - [Property("SPEC", "Tizen.Applications.RPCPort.NotConnectedSocketException.NotConnectedSocketException C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("AUTHOR", "Junghoon Park, jh9216.park@samsung.com")] - public void NotConnectedSocketException_INIT() - { - /* TEST CODE */ - var e = new NotConnectedSocketException(); - - Assert.IsNotNull(e, "NotConnectedSocketException shouldn't be null after init"); - Assert.IsInstanceOf(e); - } - - [Test] - [Category("P1")] - [Description("Test InvalidCallbackException initialization")] - [Property("SPEC", "Tizen.Applications.RPCPort.InvalidCallbackException.InvalidCallbackException C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("AUTHOR", "Junghoon Park, jh9216.park@samsung.com")] - public void InvalidCallbackException_INIT() - { - /* TEST CODE */ - var e = new InvalidCallbackException(); - - Assert.IsNotNull(e, "InvalidCallbackException shouldn't be null after init"); - Assert.IsInstanceOf(e); - } - } -} diff --git a/tct-suite-vs/Tizen.Applications.Tests/testcase/TSRPCPort.Parcel.cs b/tct-suite-vs/Tizen.Applications.Tests/testcase/TSRPCPort.Parcel.cs deleted file mode 100755 index 6055eddf1..000000000 --- a/tct-suite-vs/Tizen.Applications.Tests/testcase/TSRPCPort.Parcel.cs +++ /dev/null @@ -1,699 +0,0 @@ -using NUnit.Framework; -using NUnit.Framework.TUnit; -using System; -using System.Threading.Tasks; -using Tizen.Applications.RPCPort; - -namespace Tizen.Applications.Tests -{ - public class Proxy : ProxyBase - { - public bool Connected { get; set; } - - public bool Received { get; set; } - - public void SendTestMessage() - { - using (var p = new Parcel()) - { - p.WriteString("test"); - p.Send(Port); - } - } - - protected override void OnConnectedEvent(string endPoint, string portName, Port port) - { - Connected = true; - } - - protected override void OnDisconnectedEvent(string endPoint, string portName) - { - } - - protected override void OnReceivedEvent(string endPoint, string portName) - { - using (var p = new Parcel(CallbackPort)) - { - Assert.IsInstanceOf(p); - Assert.IsNotNull(p, "Parcel shouldn't be null after init."); - } - Received = true; - } - - protected override void OnRejectedEvent(string endPoint, string portName) - { - } - - public void TestConnect() - { - Connect("org.tizen.example.RpcPortStub", "Test"); - } - } - - - [TestFixture] - [Description("Tizen.Application.RPCPort.Parcel Tests")] - public class ParcelTests - { - private Proxy _proxy; - - [SetUp] - public void Init() - { - LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Preconditions for each TEST"); - _proxy = new Proxy(); - _proxy.TestConnect(); - } - - [TearDown] - public void Destroy() - { - LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Postconditions for each TEST"); - _proxy.Dispose(); - _proxy = null; - } - - [Test] - [Category("P1")] - [Description("Test Parcel initialization")] - [Property("SPEC", "Tizen.Applications.RPCPort.Parcel.Parcel C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("AUTHOR", "Junghoon Park, jh9216.park@samsung.com")] - public void Parcel_INIT() - { - /* TEST CODE */ - using (var p = new Parcel()) - { - Assert.IsInstanceOf(p); - Assert.IsNotNull(p, "Parcel shouldn't be null after init."); - } - } - - [Test] - [Category("P1")] - [Description("Test Parcel initialization with port")] - [Property("SPEC", "Tizen.Applications.RPCPort.Parcel.Parcel C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("COVPARAM", "Port")] - [Property("AUTHOR", "Junghoon Park, jh9216.park@samsung.com")] - public async Task Parcel_INIT_WITH_PARAMETER() - { - /* PRECONDITION - * */ - await Task.Delay(4000); - Assert.True(_proxy.Connected); - _proxy.SendTestMessage(); - await Task.Delay(2000); - - /* TEST CODE */ - Assert.True(_proxy.Received); - } - - [Test] - [Category("P2")] - [Description("Test constructor with null argument")] - [Property("SPEC", "Tizen.Applications.RPCPort.Parcel.Parcel C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTN")] - [Property("COVPARAM", "Port")] - [Property("AUTHOR", "Junghoon Park, jh9216.park@samsung.com")] - public void Parcel_NULL_ARGUMENTS() - { - /* PRECONDITION */ - - /* TEST CODE */ - try - { - var p = new Parcel(null); - } - catch (InvalidIOException) - { - Assert.Pass(); - } - - Assert.Fail(); - } - - [Test] - [Category("P1")] - [Description("Send parcel to the other application which has been connected before")] - [Property("SPEC", "Tizen.Applications.RPCPort.Parcel.Send M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Junghoon Park, jh9216.park@samsung.com")] - public async Task Send_CHECK_WITHOUT_EXCEPTION() - { - try - { - /* PRECONDITION */ - await Task.Delay(2000); - Assert.True(_proxy.Connected); - - /* TEST CODE */ - _proxy.SendTestMessage(); - } - catch (Exception e) - { - Assert.Fail(e.ToString()); - } - } - - [Test] - [Category("P2")] - [Description("Send parcel with null Port object")] - [Property("SPEC", "Tizen.Applications.RPCPort.Parcel.Send M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MEX")] - [Property("AUTHOR", "Junghoon Park, jh9216.park@samsung.com")] - public void Send_WITH_NULL_ARGUMENTS() - { - /* PRECONDITION */ - using (var p = new Parcel()) - { - /* TEST CODE */ - try - { - p.Send(null); - } - catch (InvalidIOException) - { - Assert.Pass(); - } - } - - Assert.Fail(); - } - - [Test] - [Category("P1")] - [Description("Read a byte from parcel")] - [Property("SPEC", "Tizen.Applications.RPCPort.Parcel.ReadByte M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Junghoon Park, jh9216.park@samsung.com")] - public void ReadByte_RETURN() - { - using (var p = new Parcel()) - { - /* PRECONDITION */ - Assert.IsInstanceOf(p); - Assert.IsNotNull(p, "Parcel shouldn't be null after init."); - p.WriteByte(0x33); - - /* TEST CODE */ - byte b = p.ReadByte(); - Assert.IsTrue((b == 0x33), "ReadByte failed"); - } - } - - [Test] - [Category("P1")] - [Description("Read 'short' type value from parcel")] - [Property("SPEC", "Tizen.Applications.RPCPort.Parcel.ReadShort M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Junghoon Park, jh9216.park@samsung.com")] - public void ReadShort_RETURN() - { - using (var p = new Parcel()) - { - /* PRECONDITION */ - Assert.IsInstanceOf(p); - Assert.IsNotNull(p, "Parcel shouldn't be null after init."); - p.WriteShort(100); - - /* TEST CODE */ - short b = p.ReadShort(); - Assert.IsTrue((b == 100), "ReadShort failed"); - } - } - - [Test] - [Category("P1")] - [Description("Read 'int' type value from parcel")] - [Property("SPEC", "Tizen.Applications.RPCPort.Parcel.ReadInt M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Junghoon Park, jh9216.park@samsung.com")] - public void ReadInt_RETURN() - { - using (var p = new Parcel()) - { - /* PRECONDITION */ - Assert.IsInstanceOf(p); - Assert.IsNotNull(p, "Parcel shouldn't be null after init."); - p.WriteInt(100); - - /* TEST CODE */ - int b = p.ReadInt(); - Assert.IsTrue((b == 100), "ReadInt failed"); - } - } - - [Test] - [Category("P1")] - [Description("Read 'long' type value from parcel")] - [Property("SPEC", "Tizen.Applications.RPCPort.Parcel.ReadLong M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Junghoon Park, jh9216.park@samsung.com")] - public void ReadLong_RETURN() - { - using (var p = new Parcel()) - { - /* PRECONDITION */ - Assert.IsInstanceOf(p); - Assert.IsNotNull(p, "Parcel shouldn't be null after init."); - p.WriteLong(100); - - /* TEST CODE */ - long b = p.ReadLong(); - Assert.IsTrue((b == 100), "ReadLong failed"); - } - } - - [Test] - [Category("P1")] - [Description("Read 'float' type value from parcel")] - [Property("SPEC", "Tizen.Applications.RPCPort.Parcel.ReadFloat M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Junghoon Park, jh9216.park@samsung.com")] - public void ReadFloat_RETURN() - { - using (var p = new Parcel()) - { - /* PRECONDITION */ - Assert.IsInstanceOf(p); - Assert.IsNotNull(p, "Parcel shouldn't be null after init."); - p.WriteFloat(1.0f); - - /* TEST CODE */ - float b = p.ReadFloat(); - Assert.IsTrue((b == 1.0f), "ReadFloat failed"); - } - } - - [Test] - [Category("P1")] - [Description("Read 'double' type value from parcel")] - [Property("SPEC", "Tizen.Applications.RPCPort.Parcel.ReadDouble M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Junghoon Park, jh9216.park@samsung.com")] - public void ReadDouble_RETURN() - { - using (var p = new Parcel()) - { - /* PRECONDITION */ - Assert.IsInstanceOf(p); - Assert.IsNotNull(p, "Parcel shouldn't be null after init."); - p.WriteDouble(1.0); - - /* TEST CODE */ - double b = p.ReadDouble(); - Assert.IsTrue((b == 1.0), "ReadDouble failed"); - } - } - - [Test] - [Category("P1")] - [Description("Read 'string' type value from parcel")] - [Property("SPEC", "Tizen.Applications.RPCPort.Parcel.ReadString M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Junghoon Park, jh9216.park@samsung.com")] - public void ReadString_RETURN() - { - using (var p = new Parcel()) - { - /* PRECONDITION */ - Assert.IsInstanceOf(p); - Assert.IsNotNull(p, "Parcel shouldn't be null after init."); - p.WriteString("test"); - - /* TEST CODE */ - string b = p.ReadString(); - Assert.IsTrue((b == "test"), "ReadString failed"); - } - } - - [Test] - [Category("P1")] - [Description("Read 'bool' type value from parcel")] - [Property("SPEC", "Tizen.Applications.RPCPort.Parcel.ReadBool M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Junghoon Park, jh9216.park@samsung.com")] - public void ReadBool_RETURN() - { - using (var p = new Parcel()) - { - /* PRECONDITION */ - Assert.IsInstanceOf(p); - Assert.IsNotNull(p, "Parcel shouldn't be null after init."); - p.WriteBool(true); - - /* TEST CODE */ - bool b = p.ReadBool(); - Assert.IsTrue(b, "ReadBool failed"); - } - } - - [Test] - [Category("P1")] - [Description("Read 'Bundle' type value from parcel")] - [Property("SPEC", "Tizen.Applications.RPCPort.Parcel.ReadBundle M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Junghoon Park, jh9216.park@samsung.com")] - public void ReadBundle_RETURN() - { - using (var p = new Parcel()) - { - /* PRECONDITION */ - Assert.IsInstanceOf(p); - Assert.IsNotNull(p, "Parcel shouldn't be null after init."); - using (var b = new Bundle()) - { - b.AddItem("key", "value"); - p.WriteBundle(b); - } - - /* TEST CODE */ - using (Bundle b = p.ReadBundle()) - { - Assert.IsNotNull(b, "Bundle shouldn't be null"); - string val = b.GetItem("key"); - Assert.IsTrue(val == "value", "ReadBundle failed"); - } - } - } - - [Test] - [Category("P1")] - [Description("Read array count from parcel")] - [Property("SPEC", "Tizen.Applications.RPCPort.Parcel.ReadArrayCount M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Junghoon Park, jh9216.park@samsung.com")] - public void ReadArrayCount_RETURN() - { - using (var p = new Parcel()) - { - /* PRECONDITION */ - Assert.IsInstanceOf(p); - Assert.IsNotNull(p, "Parcel shouldn't be null after init."); - p.WriteArrayCount(10); - - /* TEST CODE */ - int b = p.ReadArrayCount(); - Assert.IsTrue(b == 10, "ReadArrayCount failed"); - } - } - - [Test] - [Category("P1")] - [Description("Read bytes from parcel")] - [Property("SPEC", "Tizen.Applications.RPCPort.Parcel.Read M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Junghoon Park, jh9216.park@samsung.com")] - public void Read_RETURN() - { - using (var p = new Parcel()) - { - /* PRECONDITION */ - Assert.IsInstanceOf(p); - Assert.IsNotNull(p, "Parcel shouldn't be null after init."); - var bts = new byte[10] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }; - p.Write(bts); - - /* TEST CODE */ - var b = p.Read(10); - for (int i = 0; i < 10; i++) - { - Assert.IsTrue(b[i] == i, "Read failed"); - } - } - } - - [Test] - [Category("P1")] - [Description("Write a byte to parcel")] - [Property("SPEC", "Tizen.Applications.RPCPort.Parcel.WriteByte M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Junghoon Park, jh9216.park@samsung.com")] - public void WriteByte_RETURN() - { - using (var p = new Parcel()) - { - /* PRECONDITION */ - Assert.IsInstanceOf(p); - Assert.IsNotNull(p, "Parcel shouldn't be null after init."); - - /* TEST CODE */ - p.WriteByte(0x33); - byte b = p.ReadByte(); - Assert.IsTrue((b == 0x33), "WriteByte failed"); - } - } - - [Test] - [Category("P1")] - [Description("Write 'short' type value to parcel")] - [Property("SPEC", "Tizen.Applications.RPCPort.Parcel.WriteShort M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Junghoon Park, jh9216.park@samsung.com")] - public void WriteShort_RETURN() - { - using (var p = new Parcel()) - { - /* PRECONDITION */ - Assert.IsInstanceOf(p); - Assert.IsNotNull(p, "Parcel shouldn't be null after init."); - - /* TEST CODE */ - p.WriteShort(100); - short b = p.ReadShort(); - Assert.IsTrue((b == 100), "WriteShort failed"); - } - } - - [Test] - [Category("P1")] - [Description("Write 'int' type value to parcel")] - [Property("SPEC", "Tizen.Applications.RPCPort.Parcel.WriteInt M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Junghoon Park, jh9216.park@samsung.com")] - public void WriteInt_RETURN() - { - using (var p = new Parcel()) - { - /* PRECONDITION */ - Assert.IsInstanceOf(p); - Assert.IsNotNull(p, "Parcel shouldn't be null after init."); - - /* TEST CODE */ - p.WriteInt(100); - int b = p.ReadInt(); - Assert.IsTrue((b == 100), "WriteInt failed"); - } - } - - [Test] - [Category("P1")] - [Description("Write 'long' type value to parcel")] - [Property("SPEC", "Tizen.Applications.RPCPort.Parcel.WriteLong M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Junghoon Park, jh9216.park@samsung.com")] - public void WriteLong_RETURN() - { - using (var p = new Parcel()) - { - /* PRECONDITION */ - Assert.IsInstanceOf(p); - Assert.IsNotNull(p, "Parcel shouldn't be null after init."); - - /* TEST CODE */ - p.WriteLong(100); - long b = p.ReadLong(); - Assert.IsTrue((b == 100), "WriteLong failed"); - } - } - - [Test] - [Category("P1")] - [Description("Write 'float' type value to parcel")] - [Property("SPEC", "Tizen.Applications.RPCPort.Parcel.WriteFloat M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Junghoon Park, jh9216.park@samsung.com")] - public void WriteFloat_RETURN() - { - using (var p = new Parcel()) - { - /* PRECONDITION */ - Assert.IsInstanceOf(p); - Assert.IsNotNull(p, "Parcel shouldn't be null after init."); - - /* TEST CODE */ - p.WriteFloat(1.0f); - float b = p.ReadFloat(); - Assert.IsTrue((b == 1.0f), "WriteFloat failed"); - } - } - - [Test] - [Category("P1")] - [Description("Write 'double' type value to parcel")] - [Property("SPEC", "Tizen.Applications.RPCPort.Parcel.WriteDouble M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Junghoon Park, jh9216.park@samsung.com")] - public void WriteDouble_RETURN() - { - using (var p = new Parcel()) - { - /* PRECONDITION */ - Assert.IsInstanceOf(p); - Assert.IsNotNull(p, "Parcel shouldn't be null after init."); - - /* TEST CODE */ - p.WriteDouble(1.0); - double b = p.ReadDouble(); - Assert.IsTrue((b == 1.0), "WriteDouble failed"); - } - } - - [Test] - [Category("P1")] - [Description("Wrtie 'string' type value to parcel")] - [Property("SPEC", "Tizen.Applications.RPCPort.Parcel.WriteString M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Junghoon Park, jh9216.park@samsung.com")] - public void WriteString_RETURN() - { - using (var p = new Parcel()) - { - /* PRECONDITION */ - Assert.IsInstanceOf(p); - Assert.IsNotNull(p, "Parcel shouldn't be null after init."); - - /* TEST CODE */ - p.WriteString("test"); - string b = p.ReadString(); - Assert.IsTrue((b == "test"), "WriteString failed"); - } - } - - [Test] - [Category("P1")] - [Description("Write 'bool' type value to parcel")] - [Property("SPEC", "Tizen.Applications.RPCPort.Parcel.WriteBool M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Junghoon Park, jh9216.park@samsung.com")] - public void WriteBool_RETURN() - { - using (var p = new Parcel()) - { - /* PRECONDITION */ - Assert.IsInstanceOf(p); - Assert.IsNotNull(p, "Parcel shouldn't be null after init."); - - /* TEST CODE */ - p.WriteBool(true); - bool b = p.ReadBool(); - Assert.IsTrue(b, "WriteBool failed"); - } - } - - [Test] - [Category("P1")] - [Description("Write 'Bundle' type value to parcel")] - [Property("SPEC", "Tizen.Applications.RPCPort.Parcel.WriteBundle M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Junghoon Park, jh9216.park@samsung.com")] - public void WriteBundle_RETURN() - { - using (var p = new Parcel()) - { - /* PRECONDITION */ - Assert.IsInstanceOf(p); - Assert.IsNotNull(p, "Parcel shouldn't be null after init."); - - using (var b = new Bundle()) - { - b.AddItem("key", "value"); - - /* TEST CODE */ - p.WriteBundle(b); - } - - using (Bundle b = p.ReadBundle()) - { - Assert.IsNotNull(b, "Bundle shouldn't be null"); - string val = b.GetItem("key"); - Assert.IsTrue(val == "value", "WriteBundle failed"); - } - } - } - - [Test] - [Category("P1")] - [Description("Write array count from parcel")] - [Property("SPEC", "Tizen.Applications.RPCPort.Parcel.WriteArrayCount M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Junghoon Park, jh9216.park@samsung.com")] - public void WriteArrayCount_RETURN() - { - using (var p = new Parcel()) - { - /* PRECONDITION */ - Assert.IsInstanceOf(p); - Assert.IsNotNull(p, "Parcel shouldn't be null after init."); - - /* TEST CODE */ - p.WriteArrayCount(10); - int b = p.ReadArrayCount(); - Assert.IsTrue(b == 10, "WriteArrayCount failed"); - } - } - - [Test] - [Category("P1")] - [Description("Write bytes to parcel")] - [Property("SPEC", "Tizen.Applications.RPCPort.Parcel.Write M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Junghoon Park, jh9216.park@samsung.com")] - public void Write_RETURN() - { - using (var p = new Parcel()) - { - /* PRECONDITION */ - Assert.IsInstanceOf(p); - Assert.IsNotNull(p, "Parcel shouldn't be null after init."); - var bts = new byte[10] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }; - - /* TEST CODE */ - p.Write(bts); - var b = p.Read(10); - for (int i = 0; i < 10; i++) - { - Assert.IsTrue(b[i] == i, "Write failed"); - } - } - } - } -} diff --git a/tct-suite-vs/Tizen.Applications.Tests/testcase/TSRPCPort.ProxyBase.cs b/tct-suite-vs/Tizen.Applications.Tests/testcase/TSRPCPort.ProxyBase.cs deleted file mode 100755 index 4743dbf29..000000000 --- a/tct-suite-vs/Tizen.Applications.Tests/testcase/TSRPCPort.ProxyBase.cs +++ /dev/null @@ -1,400 +0,0 @@ -using NUnit.Framework; -using NUnit.Framework.TUnit; -using System.Threading.Tasks; -using Tizen.Applications.RPCPort; - -namespace Tizen.Applications.Tests -{ - - [TestFixture] - [Description("Tizen.Application.RPCPort.ProxyBase Tests")] - public class ProxyBaseTests - { - private Proxy _proxy; - - public class Proxy : ProxyBase - { - public bool Connected { get; set; } - public bool Disconnected { get; set; } - public bool Rejected { get; set; } - - public string Result { get; set; } - - private Port _port; - - public void SendHello() - { - using (Parcel p = new Parcel()) - { - p.WriteString("hello"); - p.Send(_port); - } - } - - protected override void OnConnectedEvent(string endPoint, string portName, Port port) - { - Connected = true; - _port = port; - } - - protected override void OnDisconnectedEvent(string endPoint, string portName) - { - Disconnected = true; - } - - protected override void OnReceivedEvent(string endPoint, string portName) - { - using (Parcel p = new Parcel(GetPort(Port.Type.Callback))) - { - Result = p.ReadString(); - } - } - - protected override void OnRejectedEvent(string endPoint, string portName) - { - Rejected = true; - } - - public void TestConnect() - { - Connect("org.tizen.example.RpcPortStub", "Test"); - } - - public void ConnectForInvalidIOException() - { - Connect("invalid.app", "Test"); - } - public void ConnectForRejectedEvent() - { - Connect("org.tizen.example.RpcPortStub2", "Test"); - } - - public void TestGetPort() - { - Port p = GetPort(Port.Type.Main); - Assert.NotNull(p); - - p = GetPort(Port.Type.Callback); - Assert.NotNull(p); - } - - public Port GetPort() - { - return Port; - } - - public Port GetCallbackPort() - { - return CallbackPort; - } - } - - [SetUp] - public void Init() - { - LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Preconditions for each TEST"); - _proxy = new Proxy(); - _proxy.TestConnect(); - } - - [TearDown] - public void Destroy() - { - LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Postconditions for each TEST"); - _proxy?.Dispose(); - _proxy = null; - } - - [Test] - [Category("P1")] - [Description("Test ProxyBase initialization")] - [Property("SPEC", "Tizen.Applications.RPCPort.ProxyBase.ProxyBase C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("AUTHOR", "Junghoon Park, jh9216.park@samsung.com")] - public void ProxyBase_INIT() - { - var p = new Proxy(); - - Assert.IsInstanceOf(p); - Assert.IsNotNull(p, "Proxy shouldn't be null"); - } - - [Test] - [Category("P1")] - [Description("Test : Connect to stub application")] - [Property("SPEC", " Tizen.Applications.RPCPort.ProxyBase.Connect M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Junghoon Park, jh9216.park@samsung.com")] - public async Task Connect_RETURN() - { - /* PRECONDITION */ - await Task.Delay(4000); - - /* TEST CODE */ - Assert.True(_proxy.Connected); - } - - [Test] - [Category("P2")] - [Description("Test : Try to reconnect to app without disposing")] - [Property("SPEC", " Tizen.Applications.RPCPort.ProxyBase.Connect M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MEX")] - [Property("AUTHOR", "Junghoon Park, jh9216.park@samsung.com")] - public async Task Connect_CHECK_INVALID_ID_EXCEPTION() - { - /* PRECONDITION */ - await Task.Delay(4000); - Assert.True(_proxy.Connected); - - try - { - /* TEST CODE */ - _proxy.TestConnect(); - } - catch (InvalidIDException) - { - Assert.Pass(); - } - - Assert.Fail(); - } - - [Test] - [Category("P2")] - [Description("Test : Connect to invalid stub application")] - [Property("SPEC", " Tizen.Applications.RPCPort.ProxyBase.Connect M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MEX")] - [Property("AUTHOR", "Junghoon Park, jh9216.park@samsung.com")] - public void Connect_CHECK_INVALID_IO_EXCEPTION() - { - /* PRECONDITION */ - _proxy?.Dispose(); - _proxy = new Proxy(); - - try - { - /* TEST CODE */ - _proxy.ConnectForInvalidIOException(); - } - catch (InvalidIOException) - { - Assert.Pass(); - } - - Assert.Fail(); - } - - [Test] - [Category("P2")] - [Description("Test : Connect to stub application with invalid permission")] - [Property("SPEC", " Tizen.Applications.RPCPort.ProxyBase.Connect M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MEX")] - [Property("AUTHOR", "Junghoon Park, jh9216.park@samsung.com")] - public async Task Connect_CHECK_PERMISSION_DENIED_EXCEPTION() - { - /* PRECONDITION */ - _proxy?.Dispose(); - _proxy = null; - AppControlReplyResult ret = AppControlReplyResult.Failed; - - var c = new AppControl() - { - ApplicationId = "org.tizen.example.RpcPortProxy2" - }; - - AppControl.SendLaunchRequest(c, (AppControl launchRequest, AppControl replyRequest, AppControlReplyResult result) => - { - ret = result; - }); - await Task.Delay(4000); - - /* TEST CODE */ - Assert.True(ret == AppControlReplyResult.Succeeded); - - /* POSTCONDITION */ - c = new AppControl() - { - ApplicationId = "org.tizen.example.RpcPortProxy2" - }; - - c.ExtraData.Add("Test", "finish"); - AppControl.SendLaunchRequest(c); - await Task.Delay(2000); - } - - [Test] - [Category("P1")] - [Description("Test : OnConnected events")] - [Property("SPEC", " Tizen.Applications.RPCPort.ProxyBase.OnConnectedEvent E")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "EVL")] - [Property("AUTHOR", "Junghoon Park, jh9216.park@samsung.com")] - public async Task OnConnectedEvent_CHECK_CB() - { - /* PRECONDITION */ - await Task.Delay(4000); - - /* TEST CODE */ - Assert.True(_proxy.Connected); - } - - [Test] - [Category("P1")] - [Description("Test : OnDisconnected events")] - [Property("SPEC", " Tizen.Applications.RPCPort.ProxyBase.OnDisconnectedEvent E")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "EVL")] - [Property("AUTHOR", "Junghoon Park, jh9216.park@samsung.com")] - public async Task OnDisconnectedEvent_CHECK_CB() - { - /* PRECONDITION */ - await Task.Delay(4000); - Assert.True(_proxy.Connected); - var c = new AppControl() - { - ApplicationId = "org.tizen.example.RpcPortStub" - }; - c.ExtraData.Add("Test", "finish"); - AppControl.SendLaunchRequest(c); - await Task.Delay(4000); - - /* TEST CODE */ - Assert.True(_proxy.Disconnected); - } - - [Test] - [Category("P1")] - [Description("Test : OnRejected events")] - [Property("SPEC", " Tizen.Applications.RPCPort.ProxyBase.OnRejectedEvent E")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "EVL")] - [Property("AUTHOR", "Junghoon Park, jh9216.park@samsung.com")] - public async Task OnRejectedEvent_CHECK_CB() - { - /* PRECONDITION */ - _proxy?.Dispose(); - _proxy = new Proxy(); - _proxy.ConnectForRejectedEvent(); - await Task.Delay(4000); - - /* TEST CODE */ - Assert.True(_proxy.Rejected); - - /* POSTCONDITION */ - var c = new AppControl() - { - ApplicationId = "org.tizen.example.RpcPortStub2" - }; - c.ExtraData.Add("Test", "finish"); - AppControl.SendLaunchRequest(c); - await Task.Delay(2000); - } - - [Test] - [Category("P1")] - [Description("Test : OnReceived events")] - [Property("SPEC", " Tizen.Applications.RPCPort.ProxyBase.OnReceivedEvent E")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "EVL")] - [Property("AUTHOR", "Junghoon Park, jh9216.park@samsung.com")] - public async Task OnReceivedEvent_CHECK_CB() - { - /* PRECONDITION */ - await Task.Delay(4000); - Assert.True(_proxy.Connected); - _proxy.SendHello(); - await Task.Delay(4000); - - /* TEST CODE */ - Assert.NotNull(_proxy.Result); - Assert.True(_proxy.Result.Equals("hello")); - } - - [Test] - [Category("P2")] - [Description("Test : GetPort from disconnected object")] - [Property("SPEC", " Tizen.Applications.RPCPort.ProxyBase.GetPort M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MEX")] - [Property("AUTHOR", "Junghoon Park, jh9216.park@samsung.com")] - public async Task GetPort_CHECK_EXCEPTION() - { - /* PRECONDITION */ - await Task.Delay(4000); - Assert.True(_proxy.Connected); - _proxy?.Dispose(); - - /* TEST CODE */ - try - { - _proxy.TestGetPort(); - } - catch (InvalidIOException) - { - Assert.Pass(); - } - finally - { - _proxy = null; - } - - Assert.Fail(); - } - - [Test] - [Category("P1")] - [Description("Test : GetPort from proxy object")] - [Property("SPEC", " Tizen.Applications.RPCPort.ProxyBase.GetPort M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Junghoon Park, jh9216.park@samsung.com")] - public async Task GetPort_RETURN() - { - /* PRECONDITION */ - await Task.Delay(4000); - Assert.True(_proxy.Connected); - - /* TEST CODE */ - _proxy.TestGetPort(); - } - - [Test] - [Category("P1")] - [Description("Test : Port Property")] - [Property("SPEC", "Tizen.Applications.RPCPort.ProxyBase.Port A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRO")] - [Property("AUTHOR", "Junghoon Park, jh9216.park@samsung.com")] - public async Task Port_PROPERTY_GET() - { - /* PRECONDITION */ - await Task.Delay(4000); - Assert.True(_proxy.Connected); - - /* TEST CODE */ - Assert.NotNull(_proxy.GetPort()); - } - - [Test] - [Category("P1")] - [Description("Test : CallbackPort Property")] - [Property("SPEC", "Tizen.Applications.RPCPort.ProxyBase.CallbackPort A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRO")] - [Property("AUTHOR", "Junghoon Park, jh9216.park@samsung.com")] - public async Task CallbackPort_PROPERTY_GET() - { - /* PRECONDITION */ - await Task.Delay(4000); - Assert.True(_proxy.Connected); - - /* TEST CODE */ - Assert.NotNull(_proxy.GetCallbackPort()); - } - } -} diff --git a/tct-suite-vs/Tizen.Applications.Tests/testcase/TSRPCPort.StubBase.cs b/tct-suite-vs/Tizen.Applications.Tests/testcase/TSRPCPort.StubBase.cs deleted file mode 100755 index c5a388205..000000000 --- a/tct-suite-vs/Tizen.Applications.Tests/testcase/TSRPCPort.StubBase.cs +++ /dev/null @@ -1,554 +0,0 @@ -using NUnit.Framework; -using NUnit.Framework.TUnit; -using System; -using System.Threading; -using System.Threading.Tasks; -using Tizen.Applications.RPCPort; - -namespace Tizen.Applications.Tests -{ - [TestFixture] - [Description("Tizen.Application.RPCPort.StubBase Tests")] - public class StubBaseTests - { - private Stub _stub; - private static bool _disposed; - - public class Stub : StubBase - { - public bool Connected { get; set; } - public bool Disconnected { get; set; } - public bool Received { get; set; } - public string Instance { get; set; } - - public Stub(string portName) : base(portName) - { - } - - protected override void OnConnectedEvent(string sender, string instance) - { - Connected = true; - Instance = instance; - } - - protected override void OnDisconnectedEvent(string sender, string instance) - { - Disconnected = true; - } - - protected override bool OnReceivedEvent(string sender, string instance, Port port) - { - Received = true; - using (var p = new Parcel(port)) - { - - } - return true; - } - - protected override void OnTerminatedEvent() - { - _disposed = true; - } - - public void TestListen() - { - Listen(); - } - - public void TestGetPort(string inst) - { - Port p = GetPort(Port.Type.Main, inst); - Assert.NotNull(p); - - p = GetPort(Port.Type.Callback, inst); - Assert.NotNull(p); - } - - public void TestAddPrivilege() - { - AddPrivilege("test.privilege"); - } - - public void TestAddPrivilegeWithNull() - { - AddPrivilege(null); - } - - public void TestSetTrusted(bool trusted) - { - SetTrusted(trusted); - } - } - - [SetUp] - public void Init() - { - LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Preconditions for each TEST"); - _stub = new Stub("Test"); - } - - [TearDown] - public void Destroy() - { - LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Postconditions for each TEST"); - _stub?.Dispose(); - _stub = null; - } - - [Test] - [Category("P1")] - [Description("Test StubBase initialization")] - [Property("SPEC", "Tizen.Applications.RPCPort.StubBase.StubBase C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("AUTHOR", "Junghoon Park, jh9216.park@samsung.com")] - public void StubBase_INIT() - { - Assert.IsInstanceOf(_stub); - Assert.IsNotNull(_stub, "Stub shouldn't be null"); - } - - [Test] - [Category("P1")] - [Description("Test : Listen to proxy application")] - [Property("SPEC", " Tizen.Applications.RPCPort.StubBase.Listen M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Junghoon Park, jh9216.park@samsung.com")] - public async Task Listen_CHECK_RETURN() - { - /* PRECONDITION */ - _stub.TestListen(); - var ctrl = new AppControl() - { - ApplicationId = "org.tizen.example.RpcPortProxy" - }; - - AppControl.SendLaunchRequest(ctrl); - - await Task.Delay(4000); - - /* TEST CODE */ - Assert.True(_stub.Connected); - - /* POSTCONDITION */ - var c = new AppControl() - { - ApplicationId = "org.tizen.example.RpcPortProxy" - }; - c.ExtraData.Add("Test", "finish"); - AppControl.SendLaunchRequest(c); - await Task.Delay(2000); - } - - [Test] - [Category("P2")] - [Description("Test : Listen to proxy application after being disposed")] - [Property("SPEC", " Tizen.Applications.RPCPort.StubBase.Listen M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MEX")] - [Property("AUTHOR", "Junghoon Park, jh9216.park@samsung.com")] - public void Listen_CHECK_WITH_EXCEPTION() - { - /* PRECONDITION */ - _stub?.Dispose(); - - try - { - /* TEST CODE */ - _stub.TestListen(); - } - catch (InvalidIOException) - { - Assert.Pass(); - } - finally - { - _stub = null; - } - - Assert.Fail(); - } - - [Test] - [Category("P1")] - [Description("Test : OnConnected events")] - [Property("SPEC", " Tizen.Applications.RPCPort.StubBase.OnConnectedEvent E")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "EVL")] - [Property("AUTHOR", "Junghoon Park, jh9216.park@samsung.com")] - public async Task OnConnectedEvent_CHECK_CB() - { - /* PRECONDITION */ - _stub.TestListen(); - var ctrl = new AppControl() - { - ApplicationId = "org.tizen.example.RpcPortProxy" - }; - - AppControl.SendLaunchRequest(ctrl); - await Task.Delay(4000); - - /* TEST CODE */ - Assert.True(_stub.Connected); - - /* POSTCONDITION */ - var c = new AppControl() - { - ApplicationId = "org.tizen.example.RpcPortProxy" - }; - c.ExtraData.Add("Test", "finish"); - AppControl.SendLaunchRequest(c); - await Task.Delay(2000); - } - - [Test] - [Category("P1")] - [Description("Test : OnDisconnected events")] - [Property("SPEC", " Tizen.Applications.RPCPort.StubBase.OnDisconnectedEvent E")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "EVL")] - [Property("AUTHOR", "Junghoon Park, jh9216.park@samsung.com")] - public async Task OnDisconnectedEvent_CHECK_CB() - { - /* PRECONDITION */ - _stub.TestListen(); - var ctrl = new AppControl() - { - ApplicationId = "org.tizen.example.RpcPortProxy" - }; - - AppControl.SendLaunchRequest(ctrl); - await Task.Delay(4000); - Assert.True(_stub.Connected); - var c = new AppControl() - { - ApplicationId = "org.tizen.example.RpcPortProxy" - }; - c.ExtraData.Add("Test", "finish"); - AppControl.SendLaunchRequest(c); - await Task.Delay(3000); - - /* TEST CODE */ - Assert.True(_stub.Disconnected); - } - - [Test] - [Category("P1")] - [Description("Test : OnReceived events")] - [Property("SPEC", " Tizen.Applications.RPCPort.StubBase.OnReceivedEvent E")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "EVL")] - [Property("AUTHOR", "Junghoon Park, jh9216.park@samsung.com")] - public async Task OnReceivedEvent_CHECK_CB() - { - /* PRECONDITION */ - _stub.TestListen(); - var ctrl = new AppControl() - { - ApplicationId = "org.tizen.example.RpcPortProxy" - }; - ctrl.ExtraData.Add("send", "hello"); - - AppControl.SendLaunchRequest(ctrl); - await Task.Delay(4000); - Assert.True(_stub.Connected); - - /* TEST CODE */ - Assert.True(_stub.Received); - - /* POSTCONDITION */ - var c = new AppControl() - { - ApplicationId = "org.tizen.example.RpcPortProxy" - }; - c.ExtraData.Add("Test", "finish"); - AppControl.SendLaunchRequest(c); - await Task.Delay(3000); - } - - [Test] - [Category("P1")] - [Description("Test : OnTerminated events")] - [Property("SPEC", " Tizen.Applications.RPCPort.StubBase.OnTerminatedEvent E")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "EVL")] - [Property("AUTHOR", "Junghoon Park, jh9216.park@samsung.com")] - public async Task OnTerminatedEvent_CHECK_CB() - { - /* PRECONDITION */ - _stub.TestListen(); - var ctrl = new AppControl() - { - ApplicationId = "org.tizen.example.RpcPortProxy" - }; - - AppControl.SendLaunchRequest(ctrl); - await Task.Delay(4000); - Assert.True(_stub.Connected); - _disposed = false; - - /* TEST CODE */ - _stub.Dispose(); - Assert.True(_disposed); - - /* POSTCONDITION */ - var c = new AppControl() - { - ApplicationId = "org.tizen.example.RpcPortProxy" - }; - c.ExtraData.Add("Test", "finish"); - AppControl.SendLaunchRequest(c); - await Task.Delay(3000); - } - - [Test] - [Category("P1")] - [Description("Test : GetPort from stub object")] - [Property("SPEC", " Tizen.Applications.RPCPort.StubBase.GetPort M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Junghoon Park, jh9216.park@samsung.com")] - public async Task GetPort_RETURN() - { - /* PRECONDITION */ - _stub.TestListen(); - var ctrl = new AppControl() - { - ApplicationId = "org.tizen.example.RpcPortProxy" - }; - - AppControl.SendLaunchRequest(ctrl); - - await Task.Delay(4000); - Assert.True(_stub.Connected); - Assert.NotNull(_stub.Instance); - - /* TEST CODE */ - _stub.TestGetPort(_stub.Instance); - - /* POSTCONDITION */ - var c = new AppControl() - { - ApplicationId = "org.tizen.example.RpcPortProxy" - }; - c.ExtraData.Add("Test", "finish"); - AppControl.SendLaunchRequest(c); - await Task.Delay(2000); - } - - [Test] - [Category("P2")] - [Description("Test : GetPort from wrong instance")] - [Property("SPEC", " Tizen.Applications.RPCPort.StubBase.GetPort M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MEX")] - [Property("AUTHOR", "Junghoon Park, jh9216.park@samsung.com")] - public async Task GetPort_CHECK_INVALID_IO_EXCEPTION() - { - /* PRECONDITION */ - _stub.TestListen(); - var ctrl = new AppControl() - { - ApplicationId = "org.tizen.example.RpcPortProxy" - }; - - AppControl.SendLaunchRequest(ctrl); - await Task.Delay(4000); - - Assert.True(_stub.Connected); - Assert.NotNull(_stub.Instance); - - try - { - /* TEST CODE */ - _stub.TestGetPort("wrong_inst"); - - } - catch (InvalidIOException) - { - Assert.Pass(); - } - finally - { - /* POSTCONDITION */ - var c = new AppControl() - { - ApplicationId = "org.tizen.example.RpcPortProxy" - }; - c.ExtraData.Add("Test", "finish"); - AppControl.SendLaunchRequest(c); - await Task.Delay(2000); - } - - Assert.Fail(); - } - - [Test] - [Category("P2")] - [Description("Test : GetPort from wrong stub object")] - [Property("SPEC", " Tizen.Applications.RPCPort.StubBase.GetPort M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MEX")] - [Property("AUTHOR", "Junghoon Park, jh9216.park@samsung.com")] - public void GetPort_CHECK_INVALID_ID_EXCEPTION() - { - /* PRECONDITION */ - _stub.TestListen(); - _stub.Dispose(); - - try - { - /* TEST CODE */ - _stub.TestGetPort("wrong_instance"); - } - catch (InvalidIDException) - { - Assert.Pass(); - } - finally - { - _stub = null; - } - - Assert.Fail(); - } - - [Test] - [Category("P1")] - [Description("Test : Add privilege to stub object")] - [Property("SPEC", "Tizen.Applications.RPCPort.StubBase.AddPrivilege M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Junghoon Park, jh9216.park@samsung.com")] - public async Task AddPrivilege_RETURN() - { - /* PRECONDITION */ - - /* TEST CODE */ - _stub.TestAddPrivilege(); - _stub.TestListen(); - var ctrl = new AppControl() - { - ApplicationId = "org.tizen.example.RpcPortProxy" - }; - - AppControl.SendLaunchRequest(ctrl); - - await Task.Delay(4000); - Assert.False(_stub.Connected); - - /* POSTCONDITION */ - var c = new AppControl() - { - ApplicationId = "org.tizen.example.RpcPortProxy" - }; - c.ExtraData.Add("Test", "finish"); - AppControl.SendLaunchRequest(c); - await Task.Delay(2000); - } - - [Test] - [Category("P2")] - [Description("Test : Add privilege with null argument")] - [Property("SPEC", "Tizen.Applications.RPCPort.StubBase.AddPrivilege M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MEX")] - [Property("AUTHOR", "Junghoon Park, jh9216.park@samsung.com")] - public void AddPrivilege_CHECK_WITH_EXCEPTION() - { - /* PRECONDITION */ - - /* TEST CODE */ - try - { - _stub.TestAddPrivilegeWithNull(); - } - catch (ArgumentNullException) - { - Assert.Pass(); - } - Assert.Fail(); - } - - [Test] - [Category("P1")] - [Description("Test : Set trusted flag as true")] - [Property("SPEC", "Tizen.Applications.RPCPort.StubBase.SetTrusted M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Junghoon Park, jh9216.park@samsung.com")] - public async Task SetTrusted_RETURN1() - { - /* PRECONDITION */ - - /* TEST CODE */ - _stub.TestSetTrusted(true); - _stub.TestListen(); - var ctrl = new AppControl() - { - ApplicationId = "org.tizen.example.RpcPortProxy" - }; - - AppControl.SendLaunchRequest(ctrl); - await Task.Delay(4000); - Assert.False(_stub.Connected); - - /* POSTCONDITION */ - var c = new AppControl() - { - ApplicationId = "org.tizen.example.RpcPortProxy" - }; - c.ExtraData.Add("Test", "finish"); - AppControl.SendLaunchRequest(c); - await Task.Delay(2000); - } - - [Test] - [Category("P1")] - [Description("Test : Set trusted flag as false")] - [Property("SPEC", "Tizen.Applications.RPCPort.StubBase.SetTrusted M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Junghoon Park, jh9216.park@samsung.com")] - public async Task SetTrusted_RETURN2() - { - /* PRECONDITION */ - - /* TEST CODE */ - _stub.TestSetTrusted(false); - _stub.TestListen(); - var ctrl = new AppControl() - { - ApplicationId = "org.tizen.example.RpcPortProxy" - }; - - AppControl.SendLaunchRequest(ctrl); - await Task.Delay(4000); - Assert.True(_stub.Connected); - - /* POSTCONDITION */ - var c = new AppControl() - { - ApplicationId = "org.tizen.example.RpcPortProxy" - }; - c.ExtraData.Add("Test", "finish"); - AppControl.SendLaunchRequest(c); - await Task.Delay(2000); - } - - [Test] - [Category("P1")] - [Description("Test : PortName Property")] - [Property("SPEC", "Tizen.Applications.RPCPort.StubBase.PortName A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRO")] - [Property("AUTHOR", "Junghoon Park, jh9216.park@samsung.com")] - public void PortName_PROPERTY_GET() - { - Assert.NotNull(_stub.PortName); - Assert.True(_stub.PortName.Equals("Test")); - } - } -} diff --git a/tct-suite-vs/Tizen.Applications.Tests/testcase/TSRemotePort.cs b/tct-suite-vs/Tizen.Applications.Tests/testcase/TSRemotePort.cs deleted file mode 100755 index bf70cb2ac..000000000 --- a/tct-suite-vs/Tizen.Applications.Tests/testcase/TSRemotePort.cs +++ /dev/null @@ -1,197 +0,0 @@ -using NUnit.Framework; -using NUnit.Framework.TUnit; -using Tizen.Applications.Messages; -using System.Threading.Tasks; -using System.Collections.Generic; - -namespace Tizen.Applications.Tests -{ - - [TestFixture] - [Description("RemotePort information Test")] - class RemotePortTests - { - public RemotePort _remotePort; - private MessagePort _messagePort; - public const string remoteAppId = "org.tizen.MsgPortApp.Tizen"; - public const string myRemotePort = "TestRemotePort"; - private Task> _runningApps; - private IEnumerable _list; - private bool _flag; - - [SetUp] - public void Init() - { - LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Preconditions for each TEST"); - } - - [TearDown] - public void Destroy() - { - LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Postconditions for each TEST"); - - _flag = false; - if (_remotePort != null) - { - _remotePort.Dispose(); - } - if (_messagePort != null) - { - _messagePort.Dispose(); - } - if (_runningApps != null) - { - _runningApps = null; - } - } - private void RemotePortStateChangedCallback(object sender, RemotePortStateChangedEventArgs e) - { - _flag = true; - Log.Debug("REMOTEPORT", "@@# RemotePortStateChangedCallback : " + _flag); - } - - [Test] - [Category("P1")] - [Description("RemotePort() constructor")] - [Property("SPEC", "Tizen.Applications.Messages.RemotePort.RemotePort C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("AUTHOR", "Sukhyung Kang, shine.kang@samsung.com")] - public void RemotePort_INIT() - { - Log.Debug("REMOTEPORT", "@@# RemotePort_INIT"); - /* TEST CODE */ - _remotePort = new RemotePort(remoteAppId, myRemotePort, false); - Assert.IsNotNull(_remotePort, "_remotePort object should be not null after initializing"); - Assert.IsInstanceOf(_remotePort, "_remotePort object must be RemotePort instance"); - } - - [Test] - [Category("P1")] - [Description("Gets RemotePort AppId")] - [Property("SPEC", "Tizen.Applications.Messages.RemotePort.AppId A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Sukhyung Kang, shine.kang@samsung.com")] - public void AppId_PROPERTY_GET() - { - Log.Debug("REMOTEPORT", "@@# AppId_PROPERTY_GET"); - /* TEST CODE */ - _remotePort = new RemotePort(remoteAppId, myRemotePort, false); - - Assert.IsInstanceOf(_remotePort.AppId); - Assert.AreEqual(remoteAppId, _remotePort.AppId, "Value of _remotePort.AppId must be matched with remoteAppId"); - } - - [Test] - [Category("P1")] - [Description("RemotePort PortName.")] - [Property("SPEC", "Tizen.Applications.Messages.RemotePort.PortName A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Sukhyung Kang, shine.kang@samsung.com")] - public void PortName_PROPERTY_GET() - { - Log.Debug("REMOTEPORT", "@@# PortName_PROPERTY_GET"); - /* TEST CODE */ - _remotePort = new RemotePort(remoteAppId, myRemotePort, false); - - Assert.IsInstanceOf(_remotePort.PortName); - Assert.AreEqual(myRemotePort, _remotePort.PortName, "Value of _remotePort.PortName must be matched with myRemotePort"); - } - - [Test] - [Category("P1")] - [Description("RemotePort PortName.")] - [Property("SPEC", "Tizen.Applications.Messages.RemotePort.Trusted A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Sukhyung Kang, shine.kang@samsung.com")] - public void Trusted_PROPERTY_GET() - { - Log.Debug("REMOTEPORT", "@@# Trusted_PROPERTY_GET"); - /* TEST CODE */ - _remotePort = new RemotePort(remoteAppId, myRemotePort, false); - - Assert.IsInstanceOf(_remotePort.Trusted); - Assert.IsFalse(_remotePort.Trusted, "Value of _remotePort.PortName must be false"); - } - - [Test] - [Category("P1")] - [Description("RemotePort PortName.")] - [Property("SPEC", "Tizen.Applications.Messages.RemotePort.IsRunning M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Sukhyung Kang, shine.kang@samsung.com")] - public async Task IsRunning_CHECK_VALUE() - { - Log.Debug("REMOTEPORT", "@@# IsRunning_CHECK_VALUE"); - /* TEST CODE */ - bool appIsRunning = false; - bool portIsRunning = false; - - _runningApps = ApplicationManager.GetRunningApplicationsAsync(); - _list = await _runningApps; - foreach (var app in _list) - { - if (app.ApplicationId == remoteAppId) - { - appIsRunning = true; - break; - } - - } - Assert.IsTrue(appIsRunning, remoteAppId + " should be running"); - - _remotePort = new RemotePort(remoteAppId, myRemotePort, false); - - portIsRunning = _remotePort.IsRunning(); - - Assert.IsTrue(portIsRunning, "_remotePort must be running"); - } - - [Test] - [Category("P1")] - [Description("RemotePort RemotePortStateChanged.")] - [Property("SPEC", "Tizen.Applications.Messages.RemotePort.RemotePortStateChanged E")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "EVL")] - [Property("AUTHOR", "Sukhyung Kang, shine.kang@samsung.com")] - public async Task RemotePortStateChanged_EVENT() - { - Log.Debug("REMOTEPORT", "@@# RemotePortStateChanged_EVENT"); - bool isRunning = false; - _flag = false; - string controlRemotePort = "ControlRemotePort"; - - _runningApps = ApplicationManager.GetRunningApplicationsAsync(); - _list = await _runningApps; - foreach (var app in _list) - { - if (app.ApplicationId == remoteAppId) - { - isRunning = true; - break; - } - - } - Assert.IsTrue(isRunning, remoteAppId + " should be running"); - - _remotePort = new RemotePort(remoteAppId, myRemotePort, false); - _remotePort.RemotePortStateChanged += RemotePortStateChangedCallback; - - _messagePort = new MessagePort(controlRemotePort, false); - _messagePort.Listen(); - - var msg = new Bundle(); - Assert.IsNotNull(msg, "Object \"msg\" should not be null after initializing"); - - msg.AddItem("message", "ChangeState"); - _messagePort.Send(msg, remoteAppId, controlRemotePort); - await Task.Delay(5000); - - Assert.IsTrue(_flag, "RemotePortStateChanged callback is not called"); - } - } -} diff --git a/tct-suite-vs/Tizen.Applications.Tests/testcase/TSRemotePortStateChangedEventArgs.cs b/tct-suite-vs/Tizen.Applications.Tests/testcase/TSRemotePortStateChangedEventArgs.cs deleted file mode 100755 index 3a23de3d7..000000000 --- a/tct-suite-vs/Tizen.Applications.Tests/testcase/TSRemotePortStateChangedEventArgs.cs +++ /dev/null @@ -1,123 +0,0 @@ -using NUnit.Framework; -using NUnit.Framework.TUnit; -using Tizen.Applications.Messages; -using System.Threading.Tasks; -using System.Collections.Generic; - -namespace Tizen.Applications.Tests -{ - - [TestFixture] - [Description("RemotePortStateChangedEventArgs Test")] - class RemotePortStateChangedEventArgsTests - { - public RemotePort _remotePort; - private MessagePort _messagePort; - public const string remoteAppId = "org.tizen.MsgPortApp.Tizen"; - public const string myRemotePort = "TestRemotePort"; - private Task> _runningApps; - private IEnumerable _list; - private RemotePortStateChangedEventArgs _changeState; - private bool _flag; - private State _state; - - [SetUp] - public void Init() - { - LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Preconditions for each TEST"); - } - - [TearDown] - public void Destroy() - { - LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Postconditions for each TEST"); - - _flag = false; - if (_remotePort != null) - { - _remotePort.Dispose(); - } - if (_messagePort != null) - { - _messagePort.Dispose(); - } - if (_runningApps != null) - { - _runningApps = null; - } - if (_changeState != null) - { - _changeState = null; - } - } - - [Test] - [Category("P1")] - [Description("RemotePortStateChangedEventArgs() constructor")] - [Property("SPEC", "Tizen.Applications.Messages.RemotePortStateChangedEventArgs.RemotePortStateChangedEventArgs C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("AUTHOR", "Sukhyung Kang, shine.kang@samsung.com")] - public void RemotePortStateChangedEventArgs_INIT() - { - Log.Debug("REMOTEPORT", "@@# RemotePortStateChangedEventArgs_INIT"); - /* TEST CODE */ - _changeState = new RemotePortStateChangedEventArgs(); - Assert.IsNotNull(_changeState, "_changeState object should be not null after initializing"); - Assert.IsInstanceOf(_changeState, "_changeState object must be RemotePortStateChangedEventArgs instance"); - } - - private void RemotePortStateChangedCallback(object sender, RemotePortStateChangedEventArgs e) - { - _flag = true; - _state = e.Status; - Log.Debug("REMOTEPORT", "@@# RemotePortStateChangedCallback : " + _flag); - } - - [Test] - [Category("P1")] - [Description("RemotePortStateChangedEventArgs Status check.")] - [Property("SPEC", "Tizen.Applications.Messages.RemotePortStateChangedEventArgs.Status A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Sukhyung Kang, shine.kang@samsung.com")] - public async Task Status_PROPERTY_GET() - { - Log.Debug("REMOTEPORT", "@@# Status_PROPERTY_GET"); - bool isRunning = false; - _flag = false; - string controlRemotePort = "ControlRemotePort"; - - _runningApps = ApplicationManager.GetRunningApplicationsAsync(); - _list = await _runningApps; - foreach (var app in _list) - { - if (app.ApplicationId == remoteAppId) - { - isRunning = true; - break; - } - - } - Assert.IsTrue(isRunning, remoteAppId + " should be running"); - - _remotePort = new RemotePort(remoteAppId, myRemotePort, false); - _remotePort.RemotePortStateChanged += RemotePortStateChangedCallback; - - _messagePort = new MessagePort(controlRemotePort, false); - _messagePort.Listen(); - - var msg = new Bundle(); - Assert.IsNotNull(msg, "Object \"msg\" should not be null after initializing"); - - msg.AddItem("message", "ChangeState"); - _messagePort.Send(msg, remoteAppId, controlRemotePort); - await Task.Delay(5000); - - Assert.IsTrue(_flag, "RemotePortStateChanged callback is not called"); - Assert.IsNotNull(_state, "RemotePortStateChangedEventArgs must not be null"); - - Log.Debug("REMOTEPORT", "@@# Status_PROPERTY_GET state : " + _state.ToString()); - } - } -} diff --git a/tct-suite-vs/Tizen.Applications.Tests/testcase/TSRemoteValues.cs b/tct-suite-vs/Tizen.Applications.Tests/testcase/TSRemoteValues.cs deleted file mode 100755 index e23c79781..000000000 --- a/tct-suite-vs/Tizen.Applications.Tests/testcase/TSRemoteValues.cs +++ /dev/null @@ -1,97 +0,0 @@ -using NUnit.Framework; -using NUnit.Framework.TUnit; - -namespace Tizen.Applications.Tests -{ - - [TestFixture] - [Description("Test : Remote Values ")] - class RemoteValuesTests - { - public Tizen.Applications.Messages.RemoteValues _remoteValue; - public const string MyRemoteAppId = "org.tizen.myRemoteAppId"; - public const string MyRemotePortName = "myRemotePortName"; - - [SetUp] - public void Init() - { - LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Preconditions for each TEST"); - } - - [TearDown] - public void Destroy() - { - LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Postconditions for each TEST"); - - _remoteValue = null; - } - - [Test] - [Category("P1")] - [Description("RemoteValues() constructor.")] - [Property("SPEC", "Tizen.Applications.Messages.RemoteValues.RemoteValues C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("AUTHOR", "Dao Trong Hieu, tronghieu.d@samsung.com")] - public void RemoteValues_INIT() - { - /* TEST CODE */ - _remoteValue = new Tizen.Applications.Messages.RemoteValues(); - Assert.IsNotNull(_remoteValue, "RemoteValues object should be not null after initializing"); - } - - [Test] - [Category("P1")] - [Description("Test : RemoteValues Properties.")] - [Property("SPEC", "Tizen.Applications.Messages.RemoteValues.AppId A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Nguyen Tien Dung, dung.nt5@samsung.com")] - public void AppId_PROPERTY_SET_GET() - { - /* TEST CODE */ - _remoteValue = new Tizen.Applications.Messages.RemoteValues(); - Assert.IsNotNull(_remoteValue, "RemoteValues object should be not null after initializing"); - - _remoteValue.AppId = MyRemoteAppId; - Assert.IsInstanceOf(_remoteValue.AppId); - Assert.AreEqual(MyRemoteAppId, _remoteValue.AppId, "Propety \"AppId\": the set value and the get value are not equal"); - } - - [Test] - [Category("P1")] - [Description("Test : RemoteValues Properties.")] - [Property("SPEC", "Tizen.Applications.Messages.RemoteValues.PortName A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Nguyen Tien Dung, dung.nt5@samsung.com")] - public void PortName_PROPERTY_SET_GET() - { - /* TEST CODE */ - _remoteValue = new Tizen.Applications.Messages.RemoteValues(); - Assert.IsNotNull(_remoteValue, "RemoteValues object should be not null after initializing"); - - _remoteValue.PortName = MyRemotePortName; - Assert.IsInstanceOf(_remoteValue.PortName); - Assert.AreEqual(MyRemotePortName, _remoteValue.PortName, "Property \"PortName\": the set value and the get value are not equal"); - } - - [Test] - [Category("P1")] - [Description("Test : RemoteValues Properties.")] - [Property("SPEC", "Tizen.Applications.Messages.RemoteValues.Trusted A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Nguyen Tien Dung, dung.nt5@samsung.com")] - public void Trusted_PROPERTY_SET_GET() - { - /* TEST CODE */ - _remoteValue = new Tizen.Applications.Messages.RemoteValues(); - Assert.IsNotNull(_remoteValue, "RemoteValues object should be not null after initializing"); - - _remoteValue.Trusted = false; - Assert.IsInstanceOf(_remoteValue.Trusted); - Assert.IsFalse(_remoteValue.Trusted, "Property \"Trusted\": the set value and the get value are not equal"); - } - } -} diff --git a/tct-suite-vs/Tizen.Applications.Tests/testcase/TSServiceApplication.cs b/tct-suite-vs/Tizen.Applications.Tests/testcase/TSServiceApplication.cs deleted file mode 100755 index 375c07fce..000000000 --- a/tct-suite-vs/Tizen.Applications.Tests/testcase/TSServiceApplication.cs +++ /dev/null @@ -1,37 +0,0 @@ -using NUnit.Framework; -using NUnit.Framework.TUnit; - -namespace Tizen.Applications.Tests -{ - - [TestFixture] - [Description("ServiceApplication init test")] - public class ServiceApplicationTests - { - [SetUp] - public void Init() - { - LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Preconditions for each TEST"); - } - - [TearDown] - public void Destroy() - { - LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Postconditions for each TEST"); - } - - [Test] - [Category("P1")] - [Description("ServiceApplication() constructor.")] - [Property("SPEC", "Tizen.Applications.ServiceApplication.ServiceApplication C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("AUTHOR", "Nguyen Duc Han, duchan.ng.d@samsung.com")] - public void ServiceApplication_INIT() - { - /* TEST CODE */ - Application App = new ServiceApplication(); - Assert.IsNotNull(App, "Application should be not null after init"); - } - } -} diff --git a/tct-suite-vs/Tizen.Applications.UI.Tests/Program.cs b/tct-suite-vs/Tizen.Applications.UI.Tests/Program.cs new file mode 100755 index 000000000..129489a65 --- /dev/null +++ b/tct-suite-vs/Tizen.Applications.UI.Tests/Program.cs @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2018 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 System; +using NUnitLite.TUnit; +using AutoTemplate; + +namespace XamarinForTizen.Tizen +{ + + class Program : global::Xamarin.Forms.Platform.Tizen.FormsApplication + { + private static App _app; + protected override void OnCreate() + { + base.OnCreate(); + + Console.WriteLine("TCT : OnCreate()"); + _app = new App(); + LoadApplication(_app); + + TRunner t = new TRunner(); + t.LoadTestsuite(); + t.Execute(); + } + + public static App getApp() + { + return _app; + } + static void Main(string[] args) + { + Console.WriteLine("TCT : Main()"); + var app = new Program(); + global::Xamarin.Forms.Forms.Init(app); + app.Run(args); + } + } +} diff --git a/tct-suite-vs/Tizen.Applications.UI.Tests/Tizen.Applications.UI.Tests.csproj b/tct-suite-vs/Tizen.Applications.UI.Tests/Tizen.Applications.UI.Tests.csproj new file mode 100755 index 000000000..f837ac3bf --- /dev/null +++ b/tct-suite-vs/Tizen.Applications.UI.Tests/Tizen.Applications.UI.Tests.csproj @@ -0,0 +1,40 @@ + + + + + Exe + tizen80 + Tizen + + + + + true + + + + portable + + + None + + + + + + + + + + + Runtime + + + + + + + + + + diff --git a/tct-suite-vs/Tizen.Applications.UI.Tests/Tizen.Applications.UI.Tests.sln b/tct-suite-vs/Tizen.Applications.UI.Tests/Tizen.Applications.UI.Tests.sln new file mode 100755 index 000000000..1cdbb8834 --- /dev/null +++ b/tct-suite-vs/Tizen.Applications.UI.Tests/Tizen.Applications.UI.Tests.sln @@ -0,0 +1,78 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.30104.148 +MinimumVisualStudioVersion = 15.0.26124.0 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Applications.UI.Tests", "Tizen.Applications.UI.Tests.csproj", "{D92BEEAC-3B2A-45F8-8C53-53B92550404A}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "nunit.framework", "..\nunit.framework\nunit.framework.csproj", "{B9E7C1FD-CB38-42F7-AC43-7BD2E5B4D216}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "nunitlite", "..\nunitlite\nunitlite.csproj", "{FDB8025A-C029-461F-895E-287B4C65939B}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AutoTemplate", "..\Template\AutoTemplate\AutoTemplate.csproj", "{B11ABB0C-C3C1-4B5C-8251-A15628A775F3}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|Any CPU = Release|Any CPU + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {D92BEEAC-3B2A-45F8-8C53-53B92550404A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D92BEEAC-3B2A-45F8-8C53-53B92550404A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D92BEEAC-3B2A-45F8-8C53-53B92550404A}.Debug|x64.ActiveCfg = Debug|Any CPU + {D92BEEAC-3B2A-45F8-8C53-53B92550404A}.Debug|x64.Build.0 = Debug|Any CPU + {D92BEEAC-3B2A-45F8-8C53-53B92550404A}.Debug|x86.ActiveCfg = Debug|Any CPU + {D92BEEAC-3B2A-45F8-8C53-53B92550404A}.Debug|x86.Build.0 = Debug|Any CPU + {D92BEEAC-3B2A-45F8-8C53-53B92550404A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D92BEEAC-3B2A-45F8-8C53-53B92550404A}.Release|Any CPU.Build.0 = Release|Any CPU + {D92BEEAC-3B2A-45F8-8C53-53B92550404A}.Release|x64.ActiveCfg = Release|Any CPU + {D92BEEAC-3B2A-45F8-8C53-53B92550404A}.Release|x64.Build.0 = Release|Any CPU + {D92BEEAC-3B2A-45F8-8C53-53B92550404A}.Release|x86.ActiveCfg = Release|Any CPU + {D92BEEAC-3B2A-45F8-8C53-53B92550404A}.Release|x86.Build.0 = Release|Any CPU + {B9E7C1FD-CB38-42F7-AC43-7BD2E5B4D216}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B9E7C1FD-CB38-42F7-AC43-7BD2E5B4D216}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B9E7C1FD-CB38-42F7-AC43-7BD2E5B4D216}.Debug|x64.ActiveCfg = Debug|Any CPU + {B9E7C1FD-CB38-42F7-AC43-7BD2E5B4D216}.Debug|x64.Build.0 = Debug|Any CPU + {B9E7C1FD-CB38-42F7-AC43-7BD2E5B4D216}.Debug|x86.ActiveCfg = Debug|Any CPU + {B9E7C1FD-CB38-42F7-AC43-7BD2E5B4D216}.Debug|x86.Build.0 = Debug|Any CPU + {B9E7C1FD-CB38-42F7-AC43-7BD2E5B4D216}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B9E7C1FD-CB38-42F7-AC43-7BD2E5B4D216}.Release|Any CPU.Build.0 = Release|Any CPU + {B9E7C1FD-CB38-42F7-AC43-7BD2E5B4D216}.Release|x64.ActiveCfg = Release|Any CPU + {B9E7C1FD-CB38-42F7-AC43-7BD2E5B4D216}.Release|x64.Build.0 = Release|Any CPU + {B9E7C1FD-CB38-42F7-AC43-7BD2E5B4D216}.Release|x86.ActiveCfg = Release|Any CPU + {B9E7C1FD-CB38-42F7-AC43-7BD2E5B4D216}.Release|x86.Build.0 = Release|Any CPU + {FDB8025A-C029-461F-895E-287B4C65939B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FDB8025A-C029-461F-895E-287B4C65939B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FDB8025A-C029-461F-895E-287B4C65939B}.Debug|x64.ActiveCfg = Debug|Any CPU + {FDB8025A-C029-461F-895E-287B4C65939B}.Debug|x64.Build.0 = Debug|Any CPU + {FDB8025A-C029-461F-895E-287B4C65939B}.Debug|x86.ActiveCfg = Debug|Any CPU + {FDB8025A-C029-461F-895E-287B4C65939B}.Debug|x86.Build.0 = Debug|Any CPU + {FDB8025A-C029-461F-895E-287B4C65939B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FDB8025A-C029-461F-895E-287B4C65939B}.Release|Any CPU.Build.0 = Release|Any CPU + {FDB8025A-C029-461F-895E-287B4C65939B}.Release|x64.ActiveCfg = Release|Any CPU + {FDB8025A-C029-461F-895E-287B4C65939B}.Release|x64.Build.0 = Release|Any CPU + {FDB8025A-C029-461F-895E-287B4C65939B}.Release|x86.ActiveCfg = Release|Any CPU + {FDB8025A-C029-461F-895E-287B4C65939B}.Release|x86.Build.0 = Release|Any CPU + {B11ABB0C-C3C1-4B5C-8251-A15628A775F3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B11ABB0C-C3C1-4B5C-8251-A15628A775F3}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B11ABB0C-C3C1-4B5C-8251-A15628A775F3}.Debug|x64.ActiveCfg = Debug|Any CPU + {B11ABB0C-C3C1-4B5C-8251-A15628A775F3}.Debug|x64.Build.0 = Debug|Any CPU + {B11ABB0C-C3C1-4B5C-8251-A15628A775F3}.Debug|x86.ActiveCfg = Debug|Any CPU + {B11ABB0C-C3C1-4B5C-8251-A15628A775F3}.Debug|x86.Build.0 = Debug|Any CPU + {B11ABB0C-C3C1-4B5C-8251-A15628A775F3}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B11ABB0C-C3C1-4B5C-8251-A15628A775F3}.Release|Any CPU.Build.0 = Release|Any CPU + {B11ABB0C-C3C1-4B5C-8251-A15628A775F3}.Release|x64.ActiveCfg = Release|Any CPU + {B11ABB0C-C3C1-4B5C-8251-A15628A775F3}.Release|x64.Build.0 = Release|Any CPU + {B11ABB0C-C3C1-4B5C-8251-A15628A775F3}.Release|x86.ActiveCfg = Release|Any CPU + {B11ABB0C-C3C1-4B5C-8251-A15628A775F3}.Release|x86.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {ED382B91-9930-40B6-B3D7-362304C78680} + EndGlobalSection +EndGlobal diff --git a/tct-suite-vs/Tizen.Applications.UI.Tests/shared/res/Tizen.Applications.UI.Tests.png b/tct-suite-vs/Tizen.Applications.UI.Tests/shared/res/Tizen.Applications.UI.Tests.png new file mode 100755 index 000000000..9765b1bda Binary files /dev/null and b/tct-suite-vs/Tizen.Applications.UI.Tests/shared/res/Tizen.Applications.UI.Tests.png differ diff --git a/tct-suite-vs/Tizen.Applications.UI.Tests/testcase/TSAppControl.cs b/tct-suite-vs/Tizen.Applications.UI.Tests/testcase/TSAppControl.cs new file mode 100755 index 000000000..11a282518 --- /dev/null +++ b/tct-suite-vs/Tizen.Applications.UI.Tests/testcase/TSAppControl.cs @@ -0,0 +1,93 @@ +using NUnit.Framework; +using NUnit.Framework.TUnit; +using System.Collections.Generic; +using System.Threading.Tasks; +using System; + +namespace Tizen.Applications.Tests +{ + + [TestFixture] + [Description("Tizen.Applications.AppControl Test launch other application")] + public class AppControlTests + { + private Task> _runningApps; + private IEnumerable _list; + private const string MyUIAppId = "org.tizen.example.UIApp.Tizen"; + private bool _flag; + + [SetUp] + public void Init() + { + _flag = false; + LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Preconditions for each TEST"); + } + + [TearDown] + public void Destroy() + { + _flag = false; + LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Postconditions for each TEST"); + } + + public async Task waitFlag() + { + int count = 0; + while (true) + { + await Task.Delay(500); + count++; + if (_flag) + break; + if (count == 4) + break; + } + } + + void AppControlReplyReceivedCallback(Tizen.Applications.AppControl launchRequest, Tizen.Applications.AppControl replyRequest, AppControlReplyResult result) + { + if (result >= 0) + _flag = true; + } + + + [Test] + [Category("P1")] + [Description("Test : Send Terminate Request - UI app should be terminated")] + [Property("SPEC", "Tizen.Applications.AppControl.SendTerminateRequest M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Hwankyu Jhun, h.jhun@samsung.com")] + public async Task SendTerminateRequest_TO_A_UI_APP() + { + /* PRECONDITION + * Install org.tizen.example.UIApp.Tizen.tpk + * Privilege: http://tizen.org/privilege/appmanager.launch + * */ + + /* TEST CODE */ + AppControl MyAppControl = new Tizen.Applications.AppControl(true); + Assert.IsNotNull(MyAppControl, "Object should not be null after initializing"); + + MyAppControl.Operation = AppControlOperations.Default; + MyAppControl.ApplicationId = MyUIAppId; + MyAppControl.LaunchMode = AppControlLaunchMode.Group; + + Tizen.Applications.AppControl.SendLaunchRequest(MyAppControl, AppControlReplyReceivedCallback); + await waitFlag(); + Assert.IsTrue(_flag, MyUIAppId + "should be running after launching request has sent"); + + bool IsRunning = false; + Tizen.Applications.AppControl.SendTerminateRequest(MyAppControl); + _runningApps = ApplicationManager.GetRunningApplicationsAsync(); + + _list = await _runningApps; + foreach (var app in _list) + { + if (app.ApplicationId == MyUIAppId) + IsRunning = true; + } + Assert.IsTrue(!IsRunning, MyUIAppId + "should not be running after terminating request has sent"); + } + } +} diff --git a/tct-suite-vs/Tizen.Applications.UI.Tests/testcase/TSCoreUIApplication.cs b/tct-suite-vs/Tizen.Applications.UI.Tests/testcase/TSCoreUIApplication.cs new file mode 100755 index 000000000..ae5c9f5cb --- /dev/null +++ b/tct-suite-vs/Tizen.Applications.UI.Tests/testcase/TSCoreUIApplication.cs @@ -0,0 +1,55 @@ +using NUnit.Framework; +using NUnit.Framework.TUnit; + +namespace Tizen.Applications.Tests +{ + [TestFixture] + [Description("TSCoreUIApplication init test")] + public class CoreUIApplicationTests + { + [SetUp] + public void Init() + { + LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Preconditions for each TEST"); + } + + [TearDown] + public void Destroy() + { + LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Postconditions for each TEST"); + } + + [Test] + [Category("P1")] + [Description("UIApplication() constructor.")] + [Property("SPEC", "Tizen.Applications.CoreUIApplication.CoreUIApplication C")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "CONSTR")] + [Property("AUTHOR", "Nguyen Duc Han, duchan.ng.d@samsung.com")] + public void CoreUIApplication_INIT() + { + /* TEST CODE */ + Application app = new CoreUIApplication(); + Assert.IsNotNull(app, "Application should be not null after init"); + } + + [Test] + [Category("P1")] + [Description("Test : Check whether CurrentDeviceOrientation returns expected value or not")] + [Property("SPEC", "Tizen.Applications.CoreUIApplication.CurrentDeviceOrientation A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PRO")] + [Property("AUTHOR", "Hwankyu Jhun, h.jhun@samsung.com")] + public void CurrentDeviceOrientation_PROPERTY_GET() + { + CoreUIApplication app = new CoreUIApplication(); + var deviceOrientation = app.CurrentDeviceOrientation; + Assert.IsInstanceOf(deviceOrientation); + Assert.IsTrue((deviceOrientation == DeviceOrientation.Orientation_0) || + (deviceOrientation == DeviceOrientation.Orientation_90) || + (deviceOrientation == DeviceOrientation.Orientation_180) || + (deviceOrientation == DeviceOrientation.Orientation_270), + "Property \"CurrentDeviceOrientation\": should be Orientation_0 or Orientation_90 or Orientation_180 or Orientation_270"); + } + } +} diff --git a/tct-suite-vs/Tizen.Applications.UI.Tests/tizen-manifest.xml b/tct-suite-vs/Tizen.Applications.UI.Tests/tizen-manifest.xml new file mode 100755 index 000000000..661608abf --- /dev/null +++ b/tct-suite-vs/Tizen.Applications.UI.Tests/tizen-manifest.xml @@ -0,0 +1,16 @@ + + + + + Tizen.Applications.UI.Tests.png + + + + http://tizen.org/privilege/appmanager.launch + +