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开发者_StackOverflow社区 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?
create: right click on class you wanna test, new/junit test case.
to run: right click on test class, run as/junit test case
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.
精彩评论