How to create junit test from implementation class ?

Let's say someone has written a class with no test coverage. I want to make a unit test.

Today I would do "copy class" and append Test to the class name, keep same package name, choose my test sources directory (we're using maven2).

For all public methods in the copy I will manually:
Add a @Test annotation and change the method from "doSomething" to "testDoSomething" and remove the implementation.

This works, but certainly has nothing to do with "developing with pleasure". Anyone have any better suggestions ? Is there a wizard that could do this for me ?

1 comment
Comment actions Permalink

Kristian,

Try to use Diana build 8280 (http://www.jetbrains.net/confluence/display/IDEADEV/EAP8280Release+Notes)

0

Please sign in to leave a comment.