Test points are implemented as breakpoints at specific line in source code. They enable us to pause test execution at any location in the tested code, and perform the following actions:
Since test point can be located at any line which generates executable code, we must have a way to tell testIDEA where to set it. File name and line number are often not a good idea, because line numbers change as we edit the code. For this reason there exist several options to define test point location in source code. Two recommended ones are described below:
Note: Not all source code line generate code, and not all declared local variables exist, especially when we use optimizing compiler. Test points can be set only on lines which generate code and can get/set only values of variables which exist. In winIDEA all source code lines which generate code have rectangles on the left edge:
Since one test point can be hit multiple times during test execution, we have possibility to specify different verification and assignment actions for each hit. This can be done by adding rows with expected expressions and assignments in the table shown below:
See section Stubs in this manual for the description of custom setting of hardware breakpoints.