Class ClassSource
- java.lang.Object
-
- org.junit.platform.engine.support.descriptor.ClassSource
-
- All Implemented Interfaces:
java.io.Serializable
,TestSource
@API(status=STABLE, since="1.0") public class ClassSource extends java.lang.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(java.lang.Object o)
static ClassSource
from(java.lang.Class<?> javaClass)
Create a newClassSource
using the suppliedjavaClass
.static ClassSource
from(java.lang.Class<?> javaClass, FilePosition filePosition)
static ClassSource
from(java.lang.String className)
Create a newClassSource
using the supplied className.static ClassSource
from(java.lang.String className, FilePosition filePosition)
Create a newClassSource
using the supplied className andfilePosition
.java.lang.String
getClassName()
Get the class name of this source.java.lang.Class<?>
getJavaClass()
Get the Java class of this source.java.util.Optional<FilePosition>
getPosition()
Get the position in the Java source file for the associated Java class, if available.int
hashCode()
java.lang.String
toString()
-
-
-
Method Detail
-
from
public static ClassSource from(java.lang.String className)
Create a newClassSource
using the supplied className.- Parameters:
className
- the Java class name; must not benull
-
from
public static ClassSource from(java.lang.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(java.lang.Class<?> javaClass)
Create a newClassSource
using the suppliedjavaClass
.- Parameters:
javaClass
- the Java class; must not benull
-
from
public static ClassSource from(java.lang.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 java.lang.String getClassName()
Get the class name of this source.- See Also:
getPosition()
-
getJavaClass
public final java.lang.Class<?> getJavaClass()
Get the Java class of this source.- See Also:
getPosition()
-
getPosition
public final java.util.Optional<FilePosition> getPosition()
Get the position in the Java source file for the associated Java class, if available.- See Also:
getJavaClass()
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-