Top Description Inners Fields Constructors Methods
org.junit.platform.launcher

public Class EngineDiscoveryResult

extends Object
Class Inheritance
Annotations
@API
status:STABLE
since:1.10
Static Imports
org.apiguardian.api.API.Status.STABLE

EngineDiscoveryResult encapsulates the result of test discovery by a org.junit.platform.engine.TestEngine.

A EngineDiscoveryResult consists of a mandatory Status and an optional Throwable.

Since
1.6

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static enum

Field Summary

Modifier and TypeField and Description
private final EngineDiscoveryResult.Status
private static final EngineDiscoveryResult
private final @Nullable Throwable

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static EngineDiscoveryResult

Returns:

the EngineDiscoveryResult; never null
failed
(@Nullable Throwable
the throwable that caused the failed discovery; may be null
throwable
)

Create a EngineDiscoveryResult for a failed test discovery.

public EngineDiscoveryResult.Status

Returns:

the status; never null
getStatus
()

Get the status of this result.

public Optional<Throwable>

Returns:

an Optional containing the throwable; never null but potentially empty
getThrowable
()

Get the throwable that caused this result, if available.

public static EngineDiscoveryResult

Returns:

the EngineDiscoveryResult; never null
successful
()

Create a EngineDiscoveryResult for a successful test discovery.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

statusback to summary
private final EngineDiscoveryResult.Status status
SUCCESSFUL_RESULTback to summary
private static final EngineDiscoveryResult SUCCESSFUL_RESULT
throwableback to summary
private final @Nullable Throwable throwable

Constructor Detail

EngineDiscoveryResultback to summary
private EngineDiscoveryResult(EngineDiscoveryResult.Status status, @Nullable Throwable throwable)

Method Detail

failedback to summary
public static EngineDiscoveryResult failed(@Nullable Throwable throwable)

Create a EngineDiscoveryResult for a failed test discovery.

Parameters
throwable:@Nullable Throwable

the throwable that caused the failed discovery; may be null

Returns:EngineDiscoveryResult

the EngineDiscoveryResult; never null

getStatusback to summary
public EngineDiscoveryResult.Status getStatus()

Get the status of this result.

Returns:EngineDiscoveryResult.Status

the status; never null

getThrowableback to summary
public Optional<Throwable> getThrowable()

Get the throwable that caused this result, if available.

Returns:Optional<Throwable>

an Optional containing the throwable; never null but potentially empty

successfulback to summary
public static EngineDiscoveryResult successful()

Create a EngineDiscoveryResult for a successful test discovery.

Returns:EngineDiscoveryResult

the EngineDiscoveryResult; never null

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Annotations
@Override
org.junit.platform.launcher back to summary

public final Enum EngineDiscoveryResult.Status

extends Enum<EngineDiscoveryResult.Status>
Class Inheritance

Status of test discovery by a org.junit.platform.engine.TestEngine.

Field Summary

Modifier and TypeField and Description
public static final EngineDiscoveryResult.Status
FAILED

Indicates that test discovery has failed.

public static final EngineDiscoveryResult.Status
SUCCESSFUL

Indicates that test discovery was successful.

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static EngineDiscoveryResult.Status
public static EngineDiscoveryResult.Status[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

FAILEDback to summary
public static final EngineDiscoveryResult.Status FAILED

Indicates that test discovery has failed.

SUCCESSFULback to summary
public static final EngineDiscoveryResult.Status SUCCESSFUL

Indicates that test discovery was successful.

Constructor Detail

Statusback to summary
private Status()

Method Detail

valueOfback to summary
public static EngineDiscoveryResult.Status valueOf(String name)
valuesback to summary
public static EngineDiscoveryResult.Status[] values()