[Alarm] Removed try/finally blocks
authorJunghyuk Park <junghyuk.park@samsung.com>
Fri, 4 Oct 2013 07:25:39 +0000 (16:25 +0900)
committerGerrit Code Review <gerrit@gerrit.vlan144.tizendev.org>
Fri, 4 Oct 2013 11:48:17 +0000 (11:48 +0000)
Change-Id: I813d027492d96123ddf2b5efa24114e9bf835941

28 files changed:
tct-alarm-tizen-tests/alarm/AlarmAbsolute_getNextScheduledDate.html [changed mode: 0644->0755]
tct-alarm-tizen-tests/alarm/AlarmAbsolute_getNextScheduledDate_extra_argument.html [changed mode: 0644->0755]
tct-alarm-tizen-tests/alarm/AlarmAbsolute_getNextScheduledDate_return_null.html [changed mode: 0644->0755]
tct-alarm-tizen-tests/alarm/AlarmManager_add_absolute_alarm.html [changed mode: 0644->0755]
tct-alarm-tizen-tests/alarm/AlarmManager_add_absolute_alarm_with_appControl.html [changed mode: 0644->0755]
tct-alarm-tizen-tests/alarm/AlarmManager_add_alarm_TypeMismatch.html [changed mode: 0644->0755]
tct-alarm-tizen-tests/alarm/AlarmManager_add_appControl_TypeMismatch.html [changed mode: 0644->0755]
tct-alarm-tizen-tests/alarm/AlarmManager_add_appControl_invalid.html [changed mode: 0644->0755]
tct-alarm-tizen-tests/alarm/AlarmManager_add_appControl_invalid_obj.html [changed mode: 0644->0755]
tct-alarm-tizen-tests/alarm/AlarmManager_add_missarg.html [changed mode: 0644->0755]
tct-alarm-tizen-tests/alarm/AlarmManager_add_relative_alarm.html [changed mode: 0644->0755]
tct-alarm-tizen-tests/alarm/AlarmManager_add_relative_alarm_with_appControl.html [changed mode: 0644->0755]
tct-alarm-tizen-tests/alarm/AlarmManager_get.html [changed mode: 0644->0755]
tct-alarm-tizen-tests/alarm/AlarmManager_getAll.html [changed mode: 0644->0755]
tct-alarm-tizen-tests/alarm/AlarmManager_getAll_extra_argument.html [changed mode: 0644->0755]
tct-alarm-tizen-tests/alarm/AlarmManager_get_AlarmRelative.html [changed mode: 0644->0755]
tct-alarm-tizen-tests/alarm/AlarmManager_removeAll.html [changed mode: 0644->0755]
tct-alarm-tizen-tests/alarm/AlarmManager_removeAll_extra_argument.html [changed mode: 0644->0755]
tct-alarm-tizen-tests/alarm/AlarmManager_remove_absolute_alarm.html [changed mode: 0644->0755]
tct-alarm-tizen-tests/alarm/AlarmManager_remove_relative_alarm.html [changed mode: 0644->0755]
tct-alarm-tizen-tests/alarm/AlarmRelative_getRemainingSeconds.html [changed mode: 0644->0755]
tct-alarm-tizen-tests/alarm/AlarmRelative_getRemainingSeconds_extra_argument.html [changed mode: 0644->0755]
tct-alarm-tizen-tests/alarm/AlarmRelative_getRemainingSeconds_return_null.html [changed mode: 0644->0755]
tct-alarm-tizen-tests/alarm/Alarm_id_attribute_absolute_alarm.html [changed mode: 0644->0755]
tct-alarm-tizen-tests/alarm/Alarm_id_attribute_relative_alarm.html [changed mode: 0644->0755]
tct-alarm-tizen-tests/alarm/support/UnitTest-AlarmTest1/config.xml [changed mode: 0644->0755]
tct-alarm-tizen-tests/tests.full.xml [changed mode: 0644->0755]
tct-alarm-tizen-tests/tests.xml [changed mode: 0644->0755]

old mode 100644 (file)
new mode 100755 (executable)
index 9988133..01af545
@@ -44,21 +44,24 @@ Authors:
 //==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/alarm.html
 //==== PRIORITY P1
 //==== TEST_CRITERIA MNA MR
-
 test(function () {
-    try {
-        var alarm, nextScheduledDate, myDate = new Date();
-        myDate.setFullYear(myDate.getFullYear() + 1);
-        myDate.setMilliseconds(0);
-        alarm = new tizen.AlarmAbsolute(myDate);
-        tizen.alarm.add(alarm, APPLICATION_ID);
-        nextScheduledDate = alarm.getNextScheduledDate();
-        assert_type(nextScheduledDate, "date", "type of the returned value is not a date");
-        assert_equals(nextScheduledDate.getTime(), myDate.getTime(), "the returned date is not the same which was added");
-        assert_equals(nextScheduledDate.getTime(), alarm.date.getTime(), "the returned date is not the same which is in the object");
-    } finally {
-        tizen.alarm.removeAll();
-    }
+    add_result_callback(function () {
+        try {
+            tizen.alarm.removeAll();
+        } catch (err) {
+            // do nothing in case removeAll throw an exception
+        }
+    });
+
+    var alarm, nextScheduledDate, myDate = new Date();
+    myDate.setFullYear(myDate.getFullYear() + 1);
+    myDate.setMilliseconds(0);
+    alarm = new tizen.AlarmAbsolute(myDate);
+    tizen.alarm.add(alarm, APPLICATION_ID);
+    nextScheduledDate = alarm.getNextScheduledDate();
+    assert_type(nextScheduledDate, "date", "type of the returned value is not a date");
+    assert_equals(nextScheduledDate.getTime(), myDate.getTime(), "the returned date is not the same which was added");
+    assert_equals(nextScheduledDate.getTime(), alarm.date.getTime(), "the returned date is not the same which is in the object");
 }, "AlarmAbsolute_getNextScheduledDate");
 
 </script>
