You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by el...@apache.org on 2020/01/16 15:25:31 UTC

[hbase] branch branch-2 updated: HBASE-23695 Fail gracefully if no category is present

This is an automated email from the ASF dual-hosted git repository.

elserj pushed a commit to branch branch-2
in repository https://gitbox.apache.org/repos/asf/hbase.git


The following commit(s) were added to refs/heads/branch-2 by this push:
     new 0935ba4  HBASE-23695 Fail gracefully if no category is present
0935ba4 is described below

commit 0935ba4e1620aaee79368fe38715a89ee4533178
Author: Josh Elser <el...@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 <wc...@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 2508a27..45884eb 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()) {