All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class junit.ui.TestCaseClassLoader

java.lang.Object
   |
   +----java.lang.ClassLoader
           |
           +----junit.ui.TestCaseClassLoader

public class TestCaseClassLoader
extends ClassLoader
A custom class loader which enables the reloading of classes for each test run. The class loader can be configured with a list of package paths that should be excluded from loading. The loading of these packages is delegated to the system class loader. They will be shared across test runs.

The list of excluded package paths is specified in a properties file "excluded.properties" that is located in the same place as the TestCaseClassLoader class.

Known limitation: the TestCaseClassLoader cannot load classes from jar files.


Constructor Index

 o TestCaseClassLoader()
Constructs a TestCaseLoader.

Method Index

 o getResource(String)
 o getResourceAsStream(String)
 o isExcluded(String)
 o loadClass(String, boolean)

Constructors

 o TestCaseClassLoader
 public TestCaseClassLoader()
Constructs a TestCaseLoader. It scans the class path and the excluded package paths

Methods

 o getResource
 public URL getResource(String name)
Overrides:
getResource in class ClassLoader
 o getResourceAsStream
 public InputStream getResourceAsStream(String name)
Overrides:
getResourceAsStream in class ClassLoader
 o isExcluded
 protected boolean isExcluded(String name)
 o loadClass
 public synchronized Class loadClass(String name,
                                     boolean resolve) throws ClassNotFoundException
Overrides:
loadClass in class ClassLoader

All Packages  Class Hierarchy  This Package  Previous  Next  Index