Skip to content

Commit

Permalink
Merge pull request quarkusio#6732 from stuartwdouglas/test-exceptions
Browse files Browse the repository at this point in the history
Fix test exception handling
  • Loading branch information
gsmet authored Jan 23, 2020
2 parents d5204c6 + f45cc79 commit 1e222f0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,12 @@ private void runExtensionMethod(ReflectiveInvocationContext<Method> invocationCo
try {
newMethod.setAccessible(true);
newMethod.invoke(actualTestInstance, invocationContext.getArguments().toArray());
} catch (IllegalAccessException | InvocationTargetException e) {
} catch (InvocationTargetException e) {
if (e.getCause() instanceof RuntimeException) {
throw (RuntimeException) e.getCause();
}
throw new RuntimeException(e.getCause());
} catch (IllegalAccessException e) {
throw new RuntimeException(e);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,12 @@ private void runExtensionMethod(ReflectiveInvocationContext<Method> invocationCo
}
newMethod.setAccessible(true);
newMethod.invoke(actualTestInstance, invocationContext.getArguments().toArray());
} catch (Exception e) {
} catch (InvocationTargetException e) {
if (e.getCause() instanceof RuntimeException) {
throw (RuntimeException) e.getCause();
}
throw new RuntimeException(e.getCause());
} catch (IllegalAccessException | ClassNotFoundException e) {
throw new RuntimeException(e);
}
}
Expand Down

0 comments on commit 1e222f0

Please sign in to comment.