Methods Summary |
---|
public void | setUp()
p = new Project();
p.init();
configureProject("src/etc/testcases/core/antclassloader.xml");
getProject().executeTarget("setup");
|
public void | tearDown()
getProject().executeTarget("cleanup");
|
public void | testCleanup()
Path path = new Path(p, ".");
AntClassLoader loader = p.createClassLoader(path);
try {
// we don't expect to find this
loader.findClass("fubar");
fail("Did not expect to find fubar class");
} catch (ClassNotFoundException e) {
// ignore expected
}
loader.cleanup();
try {
// we don't expect to find this
loader.findClass("fubar");
fail("Did not expect to find fubar class");
} catch (ClassNotFoundException e) {
// ignore expected
} catch (NullPointerException e) {
fail("loader should not fail even if cleaned up");
}
// tell the build it is finished
p.fireBuildFinished(null);
try {
// we don't expect to find this
loader.findClass("fubar");
fail("Did not expect to find fubar class");
} catch (ClassNotFoundException e) {
// ignore expected
} catch (NullPointerException e) {
fail("loader should not fail even if project finished");
}
|
public void | testJarWithManifestInDirWithSpace()
String mainjarstring = getProject().getProperty("main.jar");
String extjarstring = getProject().getProperty("ext.jar");
Path myPath = new Path(getProject());
myPath.setLocation(new File(mainjarstring));
getProject().setUserProperty("build.sysclasspath","ignore");
AntClassLoader myLoader = getProject().createClassLoader(myPath);
String path = myLoader.getClasspath();
assertEquals(mainjarstring + File.pathSeparator + extjarstring, path);
|
public void | testJarWithManifestInNonAsciiDir()
String mainjarstring = getProject().getProperty("main.jar.nonascii");
String extjarstring = getProject().getProperty("ext.jar.nonascii");
Path myPath = new Path(getProject());
myPath.setLocation(new File(mainjarstring));
getProject().setUserProperty("build.sysclasspath","ignore");
AntClassLoader myLoader = getProject().createClassLoader(myPath);
String path = myLoader.getClasspath();
assertEquals(mainjarstring + File.pathSeparator + extjarstring, path);
|