When I right-click on a class containing unit tests (in folder test, annotated with org.junit.Test), I get these two options:
Unfortunately they provide no further information on what’s the difference between them.
- What’s the difference between these two run options and
- Why do I have this choice only once, and after that there’s only one run option (with a green ‘play’ symbol?
Debug means to run them with a debugger on. This will be slightly slower, but allow you to set breakpoints, memory watches, etc and step through execution. Run means to run the tests without a debugger. They will run faster (the debugger slows them down), but you cannot step through the code or set breakpoints. Use Run when you just want to see if the test works, and debug if you want to go line by line through part of your code checking to see what values variables have and what branches it takes.