|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.lang.ClassLoader java.security.SecureClassLoader java.net.URLClassLoader org.jwalk.GeneratorLoader org.jwalk.TestClassLoader
public class TestClassLoader
TestClassLoader is a class loader for loading the test class. Every time the test class is reloaded, it must use a new instance of TestClassLoader to ensure that it is indeed reloaded, rather than fetched from the cache of loaded classes. This allows a modified test class to be recompiled and reloaded by JWalk tools within the same Java runtime. Any other class on which the test class depends is loaded by the delegate ClassLoader, which should always be the GeneratorLoader created by JWalk at start-up. This allows both the test class and arbitrary custom generators to refer to common classes, which are resolved just once in the current Java runtime.
Constructor Summary | |
---|---|
TestClassLoader(java.lang.ClassLoader delegate,
java.lang.String name)
Creates a TestClassLoader which treats the test class as special. |
Method Summary | |
---|---|
java.lang.Class<?> |
loadClass(java.lang.String name)
Loads the class specified by the package-qualified name. |
Methods inherited from class org.jwalk.GeneratorLoader |
---|
addDirectory |
Methods inherited from class java.net.URLClassLoader |
---|
addURL, definePackage, findClass, findResource, findResources, getPermissions, getURLs, newInstance, newInstance |
Methods inherited from class java.security.SecureClassLoader |
---|
defineClass, defineClass |
Methods inherited from class java.lang.ClassLoader |
---|
clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findLibrary, findLoadedClass, findSystemClass, getPackage, getPackages, getParent, getResource, getResourceAsStream, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, loadClass, resolveClass, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TestClassLoader(java.lang.ClassLoader delegate, java.lang.String name)
delegate
- the delegate ClassLoader to use for all other classes.name
- the package-qualified name of the test class.Method Detail |
---|
public java.lang.Class<?> loadClass(java.lang.String name) throws java.lang.ClassNotFoundException
loadClass
in class java.lang.ClassLoader
name
- a package-qualified test class name.
java.lang.ClassNotFoundException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |