views:

62

answers:

2

I'm moving my java project from Netbeans to Eclipse. I'm new to Eclipse and I can't figure out how to create or run unit tests. In Netbeans I could just right click a source file to generate test stubs. And to run tests I just chose a "Run Tests" menu option.

How do I do this in Eclipse?

+1  A: 

Right click on the class that you want to run the test for in the explorer window and select "Run as.." and than "Junit test" from the context menu. You can also right click on the method in the source window and select "Run as" and than "Junit test" from the context menu to run just that single test method.

Casey
+4  A: 

create: right click on class you wanna test, new/junit test case.

to run: right click on test class, run as/junit test case

z00bs