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
IOException
public static void deleteTestDir()
public void testClassFinderCanFindClassesInJars() throws Exception
Exception
public void testClassFinderHandlesConflicts() throws Exception
Exception
public void testClassFinderHandlesNestedPackages() throws Exception
Exception
public void testClassFinderFiltersByNameInJar() throws Exception
Exception
public void testClassFinderFiltersByClassInJar() throws Exception
Exception
private static String createAndLoadJar(String packageNameSuffix, String classNamePrefix, long counter) throws Exception
Exception
public void testClassFinderFiltersByPathInJar() throws Exception
Exception
public void testClassFinderCanFindClassesInDirs() throws Exception
Exception
public void testClassFinderFiltersByNameInDirs() throws Exception
Exception
public void testClassFinderFiltersByClassInDirs() throws Exception
Exception
public void testClassFinderFiltersByPathInDirs() throws Exception
Exception
public void testClassFinderDefaultsToOwnPackage() throws Exception
Exception
private static Class<?> makeClass(String nestedPkgSuffix, String className, long counter) throws ClassNotFoundException
ClassNotFoundException
private 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 "".Exception
private static String packageAndLoadJar(TestClassFinder.FileAndPath... filesInJar) throws Exception
filesInJar
- Files created via compileTestClass.Exception
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.