hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ndimi...@apache.org
Subject hbase git commit: HBASE-14382 TestInterfaceAudienceAnnotations should hadoop-compt module resources
Date Wed, 09 Sep 2015 18:49:48 GMT
Repository: hbase
Updated Branches:
  refs/heads/branch-1.1 43d5523b6 -> 1e91cd2b2


HBASE-14382 TestInterfaceAudienceAnnotations should hadoop-compt module resources


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/1e91cd2b
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/1e91cd2b
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/1e91cd2b

Branch: refs/heads/branch-1.1
Commit: 1e91cd2b276fe6f4c94e197d1e5ebdd566046e68
Parents: 43d5523
Author: Nick Dimiduk <ndimiduk@apache.org>
Authored: Wed Sep 9 11:08:28 2015 -0700
Committer: Nick Dimiduk <ndimiduk@apache.org>
Committed: Wed Sep 9 11:37:52 2015 -0700

----------------------------------------------------------------------
 .../hbase/TestInterfaceAudienceAnnotations.java    |  8 ++++++--
 .../java/org/apache/hadoop/hbase/ClassFinder.java  | 17 ++++++++++++++++-
 .../org/apache/hadoop/hbase/ClassTestFinder.java   |  1 +
 3 files changed, 23 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/1e91cd2b/hbase-client/src/test/java/org/apache/hadoop/hbase/TestInterfaceAudienceAnnotations.java
----------------------------------------------------------------------
diff --git a/hbase-client/src/test/java/org/apache/hadoop/hbase/TestInterfaceAudienceAnnotations.java
b/hbase-client/src/test/java/org/apache/hadoop/hbase/TestInterfaceAudienceAnnotations.java
index be79278..0e0fbb0 100644
--- a/hbase-client/src/test/java/org/apache/hadoop/hbase/TestInterfaceAudienceAnnotations.java
+++ b/hbase-client/src/test/java/org/apache/hadoop/hbase/TestInterfaceAudienceAnnotations.java
@@ -231,13 +231,15 @@ public class TestInterfaceAudienceAnnotations {
 
     // find classes that are:
     // In the main jar
+    // AND are not in a hadoop-compat module
     // AND are public
     // NOT test classes
     // AND NOT generated classes
     // AND are NOT annotated with InterfaceAudience
     // AND are NOT from Clover rewriting sources
     ClassFinder classFinder = new ClassFinder(
-      new MainCodeResourcePathFilter(),
+      new And(new MainCodeResourcePathFilter(),
+              new TestFileNameFilter()),
       new Not((FileNameFilter)new TestFileNameFilter()),
       new And(new PublicClassFilter(),
               new Not(new TestClassFilter()),
@@ -268,13 +270,15 @@ public class TestInterfaceAudienceAnnotations {
 
     // find classes that are:
     // In the main jar
+    // AND are not in a hadoop-compat module
     // AND are public
     // NOT test classes
     // AND NOT generated classes
     // AND are annotated with InterfaceAudience.Public
     // AND NOT annotated with InterfaceStability
     ClassFinder classFinder = new ClassFinder(
-      new MainCodeResourcePathFilter(),
+      new And(new MainCodeResourcePathFilter(),
+              new TestFileNameFilter()),
       new Not((FileNameFilter)new TestFileNameFilter()),
       new And(new PublicClassFilter(),
               new Not(new TestClassFilter()),

http://git-wip-us.apache.org/repos/asf/hbase/blob/1e91cd2b/hbase-common/src/test/java/org/apache/hadoop/hbase/ClassFinder.java
----------------------------------------------------------------------
diff --git a/hbase-common/src/test/java/org/apache/hadoop/hbase/ClassFinder.java b/hbase-common/src/test/java/org/apache/hadoop/hbase/ClassFinder.java
index c63f78d..2e0436c 100644
--- a/hbase-common/src/test/java/org/apache/hadoop/hbase/ClassFinder.java
+++ b/hbase-common/src/test/java/org/apache/hadoop/hbase/ClassFinder.java
@@ -85,9 +85,15 @@ public class ClassFinder {
     }
   }
 
-  public static class And implements ClassFilter {
+  public static class And implements ClassFilter, ResourcePathFilter {
     ClassFilter[] classFilters;
+    ResourcePathFilter[] resourcePathFilters;
+
     public And(ClassFilter...classFilters) { this.classFilters = classFilters; }
+    public And(ResourcePathFilter... resourcePathFilters) {
+      this.resourcePathFilters = resourcePathFilters;
+    }
+
     @Override
     public boolean isCandidateClass(Class<?> c) {
       for (ClassFilter filter : classFilters) {
@@ -97,6 +103,15 @@ public class ClassFinder {
       }
       return true;
     }
+
+    @Override public boolean isCandidatePath(String resourcePath, boolean isJar) {
+      for (ResourcePathFilter filter : resourcePathFilters) {
+        if (!filter.isCandidatePath(resourcePath, isJar)) {
+          return false;
+        }
+      }
+      return true;
+    }
   }
 
   public ClassFinder() {

http://git-wip-us.apache.org/repos/asf/hbase/blob/1e91cd2b/hbase-common/src/test/java/org/apache/hadoop/hbase/ClassTestFinder.java
----------------------------------------------------------------------
diff --git a/hbase-common/src/test/java/org/apache/hadoop/hbase/ClassTestFinder.java b/hbase-common/src/test/java/org/apache/hadoop/hbase/ClassTestFinder.java
index 18368a4..fe88623 100644
--- a/hbase-common/src/test/java/org/apache/hadoop/hbase/ClassTestFinder.java
+++ b/hbase-common/src/test/java/org/apache/hadoop/hbase/ClassTestFinder.java
@@ -50,6 +50,7 @@ public class ClassTestFinder extends ClassFinder {
     return new Class<?>[0];
   }
 
+  /** Filters both test classes and anything in the hadoop-compat modules */
   public static class TestFileNameFilter implements FileNameFilter, ResourcePathFilter {
     private static final Pattern hadoopCompactRe =
         Pattern.compile("hbase-hadoop\\d?-compat");


Mime
View raw message