hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From els...@apache.org
Subject [hbase] branch master updated: HBASE-23695 Fail gracefully if no category is present
Date Thu, 16 Jan 2020 15:25:34 GMT
This is an automated email from the ASF dual-hosted git repository.

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


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

commit edc53683c491e042f8856180ec07d01f0602a10e
Author: Josh Elser <elserj@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 <wchevreuil@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()) {


Mime
View raw message