Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Tomek Kaczanowski - Practical Unit Testing with JUnit and Mockito - 2013.pdf
Скачиваний:
228
Добавлен:
07.03.2016
Размер:
6.59 Mб
Скачать

Appendix B. Running Unit Tests

B.1.1. Debugging Tests with Eclipse

Just like with running tests, you can run a debug session in more than just one way:

by right-clicking on a test class, tests package or test method, and selecting the Debug As / JUnit Test option,

or by typing SHIFT+ALT+D followed by T.

In both cases a Debug perspective will open. To rerun the same debugging session press F11.

B.2. Running Tests with IntelliJ IDEA

IntelliJ IDEA comes bundled with a JUnit plugin, which makes it recognize JUnit tests. There are many ways to execute JUnit tests while working with this IDE.

If you prefer using the mouse, then right-click on the selected test class (e.g. MoneyTest) and choose Run "MoneyTest". To run more tests, right-click on, for example, src/test/java directory (or any package inside it which includes some tests), in project tree view, and choose the appropriate Run ... option. Likewise, to run a single test method, right-click it and choose Run "MoneyTest".

Figure B.4. Running a single test with IntelliJ IDEA

Figure B.5. Running multiple tests with IntelliJ IDEA

272

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]