Running a single JUnit test in Eclipse

后端 未结 13 576
面向向阳花
面向向阳花 2020-11-27 15:05

If I have a test suite with multiple tests, when I try to run a single unit test, either from the context menu of the code editor, or from the JUnit view, it seems to insist

13条回答
  •  余生分开走
    2020-11-27 15:45

    Fastest way I know of:

    1. Press Ctrl+Shift+ (moves cursor to current method declaration),
    2. press Alt+Shift+x (or d for debug) then press t (hotkey for "Run JUnit Test"),
    3. check test result,
    4. press Alt+ to get back to the line of code you were before.

    If you want to run all tests, you can skip steps 1 & 4.

提交回复
热议问题