Package org.junit.platform.engine
Class SelectorResolutionResult
- java.lang.Object
-
- org.junit.platform.engine.SelectorResolutionResult
-
@API(status=EXPERIMENTAL, since="1.6") public class SelectorResolutionResult extends java.lang.ObjectSelectorResolutionResultencapsulates the result of resolving aDiscoverySelectorby aTestEngine.A
SelectorResolutionResultconsists of a mandatoryStatusand an optionalThrowable.- Since:
- 1.6
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSelectorResolutionResult.StatusStatus of resolving aDiscoverySelector.
-
Field Summary
Fields Modifier and Type Field Description private static SelectorResolutionResultRESOLVED_RESULTprivate SelectorResolutionResult.Statusstatusprivate java.lang.Throwablethrowableprivate static SelectorResolutionResultUNRESOLVED_RESULT
-
Constructor Summary
Constructors Modifier Constructor Description privateSelectorResolutionResult(SelectorResolutionResult.Status status, java.lang.Throwable throwable)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static SelectorResolutionResultfailed(java.lang.Throwable throwable)Create aSelectorResolutionResultfor a failed selector resolution.SelectorResolutionResult.StatusgetStatus()Get the status of this result.java.util.Optional<java.lang.Throwable>getThrowable()Get the throwable that caused this result, if available.static SelectorResolutionResultresolved()Create aSelectorResolutionResultfor a resolved selector.java.lang.StringtoString()static SelectorResolutionResultunresolved()Create aSelectorResolutionResultfor an unresolved selector.
-
-
-
Field Detail
-
RESOLVED_RESULT
private static final SelectorResolutionResult RESOLVED_RESULT
-
UNRESOLVED_RESULT
private static final SelectorResolutionResult UNRESOLVED_RESULT
-
status
private final SelectorResolutionResult.Status status
-
throwable
private final java.lang.Throwable throwable
-
-
Constructor Detail
-
SelectorResolutionResult
private SelectorResolutionResult(SelectorResolutionResult.Status status, java.lang.Throwable throwable)
-
-
Method Detail
-
resolved
public static SelectorResolutionResult resolved()
Create aSelectorResolutionResultfor a resolved selector.- Returns:
- the
SelectorResolutionResult; nevernull
-
unresolved
public static SelectorResolutionResult unresolved()
Create aSelectorResolutionResultfor an unresolved selector.- Returns:
- the
SelectorResolutionResult; nevernull
-
failed
public static SelectorResolutionResult failed(java.lang.Throwable throwable)
Create aSelectorResolutionResultfor a failed selector resolution.- Returns:
- the
SelectorResolutionResult; nevernull
-
getStatus
public SelectorResolutionResult.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
-
-