开发者

Built-in Unit testing in Eclipse?

开发者 https://www.devze.com 2023-01-20 04:52 出处:网络
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

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消