The Non-Web Recovery Systems Flow of Control

Before you modify the recovery system, you need to understand the flow of control during the execution of each of your test cases. The recovery system executes the DefaultTestcaseEnter function. This function, in turn, calls the SetAppState function, which does the following:

  1. Executes the test case.
  2. Executes the DefaultTestcaseExit function, which calls the SetBaseState function, which calls the lowest level application state, which is either the DefaultBaseState or any user defined application state.
    Note: If the test case uses AppState none, the SetBaseState function is not called.

DefaultTestCaseEnter() is considered part of the test case, but DefaultTestCaseExit() is not. Instead, DefaultTestCaseExit() is considered part of the function that runs the test case, which implicitly is main() if the test case is run standalone. Therefore an unhandled exception that occurs during DefaultTestCaseEnter() will abort the current test case, but the next test case will run. However, if the exception occurs during DefaultTestCaseExit(), then it is occurring in the function that is calling the test case, and the function itself will abort. Since an application state may be called from both TestCaseEnter() and TestCaseExit(), an unhandled exception within the application state may cause different behavior depending on whether the exception occurs upon entering or exiting the test case.