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 Object implements DiscoverySelector
ADiscoverySelectorthat selects aClassor class name so thatTestEnginescan discover tests or containers based on classes.If a Java
Classreference is provided, the selector will return thatClassand its class name accordingly. If a class name is provided, the selector will only attempt to lazily load theClassifgetJavaClass()is 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.- Since:
- 1.0
- See Also:
DiscoverySelectors.selectClass(String),DiscoverySelectors.selectClass(Class),ClassSource
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetClassName()Get the selected class name.Class<?>getJavaClass()Get the selectedClass.StringtoString()
-
-
-
Method Detail
-
getClassName
public String getClassName()
Get the selected class name.
-
getJavaClass
public Class<?> getJavaClass()
Get the selectedClass.If the
Classwas not provided, but only the name, this method attempts to lazily load theClassbased on its name and throws aPreconditionViolationExceptionif the class cannot be loaded.
-
-