Class ClassSource
- java.lang.Object
-
- org.junit.platform.engine.support.descriptor.ClassSource
-
- All Implemented Interfaces:
Serializable,TestSource
@API(status=STABLE, since="1.0") public class ClassSource extends Object implements TestSource
Java class basedTestSourcewith an optional position.- Since:
- 1.0
- See Also:
ClassSelector, Serialized Form
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)static ClassSourcefrom(Class<?> javaClass)Create a newClassSourceusing the suppliedjavaClass.static ClassSourcefrom(Class<?> javaClass, FilePosition filePosition)static ClassSourcefrom(String className)Create a newClassSourceusing the supplied className.static ClassSourcefrom(String className, FilePosition filePosition)Create a newClassSourceusing the supplied className andfilePosition.StringgetClassName()Get the class name of this source.Class<?>getJavaClass()Get the Java class of this source.Optional<FilePosition>getPosition()Get the position in the Java source file for the associated Java class, if available.inthashCode()StringtoString()
-
-
-
Method Detail
-
from
public static ClassSource from(String className)
Create a newClassSourceusing the supplied className.- Parameters:
className- the Java class name; must not benull
-
from
public static ClassSource from(String className, FilePosition filePosition)
Create a newClassSourceusing the supplied className andfilePosition.- Parameters:
className- the Java class name; must not benullfilePosition- the position in the Java source file; may benull
-
from
public static ClassSource from(Class<?> javaClass)
Create a newClassSourceusing the suppliedjavaClass.- Parameters:
javaClass- the Java class; must not benull
-
from
public static ClassSource from(Class<?> javaClass, FilePosition filePosition)
- Parameters:
javaClass- the Java class; must not benullfilePosition- the position in the Java source file; may benull
-
getClassName
public final String getClassName()
Get the class name of this source.- See Also:
getPosition()
-
getJavaClass
public final Class<?> getJavaClass()
Get the Java class of this source.- See Also:
getPosition()
-
getPosition
public final Optional<FilePosition> getPosition()
Get the position in the Java source file for the associated Java class, if available.- See Also:
getJavaClass()
-
-