public class JavassistMockClassLoader extends MockClassLoader
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CGLIB_ENHANCER |
static java.lang.String |
CGLIB_METHOD_WRAPPER |
classMarker, classWrapperFactory, MODIFY_ALL_CLASSES
Constructor and Description |
---|
JavassistMockClassLoader(MockClassLoaderConfiguration configuration) |
JavassistMockClassLoader(MockClassLoaderConfiguration configuration,
UseClassPathAdjuster useClassPathAdjuster) |
JavassistMockClassLoader(java.lang.String[] classesToMock) |
JavassistMockClassLoader(java.lang.String[] classesToMock,
java.lang.String[] packagesToDefer,
UseClassPathAdjuster useClassPathAdjuster) |
Modifier and Type | Method and Description |
---|---|
void |
cache(java.lang.Class<?> cls)
Register a class to the cache of this classloader
|
protected byte[] |
defineAndTransformClass(java.lang.String name,
java.security.ProtectionDomain protectionDomain) |
protected java.net.URL |
findResource(java.lang.String name)
Finds the resource with the specified name on the search path.
|
protected java.util.Enumeration<java.net.URL> |
findResources(java.lang.String name) |
protected java.lang.Object |
getClassLoadingLock(java.lang.String className) |
MockClassLoaderConfiguration |
getConfiguration() |
java.net.URL |
getResource(java.lang.String s) |
java.io.InputStream |
getResourceAsStream(java.lang.String s) |
java.util.Enumeration<java.net.URL> |
getResources(java.lang.String name) |
protected java.lang.Class<?> |
loadClass(java.lang.String name,
boolean resolve) |
protected java.lang.Class<?> |
loadUnmockedClass(java.lang.String name,
java.security.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 java.lang.String CGLIB_ENHANCER
public static final java.lang.String CGLIB_METHOD_WRAPPER
public JavassistMockClassLoader(java.lang.String[] classesToMock)
public JavassistMockClassLoader(java.lang.String[] classesToMock, java.lang.String[] packagesToDefer, UseClassPathAdjuster useClassPathAdjuster)
public JavassistMockClassLoader(MockClassLoaderConfiguration configuration)
public JavassistMockClassLoader(MockClassLoaderConfiguration configuration, UseClassPathAdjuster useClassPathAdjuster)
protected java.lang.Class<?> loadUnmockedClass(java.lang.String name, java.security.ProtectionDomain protectionDomain) throws java.lang.ClassFormatError, java.lang.ClassNotFoundException
loadUnmockedClass
in class MockClassLoader
java.lang.ClassFormatError
java.lang.ClassNotFoundException
protected byte[] defineAndTransformClass(java.lang.String name, java.security.ProtectionDomain protectionDomain)
defineAndTransformClass
in class MockClassLoader
public java.net.URL getResource(java.lang.String s)
getResource
in class java.lang.ClassLoader
public java.io.InputStream getResourceAsStream(java.lang.String s)
getResourceAsStream
in class java.lang.ClassLoader
public java.util.Enumeration<java.net.URL> getResources(java.lang.String name) throws java.io.IOException
getResources
in class java.lang.ClassLoader
java.io.IOException
public MockClassLoaderConfiguration getConfiguration()
public void cache(java.lang.Class<?> cls)
protected java.lang.Class<?> loadClass(java.lang.String name, boolean resolve) throws java.lang.ClassNotFoundException
loadClass
in class java.lang.ClassLoader
java.lang.ClassNotFoundException
protected java.lang.Object getClassLoadingLock(java.lang.String className)
getClassLoadingLock
in class java.lang.ClassLoader
protected java.net.URL findResource(java.lang.String name)
findResource
in class java.lang.ClassLoader
name
- the name of the resourceURL
for the resource, or null
if the
resource could not be found.protected java.util.Enumeration<java.net.URL> findResources(java.lang.String name) throws java.io.IOException
findResources
in class java.lang.ClassLoader
java.io.IOException