Revision: 2807
Author: jprantan
Date: Tue Mar 30 04:43:36 2010
Log: Added tests for Run Keyword If Timeout Occurred, issue 342.
http://code.google.com/p/robotframework/source/detail?r=2807

Added:
/trunk/atest/robot/standard_libraries/builtin/run_keyword_if_timeout_occurred.txt /trunk/atest/testdata/standard_libraries/builtin/run_keyword_if_timeout_occurred.txt

=======================================
--- /dev/null
+++ /trunk/atest/robot/standard_libraries/builtin/run_keyword_if_timeout_occurred.txt Tue Mar 30 04:43:36 2010
@@ -0,0 +1,40 @@
+*** Settings ***
+Suite Setup Run Tests ${EMPTY} standard_libraries/builtin/run_keyword_if_timeout_occurred.txt
+Force Tags      regression  pybot  jybot
+Resource        ../../../resources/resource.txt
+
+*** Test Cases ***
+
+Run Keyword If Timeout Occurred When Test Timeout Occurred
+    Check Test Case  ${TESTNAME}
+
+Run Keyword If Timeout Occurred When Test Timeout Did Not Occur
+    Check Test Case  ${TESTNAME}
+
+Run Keyword If Timeout Occurred When Test Timeout Occurred In Setup
+    Check Test Case  ${TESTNAME}
+
+Run Keyword If Timeout Occurred When Test Timeout Did Not Occur In Setup
+    Check Test Case  ${TESTNAME}
+
+Run Keyword If Timeout Occurred When Keyword Timeout Occurred
+    Check Test Case  ${TESTNAME}
+
+Run Keyword If Timeout Occurred When Keyword Timeout Did Not Occur
+    Check Test Case  ${TESTNAME}
+
+Run Keyword If Timeout Occurred When Keyword Timeout Occurred In Setup
+    Check Test Case  ${TESTNAME}
+
+Run Keyword If Timeout Occurred When Keyword Timeout Did Not Occur In Setup
+    Check Test Case  ${TESTNAME}
+
+Run Keyword If Timeout Occurred Used Outside Teardown
+    Check Test Case  ${TESTNAME}
+
+Run Keyword If Timeout Occurred Used When No Timeout Is Set
+    Check Test Case  ${TESTNAME}
+
+Returning Value From Run Keyword If Timeout Occurred
+    Check Test Case  ${TESTNAME}
+
=======================================
--- /dev/null
+++ /trunk/atest/testdata/standard_libraries/builtin/run_keyword_if_timeout_occurred.txt Tue Mar 30 04:43:36 2010
@@ -0,0 +1,74 @@
+*** Settings ***
+
+Test Teardown    Fail If Timeout Occurred
+
+
+*** Test Cases ***
+
+Run Keyword If Timeout Occurred When Test Timeout Occurred
+ [Documentation] FAIL Test timeout 1 second exceeded.\n\nAlso teardown failed:\nTimeout occurred!
+    [Timeout]  1 second
+    Sleep  2 seconds
+
+Run Keyword If Timeout Occurred When Test Timeout Did Not Occur
+    [Timeout]  1 second
+    No Operation
+
+Run Keyword If Timeout Occurred When Test Timeout Occurred In Setup
+ [Documentation] FAIL Setup failed:\nTest timeout 1 second exceeded.\n\nAlso teardown failed:\nTimeout occurred!
+    [Timeout]  1 second
+    [Setup]  Sleep  2 seconds
+    No Operation
+
+Run Keyword If Timeout Occurred When Test Timeout Did Not Occur In Setup
+    [Timeout]  1 second
+    [Setup]  No Operation
+    No Operation
+
+Run Keyword If Timeout Occurred When Keyword Timeout Occurred
+ [Documentation] FAIL Keyword timeout 1 second exceeded.\n\nAlso teardown failed:\nTimeout occurred in keyword!
+    Keyword With Timeout Failing
+ [Teardown] Run Keyword If Timeout Occurred Fail Timeout occurred in keyword!
+
+Run Keyword If Timeout Occurred When Keyword Timeout Did Not Occur
+    Keyword With Timeout Passing
+
+Run Keyword If Timeout Occurred When Keyword Timeout Occurred In Setup
+ [Documentation] FAIL Setup failed:\nKeyword timeout 1 second exceeded.\n\nAlso teardown failed:\nTimeout occurred!
+    [Setup]  Keyword With Timeout Failing
+    No Operation
+
+Run Keyword If Timeout Occurred When Keyword Timeout Did Not Occur In Setup
+    [Setup]  Keyword With Timeout Passing
+    No Operation
+
+Run Keyword If Timeout Occurred Used Outside Teardown
+ [Documentation] FAIL Keyword 'Run Keyword If Timeout Occurred' can only be used in test teardown
+    Fail If Timeout Occurred
+
+Run Keyword If Timeout Occurred Used When No Timeout Is Set
+    No Operation
+
+Returning Value From Run Keyword If Timeout Occurred
+    [Documentation]  FAIL  Keyword timeout 1 second exceeded.
+    Keyword With Timeout Failing
+    [Teardown]  Return value from Run Keyword If Timeout Occurred
+
+
+*** Keywords ***
+
+Fail If Timeout Occurred
+    Run Keyword If Timeout Occurred  Fail  Timeout occurred!
+
+Keyword With Timeout Failing
+    [Timeout]  1 seconds
+    Sleep  2 seconds
+
+Keyword With Timeout Passing
+    [Timeout]  1 seconds
+    No Operation
+
+Return value from Run Keyword If Timeout Occurred
+    ${value}  Run Keyword If Timeout Occurred  Set Variable  timeout
+    Should Be Equal  ${value}  timeout
+

To unsubscribe from this group, send email to 
robotframework-commit+unsubscribegooglegroups.com or reply to this email with the words 
"REMOVE ME" as the subject.

Reply via email to