Skip to content

System Object Lifecycle

itaiag edited this page Aug 9, 2016 · 1 revision

System Object Lifecycle

In addition to instancing a system object the framework can also manages the system object lifecycle.

Initialization and Termination

When a system object is fetched for the first time, it is entered into the internal system map. The next time that the system object is requested there is no need to re-initiate the system object; it is simply fetched from the internal system map. System objects run in one of two life time modes:

  1. Test life time
  2. Permanent life time.

When running in “test life time” mode, the system object is disposed at the end of each test. As a result, the “close()” method is called at the end of the test. The next time the system object is requested using the “getSystemObject” method; the system object is instantiated again.

When running in “permanent life time” mode system object it is disposed of before the test JVM is disposed. The default system object life time mode is “permanent lifetime”.

Pause and Stop

The JRunner allows the user who executes the scenario to pause and stop scenario execution. Before execution of scenario is paused the “pause” method of all system objects in framework map is called. When execution is resumed, the “resume” method is invoked.

Note: When stopping a tests execution by using the “stop” button, the scenario execution is stopped without first disposing the system objects.

Clone this wiki locally