Thursday, October 26, 2006

Running single JUnit tests in Eclipse

Unit testing is important when developing source code. JUnit provides a library to facilitate this in Java, and Eclipse had the functionality to run JUnit tests. Even better, it allows you to run single JUnit tests, even in debug mode:

Just open the java class in your Package Explorer, right click on the JUnit method you want to run, then pick 'Run As' or 'Debug As', and then 'JUnit test'.