@API(status=EXPERIMENTAL,
since="1.6")
public class EngineDiscoveryResult
extends java.lang.Object
EngineDiscoveryResult
encapsulates the result of test discovery by a
TestEngine
.
A EngineDiscoveryResult
consists of a mandatory
Status
and an optional Throwable
.
Modifier and Type | Class and Description |
---|---|
static class |
EngineDiscoveryResult.Status
Status of test discovery by a
TestEngine . |
Modifier and Type | Field and Description |
---|---|
private EngineDiscoveryResult.Status |
status |
private static EngineDiscoveryResult |
SUCCESSFUL_RESULT |
private java.lang.Throwable |
throwable |
Modifier | Constructor and Description |
---|---|
private |
EngineDiscoveryResult(EngineDiscoveryResult.Status status,
java.lang.Throwable throwable) |
Modifier and Type | Method and Description |
---|---|
static EngineDiscoveryResult |
failed(java.lang.Throwable throwable)
Create a
EngineDiscoveryResult for a failed test
discovery. |
EngineDiscoveryResult.Status |
getStatus()
Get the status of this result.
|
java.util.Optional<java.lang.Throwable> |
getThrowable()
Get the throwable that caused this result, if available.
|
static EngineDiscoveryResult |
successful()
Create a
EngineDiscoveryResult for a successful test
discovery. |
java.lang.String |
toString() |
private static final EngineDiscoveryResult SUCCESSFUL_RESULT
private final EngineDiscoveryResult.Status status
private final java.lang.Throwable throwable
private EngineDiscoveryResult(EngineDiscoveryResult.Status status, java.lang.Throwable throwable)
public static EngineDiscoveryResult successful()
EngineDiscoveryResult
for a successful test
discovery.EngineDiscoveryResult
; never null
public static EngineDiscoveryResult failed(java.lang.Throwable throwable)
EngineDiscoveryResult
for a failed test
discovery.throwable
- the throwable that caused the failed discovery; may be
null
EngineDiscoveryResult
; never null
public EngineDiscoveryResult.Status getStatus()
null
public java.util.Optional<java.lang.Throwable> getThrowable()
Optional
containing the throwable; never null
but potentially emptypublic java.lang.String toString()
toString
in class java.lang.Object