old mode 100644 (file)
new mode 100755 (executable)
index a386125..a85da46
@@ -46,16 +46,20 @@ Authors:
 //==== TEST_CRITERIA MR MNAEX
 
 test(function () {
-    try {
-        var alarm, myDate = new Date();
-        myDate.setFullYear(myDate.getFullYear() + 1);
-        myDate.setMilliseconds(0);
-        alarm = new tizen.AlarmAbsolute(myDate);
-        tizen.alarm.add(alarm, APPLICATION_ID);
-        checkExtraArgument(alarm, "getNextScheduledDate");
-    } finally {
-        tizen.alarm.removeAll();
-    }
+    add_result_callback(function () {
+        try {
+            tizen.alarm.removeAll();
+        } catch (err) {
+            // do nothing in case removeAll throw an exception
+        }
+    });
+
+    var alarm, myDate = new Date();
+    myDate.setFullYear(myDate.getFullYear() + 1);
+    myDate.setMilliseconds(0);
+    alarm = new tizen.AlarmAbsolute(myDate);
+    tizen.alarm.add(alarm, APPLICATION_ID);
+    checkExtraArgument(alarm, "getNextScheduledDate");
 }, "AlarmAbsolute_getNextScheduledDate_extra_argument");
 
 </script>
old mode 100644 (file)
new mode 100755 (executable)
index c21e1f7..0d253ca
@@ -46,16 +46,20 @@ Authors:
 //==== TEST_CRITERIA MNA MR
 
 test(function () {
-    try {
-        var alarm, nextScheduledDate, myDate = new Date();
-        myDate.setFullYear(myDate.getFullYear() - 1);
-        alarm = new tizen.AlarmAbsolute(myDate);
-        tizen.alarm.add(alarm, APPLICATION_ID);
-        nextScheduledDate = alarm.getNextScheduledDate();
-        assert_equals(nextScheduledDate, null, "nextScheduledDate do not returns null");
-    } finally {
-        tizen.alarm.removeAll();
-    }
+    add_result_callback(function () {
+        try {
+            tizen.alarm.removeAll();
+        } catch (err) {
+            // do nothing in case removeAll throw an exception
+        }
+    });
+
+    var alarm, nextScheduledDate, myDate = new Date();
+    myDate.setFullYear(myDate.getFullYear() - 1);
+    alarm = new tizen.AlarmAbsolute(myDate);
+    tizen.alarm.add(alarm, APPLICATION_ID);
+    nextScheduledDate = alarm.getNextScheduledDate();
+    assert_equals(nextScheduledDate, null, "nextScheduledDate do not returns null");
 }, "AlarmAbsolute_getNextScheduledDate_return_null");
 
 </script>
old mode 100644 (file)
new mode 100755 (executable)
index f38a45a..157e82a
@@ -54,17 +54,21 @@ Authors:
 //==== TEST_CRITERIA MAST MMINA MR
 
 test(function () {
-    try {
-        var alarm1, alarm2, retVal;
-        alarm1 = createAbsAlarm();
-        retVal = tizen.alarm.add(alarm1, APPLICATION_ID);
-        assert_type(retVal, "undefined", "method returned value");
-        assert_not_equals(alarm1.id, null, "object was not added properly");
-        alarm2 = tizen.alarm.get(alarm1.id);
-        assert_equals(alarm1.id, alarm2.id, "the object is not the same which was added");
-    } finally {
-        cleanAlarms();
-    }
+    add_result_callback(function () {
+        try {
+            tizen.alarm.removeAll();
+        } catch (err) {
+            // do nothing in case removeAll throw an exception
+        }
+    });
+
+    var alarm1, alarm2, retVal;
+    alarm1 = createAbsAlarm();
+    retVal = tizen.alarm.add(alarm1, APPLICATION_ID);
+    assert_type(retVal, "undefined", "method returned value");
+    assert_not_equals(alarm1.id, null, "object was not added properly");
+    alarm2 = tizen.alarm.get(alarm1.id);
+    assert_equals(alarm1.id, alarm2.id, "the object is not the same which was added");
 }, "AlarmManager_add_absolute_alarm");
 // add alarm success
 
old mode 100644 (file)
new mode 100755 (executable)
index c546a81..7db039b
@@ -45,18 +45,22 @@ Authors:
 //==== TEST_CRITERIA MOA MR MAST
 
 test(function () {
-    try {
-        var alarm1, alarm2, appControl, returnVal;
-        alarm1 = createAbsAlarm();
-        appControl = new tizen.ApplicationControl("http://tizen.org/appcontrol/operation/view", "http://www.tizen.org");
-        returnVal = tizen.alarm.add(alarm1, APPLICATION_ID, appControl);
-        assert_type(returnVal, "undefined", "method returned value");
-        assert_not_equals(alarm1.id, null, "object was not added properly");
-        alarm2 = tizen.alarm.get(alarm1.id);
-        assert_equals(alarm1.id, alarm2.id, "the object is not the same which was added");
-    } finally {
-        cleanAlarms();
-    }
+    add_result_callback(function () {
+        try {
+            tizen.alarm.removeAll();
+        } catch (err) {
+            // do nothing in case removeAll throw an exception
+        }
+    });
+
+    var alarm1, alarm2, appControl, returnVal;
+    alarm1 = createAbsAlarm();
+    appControl = new tizen.ApplicationControl("http://tizen.org/appcontrol/operation/view", "http://www.tizen.org");
+    returnVal = tizen.alarm.add(alarm1, APPLICATION_ID, appControl);
+    assert_type(returnVal, "undefined", "method returned value");
+    assert_not_equals(alarm1.id, null, "object was not added properly");
+    alarm2 = tizen.alarm.get(alarm1.id);
+    assert_equals(alarm1.id, alarm2.id, "the object is not the same which was added");
 }, "AlarmManager_add_absolute_alarm_with_appControl");
 
 </script>
