Junit 4.11 comes with @FixMethodOrder annotation. Instead of using custom solutions just upgrade your junit version and annotate test class with FixMethodOrder(MethodSorters.NAME_ASCENDING). Check the release notes for the details.
Here is a sample:
import org.junit.runners.MethodSorters;

import org.junit.FixMethodOrder;
import org.junit.Test;

@FixMethodOrder(MethodSorters.NAME_ASCENDING)
public class SampleTest {

    @Test
    public void firstTest() {
        System.out.println("first");
    }

    @Test
    public void secondTest() {
        System.out.println("second");
    }
}

Eclipse Hot Keys


  • Ctrl + Space - content assist
  • Ctrl + Shift + Space - context information
  • Ctrl + Shift + R - open resource
  • Ctrl + Shift + T - open type
  • Ctrl + Shift + G - find references in the workspace
  • Ctrl + H - search
  • Ctrl + L - go to line
  • Ctrl + W - close window
  • Ctrl + Shift + W - close all windows
  • Alt + Left - back history
  • Alt + Right - forward history
  • Ctrl + Shift + divide ('/') - collapse all
  • Ctrl + D - delete line
  • Ctrl + 8 - new editor in the same window, you can have as many as you wish
  • F2 - show tooltip
  • F3 or Ctrl + lmb click - open declaration
  • F4 - open type hierarchy
  • F12 - switch between source and design views
  • Ctrl + Shift + H - open type in hierarchy
  • Ctrl + E and Ctrl + Shift + E - switch to editor
  • Ctrl + Shift + Slash ('/') - add block comment
  • Ctrl + Shift + Backslash('\') - remove block comment
  • Ctrl + 7 or Ctrl + Slash ('/') or Ctrl + Shift + C - add/remove line comment
  • Ctrl + Shift + O - organize imports
  • Ctrl + Shift + F - format
  • Ctrl + Shift + I - inspect (use in debug)
  • Alt + Shift + O - mark occurances
  • Ctrl + O - quick outline
  • Alt + Shift + S - source quick menu
top