Native unit testing in Eclipse?

I am moving my java project from Netbeans to Eclipse. I am new to Eclipse and I cannot figure out how to create or run unit tests. In Netbeans, I could just right-click the source file to create test stubs. And to run the tests, I just selected the "Run Tests" menu item.

How to do it in Eclipse?

+4
source share
2 answers

create: right-click the class you want to test, new / junit test case.

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

+5
source

Right-click the class where you want to run the test in the Explorer window and select "Run As .." and then "Junit Script" from the context menu. You can also right-click on a method in the original window and select "Run as" and "Delete test" from the context menu to run only one test method.

+1
source

All Articles