public class JavassistMockClassLoader extends MockClassLoader
Modifier and Type | Field and Description |
---|---|
static String |
CGLIB_ENHANCER |
static String |
CGLIB_METHOD_WRAPPER |
classMarker, classWrapperFactory, MODIFY_ALL_CLASSES
Constructor and Description |
---|
JavassistMockClassLoader(MockClassLoaderConfiguration configuration) |
JavassistMockClassLoader(MockClassLoaderConfiguration configuration,
UseClassPathAdjuster useClassPathAdjuster) |
JavassistMockClassLoader(String[] classesToMock) |
JavassistMockClassLoader(String[] classesToMock,
String[] packagesToDefer,
UseClassPathAdjuster useClassPathAdjuster) |
Modifier and Type | Method and Description |
---|---|
void |
cache(Class<?> cls)
Register a class to the cache of this classloader
|
protected byte[] |
defineAndTransformClass(String name,
ProtectionDomain protectionDomain) |
protected URL |
findResource(String name)
Finds the resource with the specified name on the search path.
|
protected Enumeration<URL> |
findResources(String name) |
protected Object |
getClassLoadingLock(String className) |
MockClassLoaderConfiguration |
getConfiguration() |
URL |
getResource(String s) |
InputStream |
getResourceAsStream(String s) |
Enumeration<URL> |
getResources(String name) |
protected Class<?> |
loadClass(String name,
boolean resolve) |
protected Class<?> |
loadUnmockedClass(String name,
ProtectionDomain protectionDomain) |
defineClass, getMockTransformerChain, loadClassByThisClassLoader, setMockTransformerChain, transformClass
clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findClass, findLibrary, findLoadedClass, findSystemClass, getPackage, getPackages, getParent, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, loadClass, registerAsParallelCapable, resolveClass, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners
public static final String CGLIB_ENHANCER
public static final String CGLIB_METHOD_WRAPPER
public JavassistMockClassLoader(String[] classesToMock)
public JavassistMockClassLoader(String[] classesToMock, String[] packagesToDefer, UseClassPathAdjuster useClassPathAdjuster)
public JavassistMockClassLoader(MockClassLoaderConfiguration configuration)
public JavassistMockClassLoader(MockClassLoaderConfiguration configuration, UseClassPathAdjuster useClassPathAdjuster)
protected Class<?> loadUnmockedClass(String name, ProtectionDomain protectionDomain) throws ClassFormatError, ClassNotFoundException
loadUnmockedClass
in class MockClassLoader
ClassFormatError
ClassNotFoundException
protected byte[] defineAndTransformClass(String name, ProtectionDomain protectionDomain)
defineAndTransformClass
in class MockClassLoader
public URL getResource(String s)
getResource
in class ClassLoader
public InputStream getResourceAsStream(String s)
getResourceAsStream
in class ClassLoader
public Enumeration<URL> getResources(String name) throws IOException
getResources
in class ClassLoader
IOException
public MockClassLoaderConfiguration getConfiguration()
public void cache(Class<?> cls)
protected Class<?> loadClass(String name, boolean resolve) throws ClassNotFoundException
loadClass
in class ClassLoader
ClassNotFoundException
protected Object getClassLoadingLock(String className)
getClassLoadingLock
in class ClassLoader
protected URL findResource(String name)
findResource
in class ClassLoader
name
- the name of the resourceURL
for the resource, or null
if the
resource could not be found.protected Enumeration<URL> findResources(String name) throws IOException
findResources
in class ClassLoader
IOException
Copyright © 2019. All rights reserved.