Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create unit tests easily in eclipse [closed]

I want to create unit tests easily by just selecting method. Is there a tool in eclipse that does that. It should support templates. I should be able to create positive test as well as negative tests.

like image 422
Chotka Avatar asked Feb 27 '11 06:02

Chotka


People also ask

How do you auto generate JUnit test cases?

Open Eclipse, and choose the project you want to create test cases for. In the Package Explorer, select the java class you want to generate the Junit test for. Go to File -> New -> Junit Test Cases.


Video Answer


1 Answers

To create a test case template:

"New" -> "JUnit Test Case" -> Select "Class under test" -> Select "Available methods". I think the wizard is quite easy for you.

like image 177
卢声远 Shengyuan Lu Avatar answered Sep 23 '22 13:09

卢声远 Shengyuan Lu