[Applications.Service][Non-ACR][Add new testcases for code coverage] 83/253083/2
authorHwankyu Jhun <h.jhun@samsung.com>
Thu, 4 Feb 2021 08:32:00 +0000 (17:32 +0900)
committerHwankyu Jhun <h.jhun@samsung.com>
Tue, 9 Feb 2021 00:21:45 +0000 (09:21 +0900)
Adds:
 - OnLocaleChanged_CHECK
 - OnRegionFormatChanged_CHECK
 - ServiceApplication_RUN
 - ServiceApplication_EXIT

Change-Id: I6489fe83a19f6d4629d544fb51f01aaacb891e32
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
22 files changed:
tct-suite-vs/Resource/Tizen.Applications.Service.Manual.Tests/code/ServiceApp/ServiceApp.sln [new file with mode: 0755]
tct-suite-vs/Resource/Tizen.Applications.Service.Manual.Tests/code/ServiceApp/ServiceApp/Log.cs [new file with mode: 0755]
tct-suite-vs/Resource/Tizen.Applications.Service.Manual.Tests/code/ServiceApp/ServiceApp/ServiceApp.csproj [new file with mode: 0755]
tct-suite-vs/Resource/Tizen.Applications.Service.Manual.Tests/code/ServiceApp/ServiceApp/ServiceApp_App.cs [new file with mode: 0755]
tct-suite-vs/Resource/Tizen.Applications.Service.Manual.Tests/code/ServiceApp/ServiceApp/shared/res/ServiceApp.png [new file with mode: 0755]
tct-suite-vs/Resource/Tizen.Applications.Service.Manual.Tests/code/ServiceApp/ServiceApp/tizen-manifest.xml [new file with mode: 0755]
tct-suite-vs/Resource/Tizen.Applications.Service.Manual.Tests/org.tizen.example.ServiceApp-1.0.0.tpk [new file with mode: 0755]
tct-suite-vs/Resource/Tizen.Applications.Service.Tests/code/ServiceApp/ServiceApp.sln [new file with mode: 0755]
tct-suite-vs/Resource/Tizen.Applications.Service.Tests/code/ServiceApp/ServiceApp/Log.cs [new file with mode: 0755]
tct-suite-vs/Resource/Tizen.Applications.Service.Tests/code/ServiceApp/ServiceApp/ServiceApp.csproj [new file with mode: 0755]
tct-suite-vs/Resource/Tizen.Applications.Service.Tests/code/ServiceApp/ServiceApp/ServiceApp_App.cs [new file with mode: 0755]
tct-suite-vs/Resource/Tizen.Applications.Service.Tests/code/ServiceApp/ServiceApp/shared/res/ServiceApp.png [new file with mode: 0755]
tct-suite-vs/Resource/Tizen.Applications.Service.Tests/code/ServiceApp/ServiceApp/tizen-manifest.xml [new file with mode: 0755]
tct-suite-vs/Resource/Tizen.Applications.Service.Tests/org.tizen.example.ServiceApp-1.0.0.tpk [new file with mode: 0755]
tct-suite-vs/Tizen.Applications.Service.Manual.Tests/Program.cs [new file with mode: 0755]
tct-suite-vs/Tizen.Applications.Service.Manual.Tests/Tizen.Applications.Service.Manual.Tests.csproj [new file with mode: 0755]
tct-suite-vs/Tizen.Applications.Service.Manual.Tests/Tizen.Applications.Service.Manual.Tests.sln [new file with mode: 0755]
tct-suite-vs/Tizen.Applications.Service.Manual.Tests/shared/res/Tizen.Applications.Service.Manual.Tests.png [new file with mode: 0755]
tct-suite-vs/Tizen.Applications.Service.Manual.Tests/testcase/TSOnLocaleChanged.cs [new file with mode: 0755]
tct-suite-vs/Tizen.Applications.Service.Manual.Tests/testcase/TSOnRegionFormatChanged.cs [new file with mode: 0755]
tct-suite-vs/Tizen.Applications.Service.Manual.Tests/tizen-manifest.xml [new file with mode: 0755]
tct-suite-vs/Tizen.Applications.Service.Tests/testcase/TSServiceApplication.cs

diff --git a/tct-suite-vs/Resource/Tizen.Applications.Service.Manual.Tests/code/ServiceApp/ServiceApp.sln b/tct-suite-vs/Resource/Tizen.Applications.Service.Manual.Tests/code/ServiceApp/ServiceApp.sln
new file mode 100755 (executable)
index 0000000..f8d3987
--- /dev/null
@@ -0,0 +1,25 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 16
+VisualStudioVersion = 16.0.30517.126
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ServiceApp", "ServiceApp\ServiceApp.csproj", "{DA18225E-7535-4428-A153-E1A0ACD58267}"
+EndProject
+Global
+       GlobalSection(SolutionConfigurationPlatforms) = preSolution
+               Debug|Any CPU = Debug|Any CPU
+               Release|Any CPU = Release|Any CPU
+       EndGlobalSection
+       GlobalSection(ProjectConfigurationPlatforms) = postSolution
+               {DA18225E-7535-4428-A153-E1A0ACD58267}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+               {DA18225E-7535-4428-A153-E1A0ACD58267}.Debug|Any CPU.Build.0 = Debug|Any CPU
+               {DA18225E-7535-4428-A153-E1A0ACD58267}.Release|Any CPU.ActiveCfg = Release|Any CPU
+               {DA18225E-7535-4428-A153-E1A0ACD58267}.Release|Any CPU.Build.0 = Release|Any CPU
+       EndGlobalSection
+       GlobalSection(SolutionProperties) = preSolution
+               HideSolutionNode = FALSE
+       EndGlobalSection
+       GlobalSection(ExtensibilityGlobals) = postSolution
+               SolutionGuid = {125DC28B-526F-4FF9-9511-E4ED3581C80F}
+       EndGlobalSection
+EndGlobal
diff --git a/tct-suite-vs/Resource/Tizen.Applications.Service.Manual.Tests/code/ServiceApp/ServiceApp/Log.cs b/tct-suite-vs/Resource/Tizen.Applications.Service.Manual.Tests/code/ServiceApp/ServiceApp/Log.cs
new file mode 100755 (executable)
index 0000000..3b6054e
--- /dev/null
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ *
+ * 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.Runtime.CompilerServices;
+
+namespace ServiceApp
+{
+    public class Log
+    {
+        private static string LogTag = "ServiceApp";
+
+        public static void Info(string message, [CallerFilePath] string file = "", [CallerMemberName] string func = "", [CallerLineNumber] int line = 0)
+        {
+            Tizen.Log.Info(LogTag, message, file, func, line);
+        }
+
+        public static void Error(string message, [CallerFilePath] string file = "", [CallerMemberName] string func = "", [CallerLineNumber] int line = 0)
+        {
+            Tizen.Log.Error(LogTag, message, file, func, line);
+        }
+
+        public static void Warn(string message, [CallerFilePath] string file = "", [CallerMemberName] string func = "", [CallerLineNumber] int line = 0)
+        {
+            Tizen.Log.Warn(LogTag, message, file, func, line);
+        }
+
+        public static void Debug(string message, [CallerFilePath] string file = "", [CallerMemberName] string func = "", [CallerLineNumber] int line = 0)
+        {
+            Tizen.Log.Debug(LogTag, message, file, func, line);
+        }
+    }
+}
diff --git a/tct-suite-vs/Resource/Tizen.Applications.Service.Manual.Tests/code/ServiceApp/ServiceApp/ServiceApp.csproj b/tct-suite-vs/Resource/Tizen.Applications.Service.Manual.Tests/code/ServiceApp/ServiceApp/ServiceApp.csproj
new file mode 100755 (executable)
index 0000000..b9ab780
--- /dev/null
@@ -0,0 +1,21 @@
+<Project Sdk="Tizen.NET.Sdk/1.1.6">
+
+  <PropertyGroup>
+    <OutputType>Exe</OutputType>
+    <TargetFramework>tizen80</TargetFramework>
+      <AssemblyName>ServiceApp</AssemblyName>
+  </PropertyGroup>
+
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <DebugType>portable</DebugType>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <DebugType>None</DebugType>
+  </PropertyGroup>
+
+  <ItemGroup>
+    <Folder Include="lib\"/>
+    <Folder Include="res\"/>
+  </ItemGroup>
+
+</Project>
diff --git a/tct-suite-vs/Resource/Tizen.Applications.Service.Manual.Tests/code/ServiceApp/ServiceApp/ServiceApp_App.cs b/tct-suite-vs/Resource/Tizen.Applications.Service.Manual.Tests/code/ServiceApp/ServiceApp/ServiceApp_App.cs
new file mode 100755 (executable)
index 0000000..d1d6c6f
--- /dev/null
@@ -0,0 +1,133 @@
+/*
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ *
+ * 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 Tizen.Applications;
+using Tizen.Applications.Messages;
+
+namespace ServiceApp
+{
+    class App : ServiceApplication
+    {
+        private MessagePort _messagePort;
+        private string _remoteAppId = string.Empty;
+        private string _remotePortName = string.Empty;
+
+        private void OnMessageReceived(object sender, MessageReceivedEventArgs args)
+        {
+        }
+
+        protected override void OnCreate()
+        {
+            Log.Info("OnCreate()");
+            base.OnCreate();
+
+            _messagePort = new MessagePort("Service.Tests", false);
+            _messagePort.MessageReceived += OnMessageReceived;
+            _messagePort.Listen();
+        }
+
+        protected override void OnAppControlReceived(AppControlReceivedEventArgs e)
+        {
+            Log.Info("OnAppControlReceived()");
+            base.OnAppControlReceived(e);
+
+            if (e.ReceivedAppControl.IsReplyRequest)
+            {
+                Log.Info("Reply requested");
+                AppControl reply = new AppControl();
+                reply.ExtraData.Add("result", "success");
+                e.ReceivedAppControl.ReplyToLaunchRequest(reply, AppControlReplyResult.Succeeded);
+            }
+
+            try
+            {
+                _remoteAppId = e.ReceivedAppControl.ExtraData.Get<string>("RemoteAppId");
+                _remotePortName = e.ReceivedAppControl.ExtraData.Get<string>("RemotePortName");
+
+                var value = e.ReceivedAppControl.ExtraData.Get<string>("key");
+                if (value == "Exit")
+                {
+                    Log.Info("Exit");
+                    Exit();
+                }
+            }
+            catch
+            {
+                Log.Warn("Failed to get extra data");
+            }
+        }
+
+        protected override void OnDeviceOrientationChanged(DeviceOrientationEventArgs e)
+        {
+            Log.Info("OnDeviceOrientationChanged()");
+            base.OnDeviceOrientationChanged(e);
+        }
+
+        protected override void OnLocaleChanged(LocaleChangedEventArgs e)
+        {
+            Log.Info("OnLocaleChanged()");
+            base.OnLocaleChanged(e);
+        }
+
+        protected override void OnLowBattery(LowBatteryEventArgs e)
+        {
+            Log.Info("OnLowBattery()");
+            base.OnLowBattery(e);
+        }
+
+        protected override void OnLowMemory(LowMemoryEventArgs e)
+        {
+            Log.Info("OnLowMemory()");
+            base.OnLowMemory(e);
+        }
+
+        protected override void OnRegionFormatChanged(RegionFormatChangedEventArgs e)
+        {
+            Log.Info("OnRegionFormatChanged()");
+            base.OnRegionFormatChanged(e);
+        }
+
+        protected override void OnTerminate()
+        {
+            Log.Info("OnTerminate()");
+            base.OnTerminate();
+
+            if (!string.IsNullOrEmpty(_remoteAppId))
+            {
+                var remotePort = new RemotePort(_remoteAppId, _remotePortName, false);
+                if (remotePort.IsRunning())
+                {
+                    using (var message = new Bundle())
+                    {
+                        message.AddItem("event", "OnTerminate");
+                        _messagePort.Send(message, _remoteAppId, _remotePortName);
+                    }
+                }
+            }
+
+            _messagePort?.StopListening();
+            _messagePort?.Dispose();
+            _messagePort = null;
+        }
+
+        static void Main(string[] args)
+        {
+            Log.Info("Main()");
+            App app = new App();
+            app.Run(args);
+        }
+    }
+}
diff --git a/tct-suite-vs/Resource/Tizen.Applications.Service.Manual.Tests/code/ServiceApp/ServiceApp/shared/res/ServiceApp.png b/tct-suite-vs/Resource/Tizen.Applications.Service.Manual.Tests/code/ServiceApp/ServiceApp/shared/res/ServiceApp.png
new file mode 100755 (executable)
index 0000000..9f3cb98
Binary files /dev/null and b/tct-suite-vs/Resource/Tizen.Applications.Service.Manual.Tests/code/ServiceApp/ServiceApp/shared/res/ServiceApp.png differ
diff --git a/tct-suite-vs/Resource/Tizen.Applications.Service.Manual.Tests/code/ServiceApp/ServiceApp/tizen-manifest.xml b/tct-suite-vs/Resource/Tizen.Applications.Service.Manual.Tests/code/ServiceApp/ServiceApp/tizen-manifest.xml
new file mode 100755 (executable)
index 0000000..5abe2d6
--- /dev/null
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="utf-8"?>
+<manifest package="org.tizen.example.ServiceApp" version="1.0.0" api-version="9" xmlns="http://tizen.org/ns/packages">
+    <profile name="common" />
+    <service-application appid="org.tizen.example.ServiceApp" exec="ServiceApp.dll" multiple="false" nodisplay="true" taskmanage="false" type="dotnet">
+        <label>ServiceApp</label>
+        <icon>ServiceApp.png</icon>
+        <metadata key="http://tizen.org/metadata/allowedappid" value="Tizen.Applications.Service.Tests|Tizen.Applications.Service.Manual.Tests" />
+        <splash-screens />
+    </service-application>
+    <shortcut-list />
+    <dependencies />
+    <provides-appdefined-privileges />
+</manifest>
diff --git a/tct-suite-vs/Resource/Tizen.Applications.Service.Manual.Tests/org.tizen.example.ServiceApp-1.0.0.tpk b/tct-suite-vs/Resource/Tizen.Applications.Service.Manual.Tests/org.tizen.example.ServiceApp-1.0.0.tpk
new file mode 100755 (executable)
index 0000000..95ff0b8
Binary files /dev/null and b/tct-suite-vs/Resource/Tizen.Applications.Service.Manual.Tests/org.tizen.example.ServiceApp-1.0.0.tpk differ
diff --git a/tct-suite-vs/Resource/Tizen.Applications.Service.Tests/code/ServiceApp/ServiceApp.sln b/tct-suite-vs/Resource/Tizen.Applications.Service.Tests/code/ServiceApp/ServiceApp.sln
new file mode 100755 (executable)
index 0000000..f8d3987
--- /dev/null
@@ -0,0 +1,25 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 16
+VisualStudioVersion = 16.0.30517.126
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ServiceApp", "ServiceApp\ServiceApp.csproj", "{DA18225E-7535-4428-A153-E1A0ACD58267}"
+EndProject
+Global
+       GlobalSection(SolutionConfigurationPlatforms) = preSolution
+               Debug|Any CPU = Debug|Any CPU
+               Release|Any CPU = Release|Any CPU
+       EndGlobalSection
+       GlobalSection(ProjectConfigurationPlatforms) = postSolution
+               {DA18225E-7535-4428-A153-E1A0ACD58267}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+               {DA18225E-7535-4428-A153-E1A0ACD58267}.Debug|Any CPU.Build.0 = Debug|Any CPU
+               {DA18225E-7535-4428-A153-E1A0ACD58267}.Release|Any CPU.ActiveCfg = Release|Any CPU
+               {DA18225E-7535-4428-A153-E1A0ACD58267}.Release|Any CPU.Build.0 = Release|Any CPU
+       EndGlobalSection
+       GlobalSection(SolutionProperties) = preSolution
+               HideSolutionNode = FALSE
+       EndGlobalSection
+       GlobalSection(ExtensibilityGlobals) = postSolution
+               SolutionGuid = {125DC28B-526F-4FF9-9511-E4ED3581C80F}
+       EndGlobalSection
+EndGlobal
diff --git a/tct-suite-vs/Resource/Tizen.Applications.Service.Tests/code/ServiceApp/ServiceApp/Log.cs b/tct-suite-vs/Resource/Tizen.Applications.Service.Tests/code/ServiceApp/ServiceApp/Log.cs
new file mode 100755 (executable)
index 0000000..3b6054e
--- /dev/null
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ *
+ * 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.Runtime.CompilerServices;
+
+namespace ServiceApp
+{
+    public class Log
+    {
+        private static string LogTag = "ServiceApp";
+
+        public static void Info(string message, [CallerFilePath] string file = "", [CallerMemberName] string func = "", [CallerLineNumber] int line = 0)
+        {
+            Tizen.Log.Info(LogTag, message, file, func, line);
+        }
+
+        public static void Error(string message, [CallerFilePath] string file = "", [CallerMemberName] string func = "", [CallerLineNumber] int line = 0)
+        {
+            Tizen.Log.Error(LogTag, message, file, func, line);
+        }
+
+        public static void Warn(string message, [CallerFilePath] string file = "", [CallerMemberName] string func = "", [CallerLineNumber] int line = 0)
+        {
+            Tizen.Log.Warn(LogTag, message, file, func, line);
+        }
+
+        public static void Debug(string message, [CallerFilePath] string file = "", [CallerMemberName] string func = "", [CallerLineNumber] int line = 0)
+        {
+            Tizen.Log.Debug(LogTag, message, file, func, line);
+        }
+    }
+}
diff --git a/tct-suite-vs/Resource/Tizen.Applications.Service.Tests/code/ServiceApp/ServiceApp/ServiceApp.csproj b/tct-suite-vs/Resource/Tizen.Applications.Service.Tests/code/ServiceApp/ServiceApp/ServiceApp.csproj
new file mode 100755 (executable)
index 0000000..b9ab780
--- /dev/null
@@ -0,0 +1,21 @@
+<Project Sdk="Tizen.NET.Sdk/1.1.6">
+
+  <PropertyGroup>
+    <OutputType>Exe</OutputType>
+    <TargetFramework>tizen80</TargetFramework>
+      <AssemblyName>ServiceApp</AssemblyName>
+  </PropertyGroup>
+
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <DebugType>portable</DebugType>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <DebugType>None</DebugType>
+  </PropertyGroup>
+
+  <ItemGroup>
+    <Folder Include="lib\"/>
+    <Folder Include="res\"/>
+  </ItemGroup>
+
+</Project>
diff --git a/tct-suite-vs/Resource/Tizen.Applications.Service.Tests/code/ServiceApp/ServiceApp/ServiceApp_App.cs b/tct-suite-vs/Resource/Tizen.Applications.Service.Tests/code/ServiceApp/ServiceApp/ServiceApp_App.cs
new file mode 100755 (executable)
index 0000000..d1d6c6f
--- /dev/null
@@ -0,0 +1,133 @@
+/*
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ *
+ * 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 Tizen.Applications;
+using Tizen.Applications.Messages;
+
+namespace ServiceApp
+{
+    class App : ServiceApplication
+    {
+        private MessagePort _messagePort;
+        private string _remoteAppId = string.Empty;
+        private string _remotePortName = string.Empty;
+
+        private void OnMessageReceived(object sender, MessageReceivedEventArgs args)
+        {
+        }
+
+        protected override void OnCreate()
+        {
+            Log.Info("OnCreate()");
+            base.OnCreate();
+
+            _messagePort = new MessagePort("Service.Tests", false);
+            _messagePort.MessageReceived += OnMessageReceived;
+            _messagePort.Listen();
+        }
+
+        protected override void OnAppControlReceived(AppControlReceivedEventArgs e)
+        {
+            Log.Info("OnAppControlReceived()");
+            base.OnAppControlReceived(e);
+
+            if (e.ReceivedAppControl.IsReplyRequest)
+            {
+                Log.Info("Reply requested");
+                AppControl reply = new AppControl();
+                reply.ExtraData.Add("result", "success");
+                e.ReceivedAppControl.ReplyToLaunchRequest(reply, AppControlReplyResult.Succeeded);
+            }
+
+            try
+            {
+                _remoteAppId = e.ReceivedAppControl.ExtraData.Get<string>("RemoteAppId");
+                _remotePortName = e.ReceivedAppControl.ExtraData.Get<string>("RemotePortName");
+
+                var value = e.ReceivedAppControl.ExtraData.Get<string>("key");
+                if (value == "Exit")
+                {
+                    Log.Info("Exit");
+                    Exit();
+                }
+            }
+            catch
+            {
+                Log.Warn("Failed to get extra data");
+            }
+        }
+
+        protected override void OnDeviceOrientationChanged(DeviceOrientationEventArgs e)
+        {
+            Log.Info("OnDeviceOrientationChanged()");
+            base.OnDeviceOrientationChanged(e);
+        }
+
+        protected override void OnLocaleChanged(LocaleChangedEventArgs e)
+        {
+            Log.Info("OnLocaleChanged()");
+            base.OnLocaleChanged(e);
+        }
+
+        protected override void OnLowBattery(LowBatteryEventArgs e)
+        {
+            Log.Info("OnLowBattery()");
+            base.OnLowBattery(e);
+        }
+
+        protected override void OnLowMemory(LowMemoryEventArgs e)
+        {
+            Log.Info("OnLowMemory()");
+            base.OnLowMemory(e);
+        }
+
+        protected override void OnRegionFormatChanged(RegionFormatChangedEventArgs e)
+        {
+            Log.Info("OnRegionFormatChanged()");
+            base.OnRegionFormatChanged(e);
+        }
+
+        protected override void OnTerminate()
+        {
+            Log.Info("OnTerminate()");
+            base.OnTerminate();
+
+            if (!string.IsNullOrEmpty(_remoteAppId))
+            {
+                var remotePort = new RemotePort(_remoteAppId, _remotePortName, false);
+                if (remotePort.IsRunning())
+                {
+                    using (var message = new Bundle())
+                    {
+                        message.AddItem("event", "OnTerminate");
+                        _messagePort.Send(message, _remoteAppId, _remotePortName);
+                    }
+                }
+            }
+
+            _messagePort?.StopListening();
+            _messagePort?.Dispose();
+            _messagePort = null;
+        }
+
+        static void Main(string[] args)
+        {
+            Log.Info("Main()");
+            App app = new App();
+            app.Run(args);
+        }
+    }
+}
diff --git a/tct-suite-vs/Resource/Tizen.Applications.Service.Tests/code/ServiceApp/ServiceApp/shared/res/ServiceApp.png b/tct-suite-vs/Resource/Tizen.Applications.Service.Tests/code/ServiceApp/ServiceApp/shared/res/ServiceApp.png
new file mode 100755 (executable)
index 0000000..9f3cb98
Binary files /dev/null and b/tct-suite-vs/Resource/Tizen.Applications.Service.Tests/code/ServiceApp/ServiceApp/shared/res/ServiceApp.png differ
diff --git a/tct-suite-vs/Resource/Tizen.Applications.Service.Tests/code/ServiceApp/ServiceApp/tizen-manifest.xml b/tct-suite-vs/Resource/Tizen.Applications.Service.Tests/code/ServiceApp/ServiceApp/tizen-manifest.xml
new file mode 100755 (executable)
index 0000000..5abe2d6
--- /dev/null
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="utf-8"?>
+<manifest package="org.tizen.example.ServiceApp" version="1.0.0" api-version="9" xmlns="http://tizen.org/ns/packages">
+    <profile name="common" />
+    <service-application appid="org.tizen.example.ServiceApp" exec="ServiceApp.dll" multiple="false" nodisplay="true" taskmanage="false" type="dotnet">
+        <label>ServiceApp</label>
+        <icon>ServiceApp.png</icon>
+        <metadata key="http://tizen.org/metadata/allowedappid" value="Tizen.Applications.Service.Tests|Tizen.Applications.Service.Manual.Tests" />
+        <splash-screens />
+    </service-application>
+    <shortcut-list />
+    <dependencies />
+    <provides-appdefined-privileges />
+</manifest>
diff --git a/tct-suite-vs/Resource/Tizen.Applications.Service.Tests/org.tizen.example.ServiceApp-1.0.0.tpk b/tct-suite-vs/Resource/Tizen.Applications.Service.Tests/org.tizen.example.ServiceApp-1.0.0.tpk
new file mode 100755 (executable)
index 0000000..95ff0b8
Binary files /dev/null and b/tct-suite-vs/Resource/Tizen.Applications.Service.Tests/org.tizen.example.ServiceApp-1.0.0.tpk differ
diff --git a/tct-suite-vs/Tizen.Applications.Service.Manual.Tests/Program.cs b/tct-suite-vs/Tizen.Applications.Service.Manual.Tests/Program.cs
new file mode 100755 (executable)
index 0000000..022aaf2
--- /dev/null
@@ -0,0 +1,49 @@
+/*
+ *  Copyright (c) 2021 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 NUnit.Framework;
+using Xamarin.Forms;
+
+namespace XamarinApplication.Tizen
+{
+    class Program : global::Xamarin.Forms.Platform.Tizen.FormsApplication
+    {
+        private Application _app;
+        protected override void OnCreate()
+        {
+            Console.WriteLine("TCT : OnCreate()");
+            base.OnCreate();
+            if (ManualTest.IsWearable())
+            {
+                _app = new WearableTemplate.MainPage();
+            }
+            else
+            {
+                _app = new ManualTemplate.MainPage();
+            }
+            LoadApplication(_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.Manual.Tests/Tizen.Applications.Service.Manual.Tests.csproj b/tct-suite-vs/Tizen.Applications.Service.Manual.Tests/Tizen.Applications.Service.Manual.Tests.csproj
new file mode 100755 (executable)
index 0000000..c816319
--- /dev/null
@@ -0,0 +1,40 @@
+<Project Sdk="Microsoft.NET.Sdk">
+
+  <!-- Property Group for .NET Core Project -->
+  <PropertyGroup>
+    <OutputType>Exe</OutputType>
+    <TargetFramework>tizen90</TargetFramework>
+    <TargetFrameworkIdentifier>Tizen</TargetFrameworkIdentifier>
+  </PropertyGroup>
+
+  <!-- Property Group for Tizen Project -->
+  <PropertyGroup>
+    <TizenCreateTpkOnBuild>true</TizenCreateTpkOnBuild>
+  </PropertyGroup>
+
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <DebugType>portable</DebugType>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <DebugType>None</DebugType>
+  </PropertyGroup>
+
+  <ItemGroup>
+    <Folder Include="lib\" />
+  </ItemGroup>
+
+  <Import Project="..\Common\dependencies.props" />
+
+  <ItemGroup>
+    <PackageReference Include="Tizen.NET" Version="$(TizenNETVersion)">
+      <ExcludeAssets>Runtime</ExcludeAssets>
+    </PackageReference>
+    <PackageReference Include="Tizen.NET.Sdk" Version="$(TizenNETSdkVersion)" />
+  </ItemGroup>
+
+  <!-- Include Nuget Package for Tizen Project building -->
+  <ItemGroup>
+    <ProjectReference Include="..\Template\ManualTemplate\ManualTemplate.csproj" />
+  </ItemGroup>
+
+</Project>
diff --git a/tct-suite-vs/Tizen.Applications.Service.Manual.Tests/Tizen.Applications.Service.Manual.Tests.sln b/tct-suite-vs/Tizen.Applications.Service.Manual.Tests/Tizen.Applications.Service.Manual.Tests.sln
new file mode 100755 (executable)
index 0000000..ce49038
--- /dev/null
@@ -0,0 +1,92 @@
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 16
+VisualStudioVersion = 16.0.30517.126
+MinimumVisualStudioVersion = 15.0.26124.0
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Applications.Service.Manual.Tests", "Tizen.Applications.Service.Manual.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}") = "ManualTemplate", "..\Template\ManualTemplate\ManualTemplate.csproj", "{269F89A7-E648-4811-8421-844E00ACF5F0}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ManualTemplateForWearable", "..\Template\ManualTemplateForWearable\ManualTemplateForWearable.csproj", "{D36CED01-29BD-4EB3-8903-62E0BF2A822D}"
+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
+               {269F89A7-E648-4811-8421-844E00ACF5F0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+               {269F89A7-E648-4811-8421-844E00ACF5F0}.Debug|Any CPU.Build.0 = Debug|Any CPU
+               {269F89A7-E648-4811-8421-844E00ACF5F0}.Debug|x64.ActiveCfg = Debug|Any CPU
+               {269F89A7-E648-4811-8421-844E00ACF5F0}.Debug|x64.Build.0 = Debug|Any CPU
+               {269F89A7-E648-4811-8421-844E00ACF5F0}.Debug|x86.ActiveCfg = Debug|Any CPU
+               {269F89A7-E648-4811-8421-844E00ACF5F0}.Debug|x86.Build.0 = Debug|Any CPU
+               {269F89A7-E648-4811-8421-844E00ACF5F0}.Release|Any CPU.ActiveCfg = Release|Any CPU
+               {269F89A7-E648-4811-8421-844E00ACF5F0}.Release|Any CPU.Build.0 = Release|Any CPU
+               {269F89A7-E648-4811-8421-844E00ACF5F0}.Release|x64.ActiveCfg = Release|Any CPU
+               {269F89A7-E648-4811-8421-844E00ACF5F0}.Release|x64.Build.0 = Release|Any CPU
+               {269F89A7-E648-4811-8421-844E00ACF5F0}.Release|x86.ActiveCfg = Release|Any CPU
+               {269F89A7-E648-4811-8421-844E00ACF5F0}.Release|x86.Build.0 = Release|Any CPU
+               {D36CED01-29BD-4EB3-8903-62E0BF2A822D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+               {D36CED01-29BD-4EB3-8903-62E0BF2A822D}.Debug|Any CPU.Build.0 = Debug|Any CPU
+               {D36CED01-29BD-4EB3-8903-62E0BF2A822D}.Debug|x64.ActiveCfg = Debug|Any CPU
+               {D36CED01-29BD-4EB3-8903-62E0BF2A822D}.Debug|x64.Build.0 = Debug|Any CPU
+               {D36CED01-29BD-4EB3-8903-62E0BF2A822D}.Debug|x86.ActiveCfg = Debug|Any CPU
+               {D36CED01-29BD-4EB3-8903-62E0BF2A822D}.Debug|x86.Build.0 = Debug|Any CPU
+               {D36CED01-29BD-4EB3-8903-62E0BF2A822D}.Release|Any CPU.ActiveCfg = Release|Any CPU
+               {D36CED01-29BD-4EB3-8903-62E0BF2A822D}.Release|Any CPU.Build.0 = Release|Any CPU
+               {D36CED01-29BD-4EB3-8903-62E0BF2A822D}.Release|x64.ActiveCfg = Release|Any CPU
+               {D36CED01-29BD-4EB3-8903-62E0BF2A822D}.Release|x64.Build.0 = Release|Any CPU
+               {D36CED01-29BD-4EB3-8903-62E0BF2A822D}.Release|x86.ActiveCfg = Release|Any CPU
+               {D36CED01-29BD-4EB3-8903-62E0BF2A822D}.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.Manual.Tests/shared/res/Tizen.Applications.Service.Manual.Tests.png b/tct-suite-vs/Tizen.Applications.Service.Manual.Tests/shared/res/Tizen.Applications.Service.Manual.Tests.png
new file mode 100755 (executable)
index 0000000..9765b1b
Binary files /dev/null and b/tct-suite-vs/Tizen.Applications.Service.Manual.Tests/shared/res/Tizen.Applications.Service.Manual.Tests.png differ
diff --git a/tct-suite-vs/Tizen.Applications.Service.Manual.Tests/testcase/TSOnLocaleChanged.cs b/tct-suite-vs/Tizen.Applications.Service.Manual.Tests/testcase/TSOnLocaleChanged.cs
new file mode 100755 (executable)
index 0000000..d5af2f3
--- /dev/null
@@ -0,0 +1,68 @@
+/*
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ *
+ * 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.Threading.Tasks;
+using System.Diagnostics;
+using NUnit.Framework;
+using NUnit.Framework.TUnit;
+
+namespace Tizen.Applications.Tests
+{
+    [TestFixture]
+    [Description("Tizen.Applications.Service.OnLocaleChanged tests")]
+    public class LocaleChangedTests
+    {
+        [SetUp]
+        public void Init()
+        {
+            Log.Info("TCT", "Preconditions for each TEST");
+        }
+
+        [TearDown]
+        public void Destroy()
+        {
+            Log.Info("TCT", "Postconditions for each TEST");
+        }
+
+        [Test]
+        [Category("P1")]
+        [Description("MANUAL TEST : Test Locale Changed Event")]
+        [Property("SPEC", "Tizen.Applications.Service.OnLocaleChanged E")]
+        [Property("SPEC_URL", "-")]
+        [Property("CRITERIA", "EVL")]
+        [Property("AUTHOR", "Hwankyu Jhun, h.jhun@samsung.com")]
+        [Precondition(1, "Open terminal to view logs.")]
+        [Precondition(2, "Enter command \"sdb dlog -c\" to clear log")]
+        [Precondition(3, "Enter command \"sdb dlog | grep ServiceApp\" to terminal")]
+        [Step(1, "Click run TC")]
+        [Step(2, "[Common] if you cannot change a language in a setting app, this test can not be tested. Please click \"Pass\" button.")]
+        [Step(3, "Press Home hardkey -> Setting app -> select language menu -> Choose other language -> return to app test")]
+        [Step(4, "Check if log show \"OnLocaleChanged\".")]
+        [Postcondition(1, "Close the terminal")]
+        public async Task OnLocaleChanged_CHECK()
+        {
+            /*Preconditions: Launch org.tizen.ApplicationManual.Tizen*/
+            AppControl myAppControl = new AppControl();
+            myAppControl.Operation = AppControlOperations.Default;
+            myAppControl.ApplicationId = "org.tizen.example.ServiceApp";
+            AppControl.SendLaunchRequest(myAppControl);
+            await Task.Delay(1000);
+
+            /* TEST CODE */
+            await ManualTest.WaitForConfirm();
+        }
+    }
+}
diff --git a/tct-suite-vs/Tizen.Applications.Service.Manual.Tests/testcase/TSOnRegionFormatChanged.cs b/tct-suite-vs/Tizen.Applications.Service.Manual.Tests/testcase/TSOnRegionFormatChanged.cs
new file mode 100755 (executable)
index 0000000..d2515be
--- /dev/null
@@ -0,0 +1,72 @@
+/*
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ *
+ * 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.Threading.Tasks;
+using NUnit.Framework;
+using System.Diagnostics;
+using NUnit.Framework.TUnit;
+using Tizen.Applications;
+using Tizen;
+
+namespace Tizen.Applications.Tests
+{
+    [TestFixture]
+    [Description("Tizen.Applications.Service.OnRegionFormatChanged Tests")]
+    class RegionFormatChangedTests
+    {
+
+        [SetUp]
+        public void Init()
+        {
+            Log.Info("TCT", "Preconditions for each TEST");
+        }
+
+        [TearDown]
+        public void Destroy()
+        {
+            Log.Info("TCT", "Postconditions for each TEST");
+        }
+
+        [Test]
+        [Category("P1")]
+        [Description("MANUAL TEST : Test Region Format Changed Event")]
+        [Property("SPEC", "Tizen.Applications.Service.OnRegionFormatChanged E")]
+        [Property("SPEC_URL", "-")]
+        [Property("CRITERIA", "EVL")]
+        [Property("AUTHOR", "Hwankyu Jhun, h.jhun@samsung.com")]
+        [Precondition(1, "Open terminal to view logs.")]
+        [Precondition(2, "Enter command \"sdb dlog -c\" to clear log")]
+        [Precondition(3, "Enter command \"sdb dlog | grep ServiceApp\" to terminal")]
+        [Step(1, "Click run TC")]
+        [Step(2, "[mobile] Press Home hardkey -> Setting app -> \"Language and input\" -> \"Display language\" ->Choose other language -> return to app test")]
+        [Step(3, "[TV profile] Press Home key -> Settings -> System -> \"Location\" -> Choose other language -> Done -> return to app test")]
+        [Step(4, "[TV profile] if there is no \"Location\" menu, this test can not be tested. Please click \"Pass\" button if the \"Location\" menu doesn't exist.")]
+        [Step(5, "[Wearable profile] if there is no \"Location\" menu, this test can not be tested. Please click \"Pass\" button if the \"Location\" menu doesn't exist.")]
+        [Step(6, "Check if log show \"OnRegionFormatChanged()\".")]
+        public async Task OnRegionFormatChanged_CHECK()
+        {
+            /* TEST CODE */
+            AppControl myAppControl = new AppControl();
+            myAppControl.Operation = AppControlOperations.Default;
+            myAppControl.ApplicationId = "org.tizen.example.ServiceApp";
+            AppControl.SendLaunchRequest(myAppControl);
+            await Task.Delay(1000);
+
+            /* TEST CODE */
+            await ManualTest.WaitForConfirm();
+        }
+    }
+}
diff --git a/tct-suite-vs/Tizen.Applications.Service.Manual.Tests/tizen-manifest.xml b/tct-suite-vs/Tizen.Applications.Service.Manual.Tests/tizen-manifest.xml
new file mode 100755 (executable)
index 0000000..df52d3d
--- /dev/null
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns="http://tizen.org/ns/packages" api-version="9" package="Tizen.Applications.Service.Manual.Tests" version="1.0.0">
+    <profile name="common" />
+    <ui-application appid="Tizen.Applications.Service.Manual.Tests"
+                    exec="Tizen.Applications.Service.Manual.Tests.dll"
+                    type="dotnet"
+                    multiple="false"
+                    taskmanage="true"
+                    launch_mode="single">
+    <icon>Tizen.Applications.Service.Manual.Tests.png</icon>
+    <label>Tizen.Applications.Service.Manual.Tests</label>
+    </ui-application>
+    <privileges>
+        <privilege>http://tizen.org/privilege/appmanager.launch</privilege>
+    </privileges>
+</manifest>
index 375c07f..37dff04 100755 (executable)
@@ -1,5 +1,23 @@
+/*
+ *  Copyright (c) 2021 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License
+ */
+
 using NUnit.Framework;
 using NUnit.Framework.TUnit;
