Package org.infinispan.commons.test
Class Exceptions
java.lang.Object
org.infinispan.commons.test.Exceptions
Utility methods for testing expected exceptions.
- Since:
- 8.2
- Author:
- Dan Berindei
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidassertException(Class<? extends Throwable> wrapperExceptionClass3, Class<? extends Throwable> wrapperExceptionClass2, Class<? extends Throwable> wrapperExceptionClass, Class<? extends Throwable> exceptionClass, Throwable t) static voidassertException(Class<? extends Throwable> wrapperExceptionClass2, Class<? extends Throwable> wrapperExceptionClass, Class<? extends Throwable> exceptionClass, String messageRegex, Throwable t) static voidassertException(Class<? extends Throwable> wrapperExceptionClass2, Class<? extends Throwable> wrapperExceptionClass, Class<? extends Throwable> exceptionClass, Throwable t) static voidassertException(Class<? extends Throwable> wrapperExceptionClass, Class<? extends Throwable> exceptionClass, String messageRegex, Throwable t) static voidassertException(Class<? extends Throwable> wrapperExceptionClass, Class<? extends Throwable> exceptionClass, Throwable t) static voidassertException(Class<? extends Throwable> exceptionClass, String messageRegex, Throwable t) static voidassertException(Class<? extends Throwable> exceptionClass, Throwable t) static voidassertExceptionNonStrict(Class<? extends Throwable> exceptionClass, Throwable t) Expect an exception of classexceptionClassor its subclasses.static voidexpectCompletionException(Class<? extends Throwable> wrapperExceptionClass2, Class<? extends Throwable> wrapperExceptionClass, Class<? extends Throwable> exceptionClass, String messageRegex, CompletionStage<?> stage) static voidexpectCompletionException(Class<? extends Throwable> wrapperExceptionClass2, Class<? extends Throwable> wrapperExceptionClass, Class<? extends Throwable> exceptionClass, CompletionStage<?> stage) static voidexpectCompletionException(Class<? extends Throwable> wrapperExceptionClass, Class<? extends Throwable> exceptionClass, String messageRegex, CompletionStage<?> stage) static voidexpectCompletionException(Class<? extends Throwable> wrapperExceptionClass, Class<? extends Throwable> exceptionClass, CompletionStage<?> stage) static voidexpectCompletionException(Class<? extends Throwable> exceptionClass, String messageRegex, CompletionStage<?> stage) static voidexpectCompletionException(Class<? extends Throwable> exceptionClass, String messageRegex, CompletionStage<?> stage, long timeout, TimeUnit unit) static voidexpectCompletionException(Class<? extends Throwable> exceptionClass, CompletionStage<?> stage) static voidexpectException(Class<? extends Throwable> wrapperExceptionClass2, Class<? extends Throwable> wrapperExceptionClass1, Class<? extends Throwable> exceptionClass, String regex, ExceptionRunnable runnable) static voidexpectException(Class<? extends Throwable> wrapperExceptionClass2, Class<? extends Throwable> wrapperExceptionClass1, Class<? extends Throwable> exceptionClass, ExceptionRunnable runnable) static voidexpectException(Class<? extends Throwable> wrapperExceptionClass, Class<? extends Throwable> exceptionClass, String messageRegex, ExceptionRunnable runnable) static voidexpectException(Class<? extends Throwable> wrapperExceptionClass, Class<? extends Throwable> exceptionClass, ExceptionRunnable runnable) static voidexpectException(Class<? extends Throwable> exceptionClass, String messageRegex, ExceptionRunnable runnable) static voidexpectException(Class<? extends Throwable> exceptionClass, ExceptionRunnable runnable) static voidexpectException(String regex, ExceptionRunnable runnable, Class<? extends Throwable>... wrapperExceptionClass) static voidexpectExceptionNonStrict(Class<? extends Throwable> we2, Class<? extends Throwable> we1, Class<? extends Throwable> e, ExceptionRunnable runnable) static voidexpectExceptionNonStrict(Class<? extends Throwable> we1, Class<? extends Throwable> e, ExceptionRunnable runnable) static voidexpectExceptionNonStrict(Class<? extends Throwable> e, ExceptionRunnable runnable) static voidexpectExecutionException(Class<? extends Throwable> wrapperExceptionClass2, Class<? extends Throwable> wrapperExceptionClass, Class<? extends Throwable> exceptionClass, String messageRegex, Future<?> future) static voidexpectExecutionException(Class<? extends Throwable> wrapperExceptionClass2, Class<? extends Throwable> wrapperExceptionClass, Class<? extends Throwable> exceptionClass, Future<?> future) static voidexpectExecutionException(Class<? extends Throwable> wrapperExceptionClass, Class<? extends Throwable> exceptionClass, String messageRegex, Future<?> future) static voidexpectExecutionException(Class<? extends Throwable> wrapperExceptionClass, Class<? extends Throwable> exceptionClass, Future<?> future) static voidexpectExecutionException(Class<? extends Throwable> exceptionClass, String messageRegex, Future<?> future) static voidexpectExecutionException(Class<? extends Throwable> exceptionClass, String messageRegex, Future<?> future, long timeout, TimeUnit unit) static voidexpectExecutionException(Class<? extends Throwable> exceptionClass, Future<?> future) static voidexpectRootCause(Class<? extends Throwable> exceptionClass, ExceptionRunnable runnable) static ThrowableextractException(ExceptionRunnable runnable) static Throwablestatic <T> Tstatic voidunchecked(ExceptionRunnable runnable) static <T> TuncheckedThrowable(ThrowableSupplier<T> supplier)
-
Constructor Details
-
Exceptions
public Exceptions()
-
-
Method Details
-
assertException
-
assertException
-
assertExceptionNonStrict
Expect an exception of classexceptionClassor its subclasses. -
assertException
-
assertException
-
assertException
-
assertException
-
assertException
-
expectException
public static void expectException(Class<? extends Throwable> exceptionClass, String messageRegex, ExceptionRunnable runnable) -
expectException
-
expectException
-
expectException
-
expectException
public static void expectException(Class<? extends Throwable> exceptionClass, ExceptionRunnable runnable) -
expectException
public static void expectException(Class<? extends Throwable> wrapperExceptionClass, Class<? extends Throwable> exceptionClass, ExceptionRunnable runnable) -
expectException
@SafeVarargs public static void expectException(String regex, ExceptionRunnable runnable, Class<? extends Throwable>... wrapperExceptionClass) -
expectRootCause
public static void expectRootCause(Class<? extends Throwable> exceptionClass, ExceptionRunnable runnable) -
expectExceptionNonStrict
public static void expectExceptionNonStrict(Class<? extends Throwable> e, ExceptionRunnable runnable) -
expectExceptionNonStrict
public static void expectExceptionNonStrict(Class<? extends Throwable> we1, Class<? extends Throwable> e, ExceptionRunnable runnable) -
expectExceptionNonStrict
-
expectExecutionException
-
expectExecutionException
-
expectExecutionException
-
expectExecutionException
-
expectExecutionException
-
expectExecutionException
-
expectExecutionException
-
expectCompletionException
public static void expectCompletionException(Class<? extends Throwable> exceptionClass, String messageRegex, CompletionStage<?> stage) -
expectCompletionException
public static void expectCompletionException(Class<? extends Throwable> exceptionClass, String messageRegex, CompletionStage<?> stage, long timeout, TimeUnit unit) -
expectCompletionException
-
expectCompletionException
-
expectCompletionException
public static void expectCompletionException(Class<? extends Throwable> exceptionClass, CompletionStage<?> stage) -
expectCompletionException
public static void expectCompletionException(Class<? extends Throwable> wrapperExceptionClass, Class<? extends Throwable> exceptionClass, CompletionStage<?> stage) -
expectCompletionException
-
extractException
-
getRootCause
-
unchecked
-
unchecked
-
uncheckedThrowable
-