[common][tct-datacontrol-tizen-tests][DPTTIZEN-2940 Add TC due to spec change] 21/163321/1
authorxy.qian <xy.qian@samsung.com>
Fri, 8 Dec 2017 12:13:26 +0000 (20:13 +0800)
committerxy.qian <xy.qian@samsung.com>
Fri, 8 Dec 2017 12:13:26 +0000 (20:13 +0800)
Change-Id: Icad90ab994f87d84a824d8bc5722ff7892b636f3
Signed-off-by: xy.qian <xy.qian@samsung.com>
common/tct-datacontrol-tizen-tests/datacontrol/DataControlConsumerObject_addChangeListener_ServiceNotAvailableError.html [new file with mode: 0644]
common/tct-datacontrol-tizen-tests/tests.full.xml
common/tct-datacontrol-tizen-tests/tests.xml

diff --git a/common/tct-datacontrol-tizen-tests/datacontrol/DataControlConsumerObject_addChangeListener_ServiceNotAvailableError.html b/common/tct-datacontrol-tizen-tests/datacontrol/DataControlConsumerObject_addChangeListener_ServiceNotAvailableError.html
new file mode 100644 (file)
index 0000000..6c20349
--- /dev/null
@@ -0,0 +1,68 @@
+<!DOCTYPE html>
+<!--
+Copyright (c) 2017 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.
+
+
+Authors:
+        Xiaoyan Qian <xy.qian@samsung.com>
+
+
+-->
+
+<html>
+
+<head>
+<title>DataControlConsumerObject_addChangeListener_ServiceNotAvailableError</title>
+<meta charset="utf-8">
+<script src="support/unitcommon.js"></script>
+<script src="support/datacontrol_common.js"></script>
+</head>
+<body>
+<div id="log"></div>
+<script>
+
+//==== TEST: DataControlConsumerObject_addChangeListener_ServiceNotAvailableError
+//==== LABEL Check if addChangeListener method throws exception when the application could not connect with the provider
+//==== ONLOAD_DELAY 30
+//==== SPEC Tizen Web API:Application:Datacontrol:DataControlConsumerObject:addChangeListener M
+//==== SPEC_URL TBD
+//==== PRIORITY P2
+//==== TEST_CRITERIA MC
+
+setup({timeout: 30000});
+
+var t = async_test(document.title, {timeout: 30000}), globalDataControl, errorCallback, invalidCallback, exceptionName = "ServiceNotAvailableError";
+
+t.step(function () {
+    errorCallback = t.step_func(function (error) {
+        assert_unreached("addChangeListener() error callback: name:" + error.name + ", msg:" + error.message);
+    });
+
+    successCallback = t.step_func(function () {
+        assert_unreached("addChangeListener() success callback should not be invoked" );
+    });
+
+    globalDataControl = tizen.datacontrol.getDataControlConsumer("notExistingProvider", DATA_ID, TYPE_SQL);
+
+    assert_throws({name: exceptionName}, function () {
+        globalDataControl.addChangeListener(successCallback, errorCallback);
+    }, "exception should be thrown");
+
+    t.done();
+});
+
+</script>
+</body>
+</html>
\ No newline at end of file
index b5afd436438c64c719c505057e61eea7ea9be7ed..76ed657a358a297059ee1d9f2f4d73d8eac11801 100755 (executable)
           </spec>
         </specs>
       </testcase>
+      <testcase purpose="Check if addChangeListener method throws exception when the application could not connect with the provider" type="compliance" status="approved" component="Tizen Device APIs/TBD/Datacontrol" execution_type="auto" priority="P2" id="DataControlConsumerObject_addChangeListener_ServiceNotAvailableError">
+        <description>
+          <test_script_entry>/opt/tct-datacontrol-tizen-tests/datacontrol/DataControlConsumerObject_addChangeListener_ServiceNotAvailableError.html</test_script_entry>
+        </description>
+        <specs>
+          <spec>
+            <spec_assertion interface="DataControlConsumerObject" element_type="method" element_name="addChangeListener" specification="Datacontrol" section="TBD" category="Tizen Device API Specifications"/>
+            <spec_url>https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/datacontrol.html</spec_url>
+            <spec_statement>TBD</spec_statement>
+          </spec>
+        </specs>
+      </testcase>
       <testcase purpose="Check DataControlConsumerObject addChangeListener method with errorCallback" type="compliance" onload_delay="30" status="approved" component="Tizen Device APIs/TBD/Datacontrol" execution_type="auto" priority="P1" id="DataControlConsumerObject_addChangeListener_with_errorCallback">
         <description>
           <test_script_entry>/opt/tct-datacontrol-tizen-tests/datacontrol/DataControlConsumerObject_addChangeListener_with_errorCallback.html</test_script_entry>
index 977693610b57e28a314631129f7f14e16d591f27..ab2f2d88b14ace44f359d993f0b10a881c049b7e 100755 (executable)
           <test_script_entry>/opt/tct-datacontrol-tizen-tests/datacontrol/DataControlConsumerObject_addChangeListener_misarg.html</test_script_entry>
         </description>
       </testcase>
+      <testcase purpose="Check if addChangeListener method throws exception when the application could not connect with the provider" component="Tizen Device APIs/TBD/Datacontrol" execution_type="auto" priority="P2" id="DataControlConsumerObject_addChangeListener_ServiceNotAvailableError">
+        <description>
+          <test_script_entry>/opt/tct-datacontrol-tizen-tests/datacontrol/DataControlConsumerObject_addChangeListener_ServiceNotAvailableError.html</test_script_entry>
+        </description>
+      </testcase>
       <testcase purpose="Check DataControlConsumerObject addChangeListener method with errorCallback" onload_delay="30" component="Tizen Device APIs/TBD/Datacontrol" execution_type="auto" priority="P1" id="DataControlConsumerObject_addChangeListener_with_errorCallback">
         <description>
           <test_script_entry>/opt/tct-datacontrol-tizen-tests/datacontrol/DataControlConsumerObject_addChangeListener_with_errorCallback.html</test_script_entry>