old mode 100644 (file)
new mode 100755 (executable)
index 6dc862c..eceb05f
@@ -43,15 +43,19 @@ Authors:
 //==== TEST_CRITERIA MC
 
 test(function () {
-    try {
-        var i, conversionTable = getTypeConversionExceptions("object");
-        for (i = 0; i < conversionTable.length; i++) {
-            assert_throws({name: conversionTable[i][1]}, function () {
-                tizen.alarm.add(conversionTable[i][0], APPLICATION_ID);
-            }, "exception should was thrown");
+    add_result_callback(function () {
+        try {
+            tizen.alarm.removeAll();
+        } catch (err) {
+            // do nothing in case removeAll throw an exception
         }
-    } finally {
-        tizen.alarm.removeAll();
+    });
+
+    var i, conversionTable = getTypeConversionExceptions("object");
+    for (i = 0; i < conversionTable.length; i++) {
+        assert_throws({name: conversionTable[i][1]}, function () {
+            tizen.alarm.add(conversionTable[i][0], APPLICATION_ID);
+        }, "exception should was thrown");
     }
 }, "AlarmManager_add_alarm_TypeMismatch");
 
old mode 100644 (file)
new mode 100755 (executable)
index f588407..c55014d
@@ -45,16 +45,20 @@ Authors:
 //==== TEST_CRITERIA MC
 
 test(function () {
-    try {
-        var i, conversionTable = getTypeConversionExceptions("object", true),
-            alarm = createAbsAlarm();
-        for (i = 0; i < conversionTable.length; i++) {
-            assert_throws({name: conversionTable[i][1]}, function () {
-                tizen.alarm.add(alarm, APPLICATION_ID, conversionTable[i][0]);
-            }, "exception should was thrown");
+    add_result_callback(function () {
+        try {
+            tizen.alarm.removeAll();
+        } catch (err) {
+            // do nothing in case removeAll throw an exception
         }
-    } finally {
-        cleanAlarms();
+    });
+
+    var i, conversionTable = getTypeConversionExceptions("object", true),
+        alarm = createAbsAlarm();
+    for (i = 0; i < conversionTable.length; i++) {
+        assert_throws({name: conversionTable[i][1]}, function () {
+            tizen.alarm.add(alarm, APPLICATION_ID, conversionTable[i][0]);
+        }, "exception should was thrown");
     }
 }, "AlarmManager_add_appControl_TypeMismatch");
 
old mode 100644 (file)
new mode 100755 (executable)
index a34dabe..dea4ad0
@@ -50,14 +50,18 @@ Authors:
 //==== TEST_CRITERIA MC
 
 test(function () {
+    add_result_callback(function () {
+        try {
+            tizen.alarm.removeAll();
+        } catch (err) {
+            // do nothing in case removeAll throw an exception
+        }
+    });
+
     var absAlarm1 = createAbsAlarm();
-    try {
-        assert_throws({name: "TypeMismatchError"}, function () {
-            tizen.alarm.add(absAlarm1, APPLICATION_ID, [12,34]);
-        }, "TypeMismatchError exception should be thrown - given wrong appControl");
-    } finally {
-        cleanAlarms();
-    }
+    assert_throws({name: "TypeMismatchError"}, function () {
+        tizen.alarm.add(absAlarm1, APPLICATION_ID, [12,34]);
+    }, "TypeMismatchError exception should be thrown - given wrong appControl");
 }, "AlarmManager_add_appControl_invalid");
 
 </script>
old mode 100644 (file)
new mode 100755 (executable)
index 313a83d..dd877b6
@@ -46,26 +46,29 @@ Authors:
 //==== TEST_CRITERIA MTO
 
 test(function () {
-    try {
-        var alarm, appControl;
-
-        alarm = createAbsAlarm();
-
-        appControl = {
-            operation: "http://tizen.org/appcontrol/operation/share",
-            uri: "share.html",
-            mime: "image/*",
-            category: "",
-            data: []
-        };
-
-        assert_throws({name: "TypeMismatchError"}, function () {
-            tizen.alarm.add(alarm, APPLICATION_ID, appControl);
-        }, "fake system object was pased but exception wasn't thrown");
-
-    } finally {
-        cleanAlarms();
-    }
+    add_result_callback(function () {
+        try {
+            tizen.alarm.removeAll();
+        } catch (err) {
+            // do nothing in case removeAll throw an exception
+        }
+    });
+
+    var alarm, appControl;
+
+    alarm = createAbsAlarm();
+
+    appControl = {
+        operation: "http://tizen.org/appcontrol/operation/share",
+        uri: "share.html",
+        mime: "image/*",
+        category: "",
+        data: []
+    };
+
+    assert_throws({name: "TypeMismatchError"}, function () {
+        tizen.alarm.add(alarm, APPLICATION_ID, appControl);
+    }, "fake system object was pased but exception wasn't thrown");
 }, "AlarmManager_add_appControl_invalid_obj");
 
 </script>
old mode 100644 (file)
new mode 100755 (executable)
index 0d9a0e3..da454e0
@@ -46,17 +46,21 @@ Authors:
 //==== TEST_CRITERIA MMA
 
 test(function () {
-    try {
-        assert_throws({name: "TypeMismatchError"}, function () {
-            tizen.alarm.add();
-        }, "Method was called without arguments but exception was not thrown");
-
-        assert_throws({name: "TypeMismatchError"}, function () {
-            tizen.alarm.add(undefined, APPLICATION_ID);
-        }, "Method was called without Alarm but exception was not thrown");
-    } finally {
-        cleanAlarms();
-    }
+    add_result_callback(function () {
+        try {
+            tizen.alarm.removeAll();
+        } catch (err) {
+            // do nothing in case removeAll throw an exception
+        }
+    });
+
+    assert_throws({name: "TypeMismatchError"}, function () {
+        tizen.alarm.add();
+    }, "Method was called without arguments but exception was not thrown");
+
+    assert_throws({name: "TypeMismatchError"}, function () {
+        tizen.alarm.add(undefined, APPLICATION_ID);
+    }, "Method was called without Alarm but exception was not thrown");
 }, "AlarmManager_add_missarg");
 
 </script>
old mode 100644 (file)
new mode 100755 (executable)
index 6d2f52b..c51a6a9
@@ -51,16 +51,20 @@ Authors:
 //==== PRIORITY P1
 //==== TEST_CRITERIA MMINA MR MAST
 test(function () {
-    try {
-        var alarm1 = createRelAlarm(), alarm2, retVal;
-        retVal = tizen.alarm.add(alarm1, APPLICATION_ID);
-        alarm2 = tizen.alarm.get(alarm1.id);
-        assert_type(retVal, "undefined", "method returned value");
-        assert_not_equals(alarm1.id, null, "object was not added properly");
-        assert_equals(alarm1.id, alarm2.id, "the object is not the same which was added");
-    } finally {
-        cleanAlarms();
-    }
+    add_result_callback(function () {
+        try {
+            tizen.alarm.removeAll();
+        } catch (err) {
+            // do nothing in case removeAll throw an exception
+        }
+    });
+
+    var alarm1 = createRelAlarm(), alarm2, retVal;
+    retVal = tizen.alarm.add(alarm1, APPLICATION_ID);
+    alarm2 = tizen.alarm.get(alarm1.id);
+    assert_type(retVal, "undefined", "method returned value");
+    assert_not_equals(alarm1.id, null, "object was not added properly");
+    assert_equals(alarm1.id, alarm2.id, "the object is not the same which was added");
 }, "AlarmManager_add_relative_alarm");
 // add alarm success
 
old mode 100644 (file)
new mode 100755 (executable)
index d8f57a6..b7d0f3f
@@ -42,18 +42,22 @@ Authors:
 //==== PRIORITY P1
 //==== TEST_CRITERIA MOA MR MAST
 test(function () {
-    try {
-        var alarm1, alarm2, appControl, returnVal;
-        alarm1 = createRelAlarm();
-        appControl = new tizen.ApplicationControl("http://tizen.org/appcontrol/operation/view", "http://www.tizen.org");
-        returnVal = tizen.alarm.add(alarm1, APPLICATION_ID, appControl);
-        assert_type(returnVal, "undefined", "method returned value");
-        assert_not_equals(alarm1.id, null, "object was not added properly");
-        alarm2 = tizen.alarm.get(alarm1.id);
-        assert_equals(alarm1.id, alarm2.id, "the object is not the same which was added");
-    } finally {
-        cleanAlarms();
-    }
+    add_result_callback(function () {
+        try {
+            tizen.alarm.removeAll();
+        } catch (err) {
+            // do nothing in case removeAll throw an exception
+        }
+    });
+
+    var alarm1, alarm2, appControl, returnVal;
+    alarm1 = createRelAlarm();
+    appControl = new tizen.ApplicationControl("http://tizen.org/appcontrol/operation/view", "http://www.tizen.org");
+    returnVal = tizen.alarm.add(alarm1, APPLICATION_ID, appControl);
+    assert_type(returnVal, "undefined", "method returned value");
+    assert_not_equals(alarm1.id, null, "object was not added properly");
+    alarm2 = tizen.alarm.get(alarm1.id);
+    assert_equals(alarm1.id, alarm2.id, "the object is not the same which was added");
 }, "AlarmManager_add_relative_alarm_with_appControl");
 
 </script>
old mode 100644 (file)
new mode 100755 (executable)
index 7cdb6b4..d956c10
@@ -53,16 +53,20 @@ Authors:
 //==== TEST_CRITERIA MR MMINA
 
 test(function () {
-    try {
-        var alarm1, alarm2;
-        alarm1 = createAbsAlarm();
-        tizen.alarm.add(alarm1, APPLICATION_ID);
-        alarm2 = tizen.alarm.get(alarm1.id);
-        assert_true(alarm2 instanceof tizen.AlarmAbsolute, "object was not get properly");
-        assert_equals(alarm1.id, alarm2.id, "the object is not the same which was added");
-    } finally {
-        cleanAlarms();
-    }
+    add_result_callback(function () {
+        try {
+            tizen.alarm.removeAll();
+        } catch (err) {
+            // do nothing in case removeAll throw an exception
+        }
+    });
+
+    var alarm1, alarm2;
+    alarm1 = createAbsAlarm();
+    tizen.alarm.add(alarm1, APPLICATION_ID);
+    alarm2 = tizen.alarm.get(alarm1.id);
+    assert_true(alarm2 instanceof tizen.AlarmAbsolute, "object was not get properly");
+    assert_equals(alarm1.id, alarm2.id, "the object is not the same which was added");
 }, "AlarmManager_get");
 
 </script>
old mode 100644 (file)
new mode 100755 (executable)
index de8d10b..d3dd2b6
@@ -56,26 +56,30 @@ Revision history:
 //==== TEST_CRITERIA MR MNA
 
 test(function () {
-    try {
-        var i, absAlarm, relAlarm, alarmAll = [];
-        cleanAlarms();
-        absAlarm = createAbsAlarm();
-        tizen.alarm.add(absAlarm, APPLICATION_ID);
-        relAlarm = createRelAlarm();
-        tizen.alarm.add(relAlarm, APPLICATION_ID);
-        alarmAll = tizen.alarm.getAll();
-        assert_equals(alarmAll.length, 2, "number of added alarms should be 2");
-        for (i = 0; i < alarmAll.length; i++) {
-            if (alarmAll[i] instanceof tizen.AlarmAbsolute) {
-                assert_equals(alarmAll[i].id, absAlarm.id, "object is not the same which was added");
-            } else if (alarmAll[i] instanceof tizen.AlarmRelative) {
-                assert_equals(alarmAll[i].id, relAlarm.id, "object is not the same which was added");
-            } else {
-                assert_unreached("object was not get properly");
-            }
+    add_result_callback(function () {
+        try {
+            tizen.alarm.removeAll();
+        } catch (err) {
+            // do nothing in case removeAll throw an exception
+        }
+    });
+
+    var i, absAlarm, relAlarm, alarmAll = [];
+    cleanAlarms();
+    absAlarm = createAbsAlarm();
+    tizen.alarm.add(absAlarm, APPLICATION_ID);
+    relAlarm = createRelAlarm();
+    tizen.alarm.add(relAlarm, APPLICATION_ID);
+    alarmAll = tizen.alarm.getAll();
+    assert_equals(alarmAll.length, 2, "number of added alarms should be 2");
+    for (i = 0; i < alarmAll.length; i++) {
+        if (alarmAll[i] instanceof tizen.AlarmAbsolute) {
+            assert_equals(alarmAll[i].id, absAlarm.id, "object is not the same which was added");
+        } else if (alarmAll[i] instanceof tizen.AlarmRelative) {
+            assert_equals(alarmAll[i].id, relAlarm.id, "object is not the same which was added");
+        } else {
+            assert_unreached("object was not get properly");
         }
-    } finally {
-        cleanAlarms();
     }
 });
 
old mode 100644 (file)
new mode 100755 (executable)
index 2c0606c..70315e7
@@ -46,20 +46,24 @@ Authors:
 //==== TEST_CRITERIA MNAEX MR
 
 test(function () {
-    try {
-        var i, absAlarm, alarmAll = [], argumentsList = [null, undefined, "string", 1, false, ["one", "two"], {arg: 1}, function () {}];
-        cleanAlarms();
-        absAlarm = createAbsAlarm();
-        tizen.alarm.add(absAlarm, APPLICATION_ID);
-        for (i = 0; i < argumentsList.length; i++) {
-            alarmAll = tizen.alarm.getAll(argumentsList[i]);
-            assert_equals(alarmAll.length, 1, "number of added alarms should be 1");
-            assert_true(alarmAll[0] instanceof tizen.AlarmAbsolute, "object was not get properly");
-            assert_equals(alarmAll[0].id, absAlarm.id, "the first object is not the same which was added");
-            alarmAll = [];
+    add_result_callback(function () {
+        try {
+            tizen.alarm.removeAll();
+        } catch (err) {
+            // do nothing in case removeAll throw an exception
         }
-    } finally {
-        cleanAlarms();
+    });
+
+    var i, absAlarm, alarmAll = [], argumentsList = [null, undefined, "string", 1, false, ["one", "two"], {arg: 1}, function () {}];
+    cleanAlarms();
+    absAlarm = createAbsAlarm();
+    tizen.alarm.add(absAlarm, APPLICATION_ID);
+    for (i = 0; i < argumentsList.length; i++) {
+        alarmAll = tizen.alarm.getAll(argumentsList[i]);
+        assert_equals(alarmAll.length, 1, "number of added alarms should be 1");
+        assert_true(alarmAll[0] instanceof tizen.AlarmAbsolute, "object was not get properly");
+        assert_equals(alarmAll[0].id, absAlarm.id, "the first object is not the same which was added");
+        alarmAll = [];
     }
 });
 
old mode 100644 (file)
new mode 100755 (executable)
index a64e513..8e87b3c
@@ -39,16 +39,20 @@ Authors:
 //==== TEST_CRITERIA MMINA MR
 
 test(function () {
-    try {
-        var alarm1, alarm2;
-        alarm1 = createRelAlarm();
-        tizen.alarm.add(alarm1, APPLICATION_ID);
-        alarm2 = tizen.alarm.get(alarm1.id);
-        assert_true(alarm2 instanceof tizen.AlarmRelative, "object was not get properly");
-        assert_equals(alarm1.id, alarm2.id, "the object is not the same which was added");
-    } finally {
-        cleanAlarms();
-    }
+    add_result_callback(function () {
+        try {
+            tizen.alarm.removeAll();
+        } catch (err) {
+            // do nothing in case removeAll throw an exception
+        }
+    });
+
+    var alarm1, alarm2;
+    alarm1 = createRelAlarm();
+    tizen.alarm.add(alarm1, APPLICATION_ID);
+    alarm2 = tizen.alarm.get(alarm1.id);
+    assert_true(alarm2 instanceof tizen.AlarmRelative, "object was not get properly");
+    assert_equals(alarm1.id, alarm2.id, "the object is not the same which was added");
 }, "AlarmManager_get_AlarmRelative");
 
 </script>
old mode 100644 (file)
new mode 100755 (executable)
index 6905e09..d663fd4
@@ -53,28 +53,40 @@ Revision history:
 //==== TEST_CRITERIA MR MNA MNAST
 
 test(function (){
-    try {
-        var absAlarm, relAlarm, retVal, alarmAll = [];
-        tizen.alarm.removeAll();
-        absAlarm = createAbsAlarm();
-        tizen.alarm.add(absAlarm, APPLICATION_ID);
-        relAlarm = createRelAlarm();
-        tizen.alarm.add(relAlarm, APPLICATION_ID);
-        alarmAll = tizen.alarm.getAll();
-        assert_equals(alarmAll.length, 2 ,"number of added alarms should be 2");
-        retVal = tizen.alarm.removeAll();
-        assert_type(retVal, "undefined", "method returned value");
-        assert_throws({name: "NotFoundError"}, function () {
-            tizen.alarm.get(relAlarm.id);
-        }, "exception wasn't thrown");
-        assert_throws({name: "NotFoundError"}, function () {
-            tizen.alarm.get(absAlarm.id);
-        }, "exception wasn't thrown");
-        alarmAll = tizen.alarm.getAll();
-        assert_equals(alarmAll.length, 0, "items not removed properly");
-    } finally {
-        tizen.alarm.removeAll();
-    }
+    add_result_callback(function () {
+        try {
+            tizen.alarm.removeAll();
+        } catch (err) {
+            // do nothing in case removeAll throw an exception
+        }
+    });
+
+    var absAlarm, relAlarm, retVal, alarmAll = [];
+
+    tizen.alarm.removeAll();
+
+    absAlarm = createAbsAlarm();
+    tizen.alarm.add(absAlarm, APPLICATION_ID);
+
+    relAlarm = createRelAlarm();
+    tizen.alarm.add(relAlarm, APPLICATION_ID);
+
+    alarmAll = tizen.alarm.getAll();
+    assert_equals(alarmAll.length, 2 ,"number of added alarms should be 2");
+
+    retVal = tizen.alarm.removeAll();
+    assert_type(retVal, "undefined", "method returned value");
+
+    assert_throws({name: "NotFoundError"}, function () {
+        tizen.alarm.get(relAlarm.id);
+    }, "exception wasn't thrown");
+
+    assert_throws({name: "NotFoundError"}, function () {
+        tizen.alarm.get(absAlarm.id);
+    }, "exception wasn't thrown");
+
+    alarmAll = tizen.alarm.getAll();
+    assert_equals(alarmAll.length, 0, "items not removed properly");
 }, "AlarmManager_removeAll");
 
 </script>
old mode 100644 (file)
new mode 100755 (executable)
index d80c02a..8407ae5
@@ -43,24 +43,28 @@ Authors:
 //==== TEST_CRITERIA MNAEX
 
 test(function (){
-    try {
-        var i, alarm, alarmAll, retVal, argumentsList = [null, undefined, "string", 1, false, ["one", "two"], {arg: 1}, function () {}];
-        tizen.alarm.removeAll();
-        alarm =  createAbsAlarm();
-        for (i = 0; i < argumentsList.length; i++) {
-            tizen.alarm.add(alarm, APPLICATION_ID);
-            alarmAll = tizen.alarm.getAll();
-            assert_equals(alarmAll.length, 1 ,"number of added alarms should be 1");
-            retVal = tizen.alarm.removeAll(argumentsList[i]);
-            assert_type(retVal, "undefined", "method returned value");
-            assert_throws({name: "NotFoundError"}, function () {
-                tizen.alarm.get(alarm.id);
-            }, "exception wasn't thrown");
-            alarmAll = tizen.alarm.getAll();
-            assert_equals(alarmAll.length, 0, "items not removed properly");
+    add_result_callback(function () {
+        try {
+            tizen.alarm.removeAll();
+        } catch (err) {
+            // do nothing in case removeAll throw an exception
         }
-    } finally {
-        tizen.alarm.removeAll();
+    });
+
+    var i, alarm, alarmAll, retVal, argumentsList = [null, undefined, "string", 1, false, ["one", "two"], {arg: 1}, function () {}];
+    tizen.alarm.removeAll();
+    alarm =  createAbsAlarm();
+    for (i = 0; i < argumentsList.length; i++) {
+        tizen.alarm.add(alarm, APPLICATION_ID);
+        alarmAll = tizen.alarm.getAll();
+        assert_equals(alarmAll.length, 1 ,"number of added alarms should be 1");
+        retVal = tizen.alarm.removeAll(argumentsList[i]);
+        assert_type(retVal, "undefined", "method returned value");
+        assert_throws({name: "NotFoundError"}, function () {
+            tizen.alarm.get(alarm.id);
+        }, "exception wasn't thrown");
+        alarmAll = tizen.alarm.getAll();
+        assert_equals(alarmAll.length, 0, "items not removed properly");
     }
 }, "AlarmManager_removeAll_extra_argument");
 
old mode 100644 (file)
new mode 100755 (executable)
index efc3bd2..cf32aea
@@ -53,20 +53,24 @@ Authors:
 //==== TEST_CRITERIA MR MMINA MAST
 
 test(function () {
-    try {
-        var alarm, retVal;
-        tizen.alarm.removeAll();
-        alarm = createAbsAlarm();
-        tizen.alarm.add(alarm, APPLICATION_ID);
-        retVal=tizen.alarm.remove(alarm.id);
-        assert_type(retVal, "undefined", "method returned value");
-        assert_throws({name: "NotFoundError"}, function () {
-            tizen.alarm.get(alarm.id);
-        }, "exception wasn't thrown");
-        assert_equals(tizen.alarm.getAll().length, 0, "item not removed properly");
-    } finally {
-        tizen.alarm.removeAll();
-    }
+    add_result_callback(function () {
+        try {
+            tizen.alarm.removeAll();
+        } catch (err) {
+            // do nothing in case removeAll throw an exception
+        }
+    });
+
+    var alarm, retVal;
+    tizen.alarm.removeAll();
+    alarm = createAbsAlarm();
+    tizen.alarm.add(alarm, APPLICATION_ID);
+    retVal=tizen.alarm.remove(alarm.id);
+    assert_type(retVal, "undefined", "method returned value");
+    assert_throws({name: "NotFoundError"}, function () {
+        tizen.alarm.get(alarm.id);
+    }, "exception wasn't thrown");
+    assert_equals(tizen.alarm.getAll().length, 0, "item not removed properly");
 }, "AlarmManager_remove_absolute_alarm");
 
 </script>
old mode 100644 (file)
new mode 100755 (executable)
index cf647cb..9e009fa
@@ -51,20 +51,24 @@ Authors:
 //==== TEST_CRITERIA MR MMINA MAST
 
 test(function () {
-    try {
-        var alarm, retVal;
-        tizen.alarm.removeAll();
-        alarm = createRelAlarm();
-        tizen.alarm.add(alarm, APPLICATION_ID);
-        retVal=tizen.alarm.remove(alarm.id);
-        assert_type(retVal, "undefined", "method returned value");
-        assert_throws({name: "NotFoundError"}, function () {
-            tizen.alarm.get(alarm.id);
-        }, "exception wasn't thrown");
-        assert_equals(tizen.alarm.getAll().length, 0, "item not removed properly");
-    } finally {
-        tizen.alarm.removeAll();
-    }
+    add_result_callback(function () {
+        try {
+            tizen.alarm.removeAll();
+        } catch (err) {
+            // do nothing in case removeAll throw an exception
+        }
+    });
+
+    var alarm, retVal;
+    tizen.alarm.removeAll();
+    alarm = createRelAlarm();
+    tizen.alarm.add(alarm, APPLICATION_ID);
+    retVal=tizen.alarm.remove(alarm.id);
+    assert_type(retVal, "undefined", "method returned value");
+    assert_throws({name: "NotFoundError"}, function () {
+        tizen.alarm.get(alarm.id);
+    }, "exception wasn't thrown");
+    assert_equals(tizen.alarm.getAll().length, 0, "item not removed properly");
 }, "AlarmManager_remove_relative_alarm");
 
 </script>
old mode 100644 (file)
new mode 100755 (executable)
index a3b3b78..fa10556
@@ -46,16 +46,20 @@ Authors:
 //==== TEST_CRITERIA MR MNA
 
 test(function () {
-    try {
-        var alarm, remainingSeconds, delay = 3600;
-        alarm = new tizen.AlarmRelative(delay);
-        tizen.alarm.add(alarm, APPLICATION_ID);
-        remainingSeconds = alarm.getRemainingSeconds();
-        assert_type(remainingSeconds, "number", "type of the returned value is not a number");
-        assert_approx_equals(remainingSeconds, alarm.delay, 1, "the returned value is not properly");
-    } finally {
-        tizen.alarm.removeAll();
-    }
+    add_result_callback(function () {
+        try {
+            tizen.alarm.removeAll();
+        } catch (err) {
+            // do nothing in case removeAll throw an exception
+        }
+    });
+
+    var alarm, remainingSeconds, delay = 3600;
+    alarm = new tizen.AlarmRelative(delay);
+    tizen.alarm.add(alarm, APPLICATION_ID);
+    remainingSeconds = alarm.getRemainingSeconds();
+    assert_type(remainingSeconds, "number", "type of the returned value is not a number");
+    assert_approx_equals(remainingSeconds, alarm.delay, 1, "the returned value is not properly");
 }, "AlarmRelative_getRemainingSeconds");
 
 </script>
old mode 100644 (file)
new mode 100755 (executable)
index 57ff4fe..a71841a
@@ -46,18 +46,22 @@ Authors:
 //==== TEST_CRITERIA MNAEX MR
 
 test(function () {
-    try {
-        var i, alarm, remainingSeconds, delay = 3600,
-            argumentsList = [null, undefined, "string", 1, false, ["one", "two"], {arg: 1}, function () {}];
-        alarm = new tizen.AlarmRelative(delay);
-        tizen.alarm.add(alarm, APPLICATION_ID);
-        for (i = 0; i < argumentsList.length; i++) {
-            remainingSeconds = alarm.getRemainingSeconds(argumentsList[i]);
-            assert_type(remainingSeconds, "number", "type of the returned value is not a number");
-            assert_approx_equals(remainingSeconds, alarm.delay, 1, "the returned value is not properly");
+    add_result_callback(function () {
+        try {
+            tizen.alarm.removeAll();
+        } catch (err) {
+            // do nothing in case removeAll throw an exception
         }
-    } finally {
-        tizen.alarm.removeAll();
+    });
+
+    var i, alarm, remainingSeconds, delay = 3600,
+        argumentsList = [null, undefined, "string", 1, false, ["one", "two"], {arg: 1}, function () {}];
+    alarm = new tizen.AlarmRelative(delay);
+    tizen.alarm.add(alarm, APPLICATION_ID);
+    for (i = 0; i < argumentsList.length; i++) {
+        remainingSeconds = alarm.getRemainingSeconds(argumentsList[i]);
+        assert_type(remainingSeconds, "number", "type of the returned value is not a number");
+        assert_approx_equals(remainingSeconds, alarm.delay, 1, "the returned value is not properly");
     }
 }, "AlarmRelative_getRemainingSeconds_extra_argument");
 
old mode 100644 (file)
new mode 100755 (executable)
index e5c406f..e771d1c
@@ -37,6 +37,7 @@ Authors:
 <body>
 <div id="log"></div>
 <script>
+setup({timeout: 30000});
 
 //==== TEST: AlarmRelative_getRemainingSeconds_return_null
 //==== LABEL check using getRemainingSeconds method for null return
@@ -45,25 +46,19 @@ Authors:
 //==== PRIORITY P1
 //==== TEST_CRITERIA MR MNA
 
-var t = async_test("AlarmRelative_getRemainingSeconds_return_null"),
-    alarm, remainingSeconds, delay = 1, getRemainingSeconds;
+var t = async_test("AlarmRelative_getRemainingSeconds_return_null", {timeout: 30000}),
+    alarm, returnedValue;
 
 t.step(function () {
-    tizen.alarm.removeAll();
-    alarm = new tizen.AlarmRelative(delay);
+    alarm = new tizen.AlarmRelative(5);
+
     tizen.alarm.add(alarm, APPLICATION_ID);
 
-    getRemainingSeconds = t.step_func(function () {
-        try {
-            remainingSeconds = alarm.getRemainingSeconds();
-            assert_equals(remainingSeconds, null, "getRemainingSeconds do not returns null");
-            t.done();
-        } finally {
-            tizen.alarm.removeAll();
-        }
-    });
-
-    setTimeout(getRemainingSeconds, 1300);
+    setTimeout(t.step_func(function () {
+        returnedValue = alarm.getRemainingSeconds();
+        assert_equals(returnedValue, null, "getRemainingSeconds do not returns null");
+        t.done();
+    }), 10000);
 });
 
 </script>
old mode 100644 (file)
new mode 100755 (executable)
index b3a92a4..d4e14e4
@@ -45,17 +45,21 @@ Authors:
 //==== TEST_CRITERIA AE AT ARO
 
 test(function () {
-    try {
-        var alarm, date = new Date();
-        date.setFullYear(date.getFullYear() + 1);
-        alarm = new tizen.AlarmAbsolute(date);
-        assert_true("id" in alarm, "attribute id doesn't exist in provided object");
-        assert_type(alarm.id, "null", "default value should be null");
-        tizen.alarm.add(alarm, APPLICATION_ID);
-        check_readonly(alarm, "id", alarm.id, "string", "dummyValue");
-    } finally {
-        cleanAlarms();
-    }
+    add_result_callback(function () {
+        try {
+            tizen.alarm.removeAll();
+        } catch (err) {
+            // do nothing in case removeAll throw an exception
+        }
+    });
+
+    var alarm, date = new Date();
+    date.setFullYear(date.getFullYear() + 1);
+    alarm = new tizen.AlarmAbsolute(date);
+    assert_true("id" in alarm, "attribute id doesn't exist in provided object");
+    assert_type(alarm.id, "null", "default value should be null");
+    tizen.alarm.add(alarm, APPLICATION_ID);
+    check_readonly(alarm, "id", alarm.id, "string", "dummyValue");
 }, "Alarm_id_attribute_absolute_alarm");
 
 </script>
old mode 100644 (file)
new mode 100755 (executable)
index f676e75..42c2e91
@@ -45,16 +45,20 @@ Authors:
 //==== TEST_CRITERIA AE AT ARO
 
 test(function () {
-    try {
-        var alarm, delay = 3600;
-        alarm = new tizen.AlarmRelative(delay);
-        assert_true("id" in alarm, "attribute id doesn't exist in provided object");
-        assert_type(alarm.id, "null", "default value should be null");
-        tizen.alarm.add(alarm, APPLICATION_ID);
-        check_readonly(alarm, "id", alarm.id, "string", "dummyValue");
-    } finally {
-        cleanAlarms();
-    }
+    add_result_callback(function () {
+        try {
+            tizen.alarm.removeAll();
+        } catch (err) {
+            // do nothing in case removeAll throw an exception
+        }
+    });
+
+    var alarm, delay = 3600;
+    alarm = new tizen.AlarmRelative(delay);
+    assert_true("id" in alarm, "attribute id doesn't exist in provided object");
+    assert_type(alarm.id, "null", "default value should be null");
+    tizen.alarm.add(alarm, APPLICATION_ID);
+    check_readonly(alarm, "id", alarm.id, "string", "dummyValue");
 }, "Alarm_id_attribute_relative_alarm");
 
 </script>
old mode 100644 (file)
new mode 100755 (executable)
index 95801df..73f4e73
@@ -6,6 +6,6 @@
     <icon src="icon.png"/>
     <content src="index.html"/>
     
-    <tizen:application id="testalar00.alarmTestApp" package="testalar00" required_version="2.1"/>
+    <tizen:application id="testalar00.alarmTestApp" package="testalar00" required_version="2.2"/>
     
 </widget>
old mode 100644 (file)
new mode 100755 (executable)
index f319d33..55e9934
           </spec>
         </specs>
       </testcase>
-      <testcase purpose="check using getRemainingSeconds method for null return" type="compliance" status="approved" component="TizenAPI/Application/Alarm" execution_type="auto" priority="P1" id="AlarmRelative_getRemainingSeconds_return_null">
+      <testcase purpose="check using getRemainingSeconds method for null return" type="compliance" onload_delay="30" status="approved" component="TizenAPI/Application/Alarm" execution_type="auto" priority="P1" id="AlarmRelative_getRemainingSeconds_return_null">
         <description>
           <test_script_entry>/opt/tct-alarm-tizen-tests/alarm/AlarmRelative_getRemainingSeconds_return_null.html</test_script_entry>
         </description>
old mode 100644 (file)
new mode 100755 (executable)
index 08be8cc..b47a9d2
           <test_script_entry>/opt/tct-alarm-tizen-tests/alarm/AlarmRelative_getRemainingSeconds_extra_argument.html</test_script_entry>
         </description>
       </testcase>
-      <testcase purpose="check using getRemainingSeconds method for null return" component="TizenAPI/Application/Alarm" execution_type="auto" id="AlarmRelative_getRemainingSeconds_return_null">
+      <testcase purpose="check using getRemainingSeconds method for null return" onload_delay="30" component="TizenAPI/Application/Alarm" execution_type="auto" id="AlarmRelative_getRemainingSeconds_return_null">
         <description>
           <test_script_entry>/opt/tct-alarm-tizen-tests/alarm/AlarmRelative_getRemainingSeconds_return_null.html</test_script_entry>
         </description>