public class TestClassFinder extends Object
| Modifier and Type | Class and Description |
|---|---|
private static class |
TestClassFinder.CustomClassloader |
private static class |
TestClassFinder.FileAndPath |
| Modifier and Type | Field and Description |
|---|---|
private static String |
basePath |
private static String |
BASEPKG |
static HBaseClassTestRule |
CLASS_RULE |
private static TestClassFinder.CustomClassloader |
classLoader |
private static AtomicLong |
jarCounter |
private static org.slf4j.Logger |
LOG |
org.junit.rules.TestName |
name |
private static String |
PREFIX |
private static AtomicLong |
testCounter |
private static HBaseCommonTestingUtility |
testUtil |
| Constructor and Description |
|---|
TestClassFinder() |
public static final HBaseClassTestRule CLASS_RULE
private static final org.slf4j.Logger LOG
public org.junit.rules.TestName name
private static final HBaseCommonTestingUtility testUtil
private static final String BASEPKG
private static final String PREFIX
private static AtomicLong testCounter
private static AtomicLong jarCounter
private static TestClassFinder.CustomClassloader classLoader
public TestClassFinder()
public static void createTestDir() throws IOException
IOExceptionpublic static void deleteTestDir()
public void testClassFinderCanFindClassesInJars() throws Exception
Exceptionpublic void testClassFinderHandlesConflicts() throws Exception
Exceptionpublic void testClassFinderHandlesNestedPackages() throws Exception
Exceptionpublic void testClassFinderFiltersByNameInJar() throws Exception
Exceptionpublic void testClassFinderFiltersByClassInJar() throws Exception
Exceptionprivate static String createAndLoadJar(String packageNameSuffix, String classNamePrefix, long counter) throws Exception
Exceptionpublic void testClassFinderFiltersByPathInJar() throws Exception
Exceptionpublic void testClassFinderCanFindClassesInDirs() throws Exception
Exceptionpublic void testClassFinderFiltersByNameInDirs() throws Exception
Exceptionpublic void testClassFinderFiltersByClassInDirs() throws Exception
Exceptionpublic void testClassFinderFiltersByPathInDirs() throws Exception
Exceptionpublic void testClassFinderDefaultsToOwnPackage() throws Exception
Exceptionprivate static Class<?> makeClass(String nestedPkgSuffix, String className, long counter) throws ClassNotFoundException
ClassNotFoundExceptionprivate static String makePackageName(String nestedSuffix, long counter)
private static TestClassFinder.FileAndPath compileTestClass(long counter, String packageNameSuffix, String classNamePrefix) throws Exception
counter - Unique test counter.packageNameSuffix - Package name suffix (e.g. ".suffix") for nesting, or "".Exceptionprivate static String packageAndLoadJar(TestClassFinder.FileAndPath... filesInJar) throws Exception
filesInJar - Files created via compileTestClass.ExceptionCopyright © 2007–2020 The Apache Software Foundation. All rights reserved.