Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JUnit adding extra tests to Test Case

I'm using Eclipse I've got some JUnit 4 test cases defined. Some of the classes have changed (only slightly at the moment) and I was wondering if there's any way to open up the GUI where I can select the methods I want to create test stubs for again to update the existing test cases.

I know I could add them manually and I could also create a new Test Case with a different file name and then copy and paste them, but is there any way to update the Test Case from the Class in a smoother way?

Matt

like image 440
Matt_JD Avatar asked Aug 10 '11 12:08

Matt_JD


1 Answers

I use a plugin called MoreUnit. If you are on a method, you can press Ctrl+U to generate a test method in the test class. You can then press Ctrl+J to jump to the test method and implement it. It also puts an icon in the editor gutter next to methods which have test cases.

like image 65
dogbane Avatar answered Sep 21 '22 06:09

dogbane