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 java.lang.Object implements DiscoverySelectorADiscoverySelectorthat selects a nestedClassor class name enclosed in other classes so thatTestEnginescan discover tests or containers based on classes.If Java
Classreferences are provided for the nested class or the enclosing classes, the selector will return theseClassand their class names accordingly. If class names are provided, the selector will only attempt to lazily load theClassifgetEnclosingClasses()orgetNestedClass()are invoked.In this context, Java
Classmeans anything that can be referenced as aClasson 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 booleanequals(java.lang.Object o)java.util.List<java.lang.Class<?>>getEnclosingClasses()Get the list ofClassenclosing the selected nestedClass.java.util.List<java.lang.String>getEnclosingClassNames()Get the names of the classes enclosing the selected nested class.java.lang.Class<?>getNestedClass()Get the selected nestedClass.java.lang.StringgetNestedClassName()Get the name of the selected nested class.inthashCode()java.lang.StringtoString()
-
-
-
Method Detail
-
getEnclosingClassNames
public java.util.List<java.lang.String> getEnclosingClassNames()
Get the names of the classes enclosing the selected nested class.
-
getEnclosingClasses
public java.util.List<java.lang.Class<?>> 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
public java.lang.String getNestedClassName()
Get the name of the selected nested class.
-
getNestedClass
public java.lang.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
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-