5 Copyright (c) 2013 Samsung Electronics Co., Ltd.
7 Licensed under the Apache License, Version 2.0 (the License);
8 you may not use this file except in compliance with the License.
9 You may obtain a copy of the License at
11 http://www.apache.org/licenses/LICENSE-2.0
13 Unless required by applicable law or agreed to in writing, software
14 distributed under the License is distributed on an "AS IS" BASIS,
15 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 See the License for the specific language governing permissions and
17 limitations under the License.
22 Mariusz Polasinski <m.polasinski@samsung.com>
30 <title>SQLDataControlConsumer_remove_successCallback_TypeMismatch</title>
31 <meta charset="utf-8">
32 <script type="text/javascript" src="../resources/unitcommon.js"></script>
33 <script src="support/datacontrol_common.js"></script>
38 <script type="text/javascript">
40 //==== TEST: SQLDataControlConsumer_remove_successCallback_TypeMismatch
41 //==== LABEL check optional argument successCallback (remove method) type conversion
42 //==== ONLOAD_DELAY 30
43 //==== SPEC Tizen Web API:TBD:Datacontrol:SQLDataControlConsumer:remove M
44 //==== SPEC_URL https://developer.tizen.org/help/index.jsp?topic=/org.tizen.web.device.apireference/tizen/datacontrol.html
45 //==== STEP check optional argument successCallback (remove method) type conversion
46 //==== EXPECT an exception must be thrown when the input value cannot be converted into a proper value
47 //==== EXECUTION_TYPE auto
49 //==== TEST_CRITERIA MC
51 setup({timeout: 30000});
53 var this_test = async_test("SQLDataControlConsumer_remove_successCallback_TypeMismatch", {timeout: 30000}), i, globalDataControl,
54 globalReqId = generateGlobalReqId(), currentDate = new Date().getTime().toString(), rowData, insertSuccess,
55 insertError, conversionTable = getTypeConversionExceptions("functionObject", true);
56 this_test.step(function () {
59 columns: ["WORD", "WORD_DESC"],
60 values: ["'" + currentDate + "'", "'" + currentDate + "_desc'"]
63 insertSuccess = this_test.step_func(function (reqId, insertRowId) {
64 for (i = 0; i < conversionTable.length; i++) {
66 assert_throws({name: conversionTable[i][1]}, function () {
67 globalDataControl.remove(globalReqId,
68 rowData.columns[0] + "=" + rowData.values[0], conversionTable[i][0]);
69 }, "exception should be thrown. Given - " + conversionTable[i][0]);
74 insertError = this_test.step_func(function (reqId, error) {
75 assert_unreached("insert() error callback: name:" + error.name + ", msg:" + error.message + " for reqId: " + reqId);
78 globalDataControl = tizen.datacontrol.getDataControlConsumer(PROVIDER_ID, DATA_ID, TYPE_SQL);
79 globalDataControl.insert(globalReqId, rowData, insertSuccess, insertError);