- java.lang.Object
-
- org.junit.platform.testkit.engine.Executions
-
@API(status=MAINTAINED, since="1.7") public final class Executions extends java.lang.Object
Executions
is a facade that provides a fluent API for working with executions.- Since:
- 1.4
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.String
category
private java.util.List<Execution>
executions
-
Constructor Summary
Constructors Modifier Constructor Description (package private)
Executions(java.util.List<Event> events, java.lang.String category)
private
Executions(java.util.stream.Stream<Execution> executions, java.lang.String category)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Executions
aborted()
Get the abortedExecutions
contained in thisExecutions
object.org.assertj.core.api.ListAssert<Execution>
assertThatExecutions()
Shortcut fororg.assertj.core.api.Assertions.assertThat(executions.list())
.long
count()
Get the number of executions contained in thisExecutions
object.private static java.util.List<Execution>
createExecutions(java.util.List<Event> events)
Create executions from the supplied list of events.Executions
debug()
Print all executions toSystem.out
.Executions
debug(java.io.OutputStream out)
Print all executions to the suppliedOutputStream
.private Executions
debug(java.io.PrintWriter printWriter)
Executions
debug(java.io.Writer writer)
Print all executions to the suppliedWriter
.private java.util.stream.Stream<Execution>
executionsByTerminationInfo(java.util.function.Predicate<TerminationInfo> predicate)
Executions
failed()
Get the failedExecutions
contained in thisExecutions
object.java.util.stream.Stream<Execution>
filter(java.util.function.Predicate<? super Execution> predicate)
Shortcut forexecutions.stream().filter(predicate)
.Executions
finished()
Get the finishedExecutions
contained in thisExecutions
object.private java.util.stream.Stream<Execution>
finishedExecutions()
private java.util.stream.Stream<Execution>
finishedExecutionsByStatus(TestExecutionResult.Status status)
java.util.List<Execution>
list()
Get the executions as aList
.<R> java.util.stream.Stream<R>
map(java.util.function.Function<? super Execution,? extends R> mapper)
Shortcut forexecutions.stream().map(mapper)
.Executions
skipped()
Get the skippedExecutions
contained in thisExecutions
object.Executions
started()
Get the startedExecutions
contained in thisExecutions
object.java.util.stream.Stream<Execution>
stream()
Get the executions as aStream
.Executions
succeeded()
Get the succeededExecutions
contained in thisExecutions
object.
-
-
-
Field Detail
-
executions
private final java.util.List<Execution> executions
-
category
private final java.lang.String category
-
-
Method Detail
-
list
public java.util.List<Execution> list()
Get the executions as aList
.- Returns:
- the list of executions; never
null
- See Also:
stream()
-
stream
public java.util.stream.Stream<Execution> stream()
Get the executions as aStream
.- Returns:
- the stream of executions; never
null
- See Also:
list()
-
map
public <R> java.util.stream.Stream<R> map(java.util.function.Function<? super Execution,? extends R> mapper)
Shortcut forexecutions.stream().map(mapper)
.- Parameters:
mapper
- aFunction
to apply to each execution; nevernull
- Returns:
- the mapped stream of executions; never
null
- See Also:
stream()
,Stream.map(Function)
-
filter
public java.util.stream.Stream<Execution> filter(java.util.function.Predicate<? super Execution> predicate)
Shortcut forexecutions.stream().filter(predicate)
.- Parameters:
predicate
- aPredicate
to apply to each execution to decide if it should be included in the filtered stream; nevernull
- Returns:
- the filtered stream of executions; never
null
- See Also:
stream()
,Stream.filter(Predicate)
-
count
public long count()
Get the number of executions contained in thisExecutions
object.
-
skipped
public Executions skipped()
Get the skippedExecutions
contained in thisExecutions
object.- Returns:
- the filtered
Executions
; nevernull
-
started
public Executions started()
Get the startedExecutions
contained in thisExecutions
object.- Returns:
- the filtered
Executions
; nevernull
-
finished
public Executions finished()
Get the finishedExecutions
contained in thisExecutions
object.- Returns:
- the filtered
Executions
; nevernull
-
aborted
public Executions aborted()
Get the abortedExecutions
contained in thisExecutions
object.- Returns:
- the filtered
Executions
; nevernull
-
succeeded
public Executions succeeded()
Get the succeededExecutions
contained in thisExecutions
object.- Returns:
- the filtered
Executions
; nevernull
-
failed
public Executions failed()
Get the failedExecutions
contained in thisExecutions
object.- Returns:
- the filtered
Executions
; nevernull
-
assertThatExecutions
public org.assertj.core.api.ListAssert<Execution> assertThatExecutions()
Shortcut fororg.assertj.core.api.Assertions.assertThat(executions.list())
.- Returns:
- an instance of
ListAssert
for executions; nevernull
- See Also:
Assertions.assertThat(List)
,ListAssert
-
debug
public Executions debug()
Print all executions toSystem.out
.- Returns:
- this
Executions
object for method chaining; nevernull
-
debug
public Executions debug(java.io.OutputStream out)
Print all executions to the suppliedOutputStream
.- Parameters:
out
- theOutputStream
to print to; nevernull
- Returns:
- this
Executions
object for method chaining; nevernull
-
debug
public Executions debug(java.io.Writer writer)
Print all executions to the suppliedWriter
.- Parameters:
writer
- theWriter
to print to; nevernull
- Returns:
- this
Executions
object for method chaining; nevernull
-
debug
private Executions debug(java.io.PrintWriter printWriter)
-
finishedExecutions
private java.util.stream.Stream<Execution> finishedExecutions()
-
finishedExecutionsByStatus
private java.util.stream.Stream<Execution> finishedExecutionsByStatus(TestExecutionResult.Status status)
-
executionsByTerminationInfo
private java.util.stream.Stream<Execution> executionsByTerminationInfo(java.util.function.Predicate<TerminationInfo> predicate)
-
-