>Tip: Enabling JUnit Short Cuts

>If you are trying to practice Test Driven Development, creating JUnit tests in eclipse can be a real chore at times. I’m not talking about actually writing the tests, but trying to get easy access to the JUnit wizards. The short cuts for creating these types of classes is missing by default from the File->New shortcuts menu when working in the Java Perspective and the Plugin-Development perspective. To enable these shortcuts, you must customize the perspective and go to the Shortcuts tab in eclipse:

By checking the JUnit option under Java, you will now get the JUnit and JUnit Test Suite options added to the File->New menu. Thus saving several tedious clicks through the File->New->Other->Java->Junit wizard.
This entry was posted in agile, eclipse, testing. Bookmark the permalink.

3 Responses to >Tip: Enabling JUnit Short Cuts

  1. >Ctrl+N, "tes", Return, Return is my shortcut 🙂

  2. David Carver says:

    >Another even faster short cut:SHFT+ALT+N TMap that in the keybindings, under Preferences->General->Keys to the Junit Test Case and it'll bring the wizard right up.

  3. Matthew Hall says:

    >You should check out the moreUnit plugin. With it you can use Ctrl+J to toggle the editor between a class and its test case. It also puts indicators in the gutter on the class editor so you can see which methods have corresponding tests. Very handy.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s