Class DeclaredMethodSelector

  • All Implemented Interfaces:
    DiscoverySelector

    final class DeclaredMethodSelector
    extends java.lang.Object
    implements DiscoverySelector
    Jupiter-specific selector for methods, potentially in nested classes.

    The important difference to MethodSelector is that this selector's equals(Object) method takes into account the selected method's declaring class to support cases where a package-private method is declared in a super class in a different package and a method with the same signature is declared in a subclass. In that case both methods should be discovered because the one declared in the subclass does not override the one in the super class.

    Since:
    5.14.1
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.lang.reflect.Method method  
      private java.util.List<java.lang.Class<?>> testClasses  
    • Constructor Summary

      Constructors 
      Constructor Description
      DeclaredMethodSelector​(java.util.List<java.lang.Class<?>> testClasses, java.lang.reflect.Method method)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object o)  
      int hashCode()  
      (package private) java.lang.reflect.Method method()  
      (package private) java.util.List<java.lang.Class<?>> testClasses()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • testClasses

        private final java.util.List<java.lang.Class<?>> testClasses
      • method

        private final java.lang.reflect.Method method
    • Constructor Detail

      • DeclaredMethodSelector

        DeclaredMethodSelector​(java.util.List<java.lang.Class<?>> testClasses,
                               java.lang.reflect.Method method)
    • Method Detail

      • testClasses

        java.util.List<java.lang.Class<?>> testClasses()
      • method

        java.lang.reflect.Method method()
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object