Class UnitTestMethodSorter

java.lang.Object
de.hsh.graja.regression.noisereduction.UnitTestMethodSorter

public class UnitTestMethodSorter extends Object
Unit test methods are stored by JUnit in a hash set, so the order of test method execution might vary between regression runs. This class provides an alphabetical sorter of test methods when in regression test mode (mock mode) and when there is no sorter specified in the test class.
  • Method Details

    • enableDefaultSortOrder

      public static void enableDefaultSortOrder()
      Enables mock mode globally
    • disableDefaultSortOrder

      public static void disableDefaultSortOrder()
      Disables mock mode globally
    • regressionTestableMethodSorter

      public static Comparator<String> regressionTestableMethodSorter(Comparator<String> definedByTestClass)
      If in mock mode this will return an alphabetical order of test methods, if the test class does not specify a specific sort order of test methods.