public interface LambdaTest
Common interface shared between all supported test suites.
Modifier and Type | Method and Description |
---|---|
Reporter |
getReporter()
Gets the currently used reporter.
|
<T extends Throwable> |
intercept(Class<T> exceptionType,
RunnableWithException throwing)
Intercept exceptions of type
exceptionType and fail if no such
exception or an exception with an incompatible type was thrown. |
<T extends Throwable> |
intercept(Class<T> exceptionType,
String messageRegex,
RunnableWithException throwing)
Intercept exceptions of type
exceptionType and fail if no such
exception or an exception with an incompatible type was thrown or it the
message does not match a given pattern. |
void |
pending()
Marks the test as pending.
|
void |
pending(String reason)
Marks the test as pending and uses the given
reason as message. |
void |
setExpectFailFast(boolean failFast)
If
true , the first failed assertion will also fail the test. |
void |
setReporter(Reporter reporter)
Set the
Reporter to be used. |
void |
setRunInParallel(boolean runInParallel)
If
true tests in this suite can be run in parallel. |
void pending()
Marks the test as pending. Instructions after pending()
will not be
executed.
void pending(String reason)
Marks the test as pending and uses the given reason
as message.
Instructions after pending()
will not be executed.
<T extends Throwable> T intercept(Class<T> exceptionType, RunnableWithException throwing) throws Exception
Intercept exceptions of type exceptionType
and fail if no such
exception or an exception with an incompatible type was thrown.
exceptionType
- The exception type to intercept.throwing
- The execution block which is expected to throw the exception.Exception
- If no exception was thrown or an exception with an
incompatible type was thrown.<T extends Throwable> T intercept(Class<T> exceptionType, String messageRegex, RunnableWithException throwing) throws Exception
Intercept exceptions of type exceptionType
and fail if no such
exception or an exception with an incompatible type was thrown or it the
message does not match a given pattern.
exceptionType
- The exception type to intercept.messageRegex
- A regular expression pattern to match the expected message.
See Pattern
for details.throwing
- The execution block which is expected to throw the exception.Exception
- If no exception was thrown or an exception with an
incompatible type was thrown or if the message of the
exception did not match the expected pattern.void setRunInParallel(boolean runInParallel)
If true
tests in this suite can be run in parallel.
runInParallel
- If true
, tests may execute in parallel.void setExpectFailFast(boolean failFast)
If true
, the first failed assertion will also fail the test. If
false
, the test runs as long as possible, potentially collection
multipe failed assertions.
failFast
- If true
, to fail fast.void setReporter(Reporter reporter)
Set the Reporter
to be used.
reporter
- The Reporter
to be used.Reporter getReporter()
Gets the currently used reporter.
Copyright © 2019. All rights reserved.