views:

760

answers:

2

I would like to run junit test cases from commandline. Im using eclipse

A: 

If you project is ant based then you should be able to do something like this from the console:

ant test

If this doesn't work, but still your project is ant based, you can run ant -p to list the main targets of the project.

cherouvim
+1  A: 

Ensure that JUnit.jar is in your classpath, then invoke the command line runner from the console

java org.junit.runner.JUnitCore [test class name]

Reference: junit FAQ

Gishu
you also need to set up the rest of your project's classpath.
Thilo