Class NestedClassSelector
- All Implemented Interfaces:
DiscoverySelector
DiscoverySelector that selects a nested Class
or class name enclosed in other classes so that
TestEngines can discover
tests or containers based on classes.
If Java Class references are provided for the nested class or
the enclosing classes, the selector will return those classes and their class
names accordingly. If class names are provided, the selector will only attempt
to lazily load classes if getEnclosingClasses() or
getNestedClass() is invoked.
In this context, Java Class means anything that can be referenced
as a Class on the JVM — for example, classes from other JVM
languages such Groovy, Scala, etc.
- Since:
- 1.6
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class -
Method Summary
Modifier and TypeMethodDescriptionboolean@Nullable ClassLoaderGet theClassLoaderused to load the selected nested class.Get the names of the classes enclosing the selected nested class.Class<?> Get the selected nestedClass.Get the name of the selected nested class.inthashCode()Return the identifier of this selector.toString()
-
Method Details
-
getClassLoader
Get theClassLoaderused to load the selected nested class.- Returns:
- the
ClassLoader; potentiallynull - Since:
- 1.10
-
getEnclosingClassNames
-
getEnclosingClasses
Get the list ofClassenclosing the selected nestedClass.If the
Classwere not provided, but only the name of the nested class and its enclosing classes, this method attempts to lazily load the list of enclosingClassand throws aPreconditionViolationExceptionif the classes cannot be loaded. -
getNestedClassName
Get the name of the selected nested class. -
getNestedClass
Get the selected nestedClass.If the
Classwere not provided, but only the name of the nested class and its enclosing classes, this method attempts to lazily load the nestedClassand throws aPreconditionViolationExceptionif the class cannot be loaded. -
equals
-
hashCode
-
toString
-
toIdentifier
Description copied from interface:DiscoverySelectorReturn the identifier of this selector.The returned identifier must be parsable by a corresponding
DiscoverySelectorIdentifierParser.The default implementation returns
Optional.empty(). Can be overridden by concrete implementations.- Specified by:
toIdentifierin interfaceDiscoverySelector- Returns:
- an
Optionalcontaining the identifier of this selector; nevernullbut potentially empty if the selector does not support identifiers
-