Repository: hbase Updated Branches: refs/heads/master 8a7326dd4 -> cc6fe16e5
HBASE-11984 TestClassFinder failing on occasion -- Add DEBUGGING Project: http://git-wip-us.apache.org/repos/asf/hbase/repo Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/cc6fe16e Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/cc6fe16e Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/cc6fe16e Branch: refs/heads/master Commit: cc6fe16e592e1c4115b0c98db3d63ddd2d5a118b Parents: 8a7326d Author: stack <st...@apache.org> Authored: Mon Sep 15 21:36:00 2014 -0700 Committer: stack <st...@apache.org> Committed: Mon Sep 15 21:36:00 2014 -0700 ---------------------------------------------------------------------- .../java/org/apache/hadoop/hbase/TestClassFinder.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hbase/blob/cc6fe16e/hbase-common/src/test/java/org/apache/hadoop/hbase/TestClassFinder.java ---------------------------------------------------------------------- diff --git a/hbase-common/src/test/java/org/apache/hadoop/hbase/TestClassFinder.java b/hbase-common/src/test/java/org/apache/hadoop/hbase/TestClassFinder.java index bcdcd9b..52a17c9 100644 --- a/hbase-common/src/test/java/org/apache/hadoop/hbase/TestClassFinder.java +++ b/hbase-common/src/test/java/org/apache/hadoop/hbase/TestClassFinder.java @@ -42,8 +42,6 @@ import java.util.jar.Manifest; import javax.tools.JavaCompiler; import javax.tools.ToolProvider; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import org.apache.hadoop.hbase.testclassification.MiscTests; import org.apache.hadoop.hbase.testclassification.SmallTests; import org.junit.AfterClass; @@ -53,7 +51,6 @@ import org.junit.experimental.categories.Category; @Category({MiscTests.class, SmallTests.class}) public class TestClassFinder { - private static final Log LOG = LogFactory.getLog(TestClassFinder.class); private static final HBaseCommonTestingUtility testUtil = new HBaseCommonTestingUtility(); private static final String BASEPKG = "tfcpkg"; @@ -218,8 +215,9 @@ public class TestClassFinder { // Well, technically, we are not guaranteed that the classes will // be in dirs, but during normal build they would be. ClassFinder allClassesFinder = new ClassFinder(); - Set<Class<?>> allClasses = allClassesFinder.findClasses( - this.getClass().getPackage().getName(), false); + String pkg = this.getClass().getPackage().getName(); + Set<Class<?>> allClasses = allClassesFinder.findClasses(pkg, false); + assertTrue("Classes in " + pkg, allClasses.size() > 0); assertTrue(allClasses.contains(this.getClass())); assertTrue(allClasses.contains(ClassFinder.class)); } @@ -236,6 +234,7 @@ public class TestClassFinder { String thisPackage = this.getClass().getPackage().getName(); ClassFinder allClassesFinder = new ClassFinder(); Set<Class<?>> allClasses = allClassesFinder.findClasses(thisPackage, false); + assertTrue("Classes in " + thisPackage, allClasses.size() > 0); ClassFinder notThisClassFinder = new ClassFinder(null, notThisFilter, null); Set<Class<?>> notAllClasses = notThisClassFinder.findClasses(thisPackage, false); assertFalse(notAllClasses.contains(this.getClass())); @@ -253,6 +252,7 @@ public class TestClassFinder { String thisPackage = this.getClass().getPackage().getName(); ClassFinder allClassesFinder = new ClassFinder(); Set<Class<?>> allClasses = allClassesFinder.findClasses(thisPackage, false); + assertTrue("Classes in " + thisPackage, allClasses.size() > 0); ClassFinder notThisClassFinder = new ClassFinder(null, null, notThisFilter); Set<Class<?>> notAllClasses = notThisClassFinder.findClasses(thisPackage, false); assertFalse(notAllClasses.contains(this.getClass()));