Class NestedClassSelector
- java.lang.Object
-
- org.junit.platform.engine.discovery.NestedClassSelector
-
- All Implemented Interfaces:
DiscoverySelector
@API(status=STABLE, since="1.6") public class NestedClassSelector extends Object implements DiscoverySelector
ADiscoverySelector
that selects a nestedClass
or class name enclosed in other classes so thatTestEngines
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 theseClass
and their class names accordingly. If class names are provided, the selector will only attempt to lazily load theClass
ifgetEnclosingClasses()
orgetNestedClass()
are invoked.In this context, Java
Class
means anything that can be referenced as aClass
on the JVM — for example, classes from other JVM languages such Groovy, Scala, etc.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
List<Class<?>>
getEnclosingClasses()
List<String>
getEnclosingClassNames()
Get the names of the classes enclosing the selected nested class.Class<?>
getNestedClass()
Get the selected nestedClass
.String
getNestedClassName()
Get the name of the selected nested class.int
hashCode()
String
toString()
-
-
-
Method Detail
-
getEnclosingClassNames
public List<String> getEnclosingClassNames()
Get the names of the classes enclosing the selected nested class.
-
getEnclosingClasses
public List<Class<?>> getEnclosingClasses()
Get the list ofClass
enclosing the selected nestedClass
.If the
Class
were not provided, but only the name of the nested class and its enclosing classes, this method attempts to lazily load the list of enclosingClass
and throws aPreconditionViolationException
if the classes cannot be loaded.
-
getNestedClassName
public String getNestedClassName()
Get the name of the selected nested class.
-
getNestedClass
public Class<?> getNestedClass()
Get the selected nestedClass
.If the
Class
were not provided, but only the name of the nested class and its enclosing classes, this method attempts to lazily load the nestedClass
and throws aPreconditionViolationException
if the class cannot be loaded.
-
-