|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.lang.ClassLoader
junit.runner.TestCaseClassLoader
public class TestCaseClassLoader
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. - Not needed for 1.0 SDK
| Field Summary | |
|---|---|
(package private) static String |
EXCLUDED_FILE
name of excluded properties file |
| Constructor Summary | |
|---|---|
TestCaseClassLoader()
Constructs a TestCaseLoader. |
|
TestCaseClassLoader(String classPath)
Constructs a TestCaseLoader. |
|
| Method Summary | |
|---|---|
URL |
getResource(String name)
Returns an URL which can be used to access the resource described by resName, using the class loader's resource lookup algorithm. |
InputStream |
getResourceAsStream(String name)
Returns a stream on a resource found by looking up resName using the class loader's resource lookup algorithm. |
boolean |
isExcluded(String name)
|
(package private) boolean |
isJar(String pathEntry)
|
Class |
loadClass(String name,
boolean resolve)
Loads the class with the specified name, optionally linking the class after load. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
static final String EXCLUDED_FILE
| Constructor Detail |
|---|
public TestCaseClassLoader()
public TestCaseClassLoader(String classPath)
| Method Detail |
|---|
public URL getResource(String name)
ClassLoader
getResource in class ClassLoadername - String the name of the resource to find.
Class.getResource(java.lang.String)public InputStream getResourceAsStream(String name)
ClassLoader
getResourceAsStream in class ClassLoadername - String the name of the resource to find.
Class.getResourceAsStream(java.lang.String)public boolean isExcluded(String name)
public Class loadClass(String name,
boolean resolve)
throws ClassNotFoundException
ClassLoader
loadClass in class ClassLoadername - The name of the class to search for.resolve - Indicates if class should be resolved after loading.
Note: On the android reference implementation this parameter
does not have any effect.
ClassNotFoundException - if the class could not be found.boolean isJar(String pathEntry)
|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||