Class SmartDirtiesTestsSorter

java.lang.Object
com.github.seregamorph.testsmartcontext.SmartDirtiesTestsSorter

public class SmartDirtiesTestsSorter extends Object
The logic of this class can be customized via
 META-INF/services/com.github.seregamorph.testsmartcontext.SmartDirtiesTestsSorter
 
defining subtype of this class overriding methods.
Author:
Sergey Chernov
  • Constructor Details

    • SmartDirtiesTestsSorter

      protected SmartDirtiesTestsSorter()
  • Method Details

    • getInstance

      public static SmartDirtiesTestsSorter getInstance()
    • sort

      public <T> TestSortResult sort(List<T> testItems, TestClassExtractor<? super T> testClassExtractor)
      Sorts passed testItems (contains both integration and unit tests) in-place, all tests are sequentially grouped by MergedContextConfiguration calculated per each test class.
      Parameters:
      testItems -
      testClassExtractor -
      Returns:
      integration test classes lists grouped by config (non-integration tests classes not included)
    • getNonItOrder

      protected int getNonItOrder()
      Get the order of non-integration test execution (bigger is later). Can be either first or last. 0 (first) by default.
    • initialSort

      protected <T> void initialSort(List<T> testItems, TestClassExtractor<? super T> testClassExtractor)