Skip to content

Commit

Permalink
HBASE-23695 Fail gracefully if no category is present
Browse files Browse the repository at this point in the history
Signed-off-by: Wellington Chevreuil <wchevreuil@apache.org>

Closes #1052
  • Loading branch information
joshelser committed Jan 16, 2020
1 parent 0321f56 commit edc5368
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,12 @@ public class HBaseClassTestRuleChecker extends RunListener {
@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()) {
if (c == IntegrationTests.class) {
return;
}
}
}
for (Field field : description.getTestClass().getFields()) {
Expand Down

0 comments on commit edc5368

Please sign in to comment.