stoty commented on code in PR #7955:
URL: https://github.com/apache/hadoop/pull/7955#discussion_r2348942795
##########
hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/test/GenericTestUtils.java:
##########
@@ -345,6 +356,33 @@ public static void assertExceptionContains(String
expectedText,
}
}
+ /**
+ * Assert that an exception's <code>toString()</code> value
+ * matches the pattern.
+ * @param pattern regex pattern to match
+ * @param t thrown exception
+ * @param message any extra text for the string
+ * @throws AssertionError if the expected string is not found
+ */
+ public static void assertExceptionMatches(Pattern pattern,
+ Throwable t,
Review Comment:
Same for the other suggestions.
##########
hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/test/GenericTestUtils.java:
##########
@@ -345,6 +356,33 @@ public static void assertExceptionContains(String
expectedText,
}
}
+ /**
+ * Assert that an exception's <code>toString()</code> value
+ * matches the pattern.
+ * @param pattern regex pattern to match
+ * @param t thrown exception
+ * @param message any extra text for the string
+ * @throws AssertionError if the expected string is not found
+ */
+ public static void assertExceptionMatches(Pattern pattern,
+ Throwable t,
Review Comment:
Thanks @steveloughran .
This method was cloned from assertExceptionContains.
I purposefully (and also out of lazyness) left it as close as possible to
assertExceptionContains().
While your suggested changes make sense, I think that there is more value in
keeping the implementations similar to each other.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]