This is an automated email from the ASF dual-hosted git repository. elserj pushed a commit to branch branch-2.2 in repository https://gitbox.apache.org/repos/asf/hbase.git
The following commit(s) were added to refs/heads/branch-2.2 by this push: new c9ab243 HBASE-23695 Fail gracefully if no category is present c9ab243 is described below commit c9ab243a8f0365718ced3f1d9e4b7a1d1e87ebd9 Author: Josh Elser <els...@apache.org> AuthorDate: Wed Jan 15 14:26:34 2020 -0500 HBASE-23695 Fail gracefully if no category is present Signed-off-by: Wellington Chevreuil <wchevre...@apache.org> Closes #1052 --- .../java/org/apache/hadoop/hbase/HBaseClassTestRuleChecker.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/hbase-common/src/test/java/org/apache/hadoop/hbase/HBaseClassTestRuleChecker.java b/hbase-common/src/test/java/org/apache/hadoop/hbase/HBaseClassTestRuleChecker.java index 708f37c..8eb0bf8 100644 --- a/hbase-common/src/test/java/org/apache/hadoop/hbase/HBaseClassTestRuleChecker.java +++ b/hbase-common/src/test/java/org/apache/hadoop/hbase/HBaseClassTestRuleChecker.java @@ -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()) {