joshelser commented on a change in pull request #1052: HBASE-23695 Fail
gracefully if no category is present
URL: https://github.com/apache/hbase/pull/1052#discussion_r367483211
##########
File path:
hbase-common/src/test/java/org/apache/hadoop/hbase/HBaseClassTestRuleChecker.java
##########
@@ -41,9 +41,12 @@
@Override
public void testStarted(Description description) throws Exception {
Category[] categories =
description.getTestClass().getAnnotationsByType(Category.class);
- for (Class<?> c : categories[0].value()) {
- if (c == IntegrationTests.class) {
- return;
+ // Don't fail if there is a missing category
+ if (categories.length > 0) {
+ for (Class<?> c : categories[0].value()) {
Review comment:
I'm not actually sure what all is allowed by `Category`. I would assume that
this for-loop handles both `@Category(OneInterface.class)` and
`@Category({InterfaceA.class,InterfaceB.class})`. I have to experiment to see
what else is actually allowable.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services