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 on always running the entire suite, rather than the single test. Is there a way to disable to change this behavior so that I can ask to to run that, and only that, test.
Eclipse – Running a single JUnit test in Eclipse
eclipsejunit
Related Topic
- Java – Easy way of running the same junit test over and over
- Java – Conditionally ignoring tests in JUnit 4
- Android – “Debug certificate expired” error in Eclipse Android plugins
- Junit: splitting integration test and Unit tests
- Java – JUnit confusion: use ‘extends TestCase’ or ‘@Test’
- Java – Maven does not find JUnit tests to run
- Java – Run single test from a JUnit class using command-line
- Java – Populating Spring @Value during Unit Test
Best Answer
In the package explorer unfold the class. It should show you all methods. Right click on the one method you want to run, then select Run As -> JUnit from the context menu (just tested with Eclipse 3.4.1). Also selecting "Run" on a single entry in the JUnit-results view to re-run a test works in the same way.