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:32 UTC
[hbase] branch branch-2.1 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.1
in repository https://gitbox.apache.org/repos/asf/hbase.git
The following commit(s) were added to refs/heads/branch-2.1 by this push:
new ebbef87 HBASE-23695 Fail gracefully if no category is present
ebbef87 is described below
commit ebbef875f6161c03eb3edd70d01fe58fc1b90385
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 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()) {