HBASE-23695 Fail gracefully if no category is present
Signed-off-by: Wellington Chevreuil <wchevreuil@apache.org> Closes #1052
This commit is contained in:
parent
68d3c201dd
commit
0935ba4e16
|
@ -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()) {
|
||||
|
|
Loading…
Reference in New Issue