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 basedTestSource
with 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 boolean
equals(Object o)
static ClassSource
from(Class<?> javaClass)
Create a newClassSource
using the suppliedjavaClass
.static ClassSource
from(Class<?> javaClass, FilePosition filePosition)
static ClassSource
from(String className)
Create a newClassSource
using the supplied className.static ClassSource
from(String className, FilePosition filePosition)
Create a newClassSource
using the supplied className andfilePosition
.String
getClassName()
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.int
hashCode()
String
toString()
-
-
-
Method Detail
-
from
public static ClassSource from(String className)
Create a newClassSource
using the supplied className.- Parameters:
className
- the Java class name; must not benull
-
from
public static ClassSource from(String className, FilePosition filePosition)
Create a newClassSource
using the supplied className andfilePosition
.- Parameters:
className
- the Java class name; must not benull
filePosition
- the position in the Java source file; may benull
-
from
public static ClassSource from(Class<?> javaClass)
Create a newClassSource
using 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 benull
filePosition
- 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()
-
-