Package org.testng

Interface ListenerComparator

  • All Superinterfaces:
    java.util.Comparator<ITestNGListener>
    Functional Interface:
    This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

    @FunctionalInterface
    public interface ListenerComparator
    extends java.util.Comparator<ITestNGListener>
    Listener interface that can be used to determine listener execution order. This interface will NOT be used to determine execution order for IReporter implementations.

    An implementation can be plugged into TestNG either via:

    1. TestNG.setListenerComparator(ListenerComparator) if you are using the TestNG APIs.
    2. Via the configuration parameter -listenercomparator if you are using a build tool
    • Method Summary

      Static Methods 
      Modifier and Type Method Description
      static <T extends ITestNGListener>
      java.util.Collection<T>
      sort​(java.util.Collection<T> list, ListenerComparator comparator)  
      static <T extends ITestNGListener>
      java.util.List<T>
      sort​(java.util.List<T> list, ListenerComparator comparator)  
      • Methods inherited from interface java.util.Comparator

        compare, equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong