Github user aledsage commented on a diff in the pull request:
https://github.com/apache/incubator-brooklyn/pull/1093#discussion_r47370769
--- Diff:
core/src/test/java/org/apache/brooklyn/core/location/LocationExtensionsTest.java
---
@@ -164,21 +166,24 @@ public void
testAddExtensionThroughLocationSpecIllegally() {
try {
Location loc = createConcrete(MyExtension.class, "not an
extension");
fail("loc="+loc);
- } catch (IllegalArgumentException e) {
+ } catch (Exception e) {
+ assertTrue(Exceptions.getFirstInteresting(e) instanceof
IllegalArgumentException);
--- End diff --
I prefer that `e` is rethrown if it doesn't match, rather than losing the
exception in the error report. Alex (I think it was) added:
Asserts.expectedFailureOfType(e, IllegalArgumentException.class)
But not sure if that deals with looking at the `causedBy` properly.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---