Class ClassSelector
- java.lang.Object
-
- org.junit.platform.engine.discovery.ClassSelector
-
- All Implemented Interfaces:
DiscoverySelector
@API(status=STABLE, since="1.0") public class ClassSelector extends java.lang.Object implements DiscoverySelector
ADiscoverySelector
that selects aClass
or class name so thatTestEngines
can discover tests or containers based on classes.If a Java
Class
reference is provided, the selector will return thatClass
and its class name accordingly. If a class name is provided, the selector will only attempt to lazily load theClass
ifgetJavaClass()
is 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.- Since:
- 1.0
- See Also:
ClassSource
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getClassName()
Get the selected class name.java.lang.Class<?>
getJavaClass()
Get the selectedClass
.java.lang.String
toString()
-
-
-
Method Detail
-
getClassName
public java.lang.String getClassName()
Get the selected class name.
-
getJavaClass
public java.lang.Class<?> getJavaClass()
Get the selectedClass
.If the
Class
was not provided, but only the name, this method attempts to lazily load theClass
based on its name and throws aPreconditionViolationException
if the class cannot be loaded.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-