Package org.junit.platform.launcher
Class EngineDiscoveryResult
- java.lang.Object
-
- org.junit.platform.launcher.EngineDiscoveryResult
-
@API(status=STABLE, since="1.10") public class EngineDiscoveryResult extends java.lang.ObjectEngineDiscoveryResultencapsulates the result of test discovery by aTestEngine.A
EngineDiscoveryResultconsists of a mandatoryStatusand an optionalThrowable.- Since:
- 1.6
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classEngineDiscoveryResult.StatusStatus of test discovery by aTestEngine.
-
Field Summary
Fields Modifier and Type Field Description private EngineDiscoveryResult.Statusstatusprivate static EngineDiscoveryResultSUCCESSFUL_RESULTprivate java.lang.Throwablethrowable
-
Constructor Summary
Constructors Modifier Constructor Description privateEngineDiscoveryResult(EngineDiscoveryResult.Status status, java.lang.Throwable throwable)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static EngineDiscoveryResultfailed(java.lang.Throwable throwable)Create aEngineDiscoveryResultfor a failed test discovery.EngineDiscoveryResult.StatusgetStatus()Get the status of this result.java.util.Optional<java.lang.Throwable>getThrowable()Get the throwable that caused this result, if available.static EngineDiscoveryResultsuccessful()Create aEngineDiscoveryResultfor a successful test discovery.java.lang.StringtoString()
-
-
-
Field Detail
-
SUCCESSFUL_RESULT
private static final EngineDiscoveryResult SUCCESSFUL_RESULT
-
status
private final EngineDiscoveryResult.Status status
-
throwable
private final java.lang.Throwable throwable
-
-
Constructor Detail
-
EngineDiscoveryResult
private EngineDiscoveryResult(EngineDiscoveryResult.Status status, java.lang.Throwable throwable)
-
-
Method Detail
-
successful
public static EngineDiscoveryResult successful()
Create aEngineDiscoveryResultfor a successful test discovery.- Returns:
- the
EngineDiscoveryResult; nevernull
-
failed
public static EngineDiscoveryResult failed(java.lang.Throwable throwable)
Create aEngineDiscoveryResultfor a failed test discovery.- Parameters:
throwable- the throwable that caused the failed discovery; may benull- Returns:
- the
EngineDiscoveryResult; nevernull
-
getStatus
public EngineDiscoveryResult.Status getStatus()
Get the status of this result.- Returns:
- the status; never
null
-
getThrowable
public java.util.Optional<java.lang.Throwable> getThrowable()
Get the throwable that caused this result, if available.- Returns:
- an
Optionalcontaining the throwable; nevernullbut potentially empty
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-