+using System.Threading.Tasks;
+using Tizen.Applications.Messages;
 
 namespace Tizen.Applications.Tests
 {
@@ -8,16 +26,46 @@ namespace Tizen.Applications.Tests
     [Description("ServiceApplication init test")]
     public class ServiceApplicationTests
     {
+        private string LogTag = "ServiceApplication.Tests";
+        private MessagePort _messagePort;
+        private string _event = string.Empty;
+
+        private void OnMessageReceived(object sender, MessageReceivedEventArgs args)
+        {
+            Log.Info(LogTag, "START");
+            try
+            {
+                _event = args.Message.GetItem<string>("event");
+            }
+            catch
+            {
+                Log.Error(LogTag, "Failed to get event data");
+            }
+            Log.Info(LogTag, "END");
+        }
+
         [SetUp]
         public void Init()
         {
+            Log.Info(LogTag, "Init()");
             LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Preconditions for each TEST");
+
+            _messagePort = new MessagePort("Service.Tests", false);
+            _messagePort.MessageReceived += OnMessageReceived;
+            _messagePort.Listen();
+
+            _event = string.Empty;
         }
 
         [TearDown]
         public void Destroy()
         {
+            Log.Info(LogTag, "Destroy()");
             LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Postconditions for each TEST");
+
+            _messagePort?.StopListening();
+            _messagePort.Dispose();
+            _messagePort = null;
         }
 
         [Test]
@@ -33,5 +81,57 @@ namespace Tizen.Applications.Tests
             Application App = new ServiceApplication();
             Assert.IsNotNull(App, "Application should be not null  after init");
         }
+
+        [Test]
+        [Category("P1")]
+        [Description("Test: Runs the service application's main loop")]
+        [Property("SPEC", "Tizen.Applications.ServiceApplication.ServiceApplication.Run M")]
+        [Property("SPEC_URL", "-")]
+        [Property("CRITERIA", "MR")]
+        [Property("AUTHOR", "Hwankyu Jhun, h.jhun@samsung.com")]
+        public async Task ServiceApplication_RUN()
+        {
+            AppControlReplyResult result = AppControlReplyResult.Failed;
+            var appControl = new AppControl()
+            {
+                ApplicationId = "org.tizen.example.ServiceApp"
+            };
+
+            AppControl.SendLaunchRequest(appControl, (AppControl launchRequest, AppControl replyRequest, AppControlReplyResult replyResult) =>
+            {
+                result = replyResult;
+            });
+            await Task.Delay(5000);
+
+            Assert.True(result == AppControlReplyResult.Succeeded);
+        }
+
+        [Test]
+        [Category("P1")]
+        [Description("Test: Exits the service application's main loop")]
+        [Property("SPEC", "Tizen.Applications.ServiceApplication.ServiceApplication.Exit M")]
+        [Property("SPEC_URL", "-")]
+        [Property("CRITERIA", "MR")]
+        [Property("AUTHOR", "Hwankyu Jhun, h.jhun@samsung.com")]
+        public async Task ServiceApplication_EXIT()
+        {
+            AppControlReplyResult result = AppControlReplyResult.Failed;
+            var appControl = new AppControl()
+            {
+                ApplicationId = "org.tizen.example.ServiceApp"
+            };
+
+            appControl.ExtraData.Add("RemoteAppId", Application.Current.Name);
+            appControl.ExtraData.Add("RemotePortName", "Service.Tests");
+            appControl.ExtraData.Add("key", "Exit");
+            AppControl.SendLaunchRequest(appControl, (AppControl launchRequest, AppControl replyRequest, AppControlReplyResult replyResult) =>
+            {
+                result = replyResult;
+            });
+            await Task.Delay(5000);
+
+            Assert.True(result == AppControlReplyResult.Succeeded);
+            Assert.AreEqual(_event, "OnTerminate", "event should be 'OnTerminate'");
+        }
     }
 }