@Test
public void loadClassFromExtClasspathAndRunTest()
throws ClassNotFoundException {
logger.info("loadClassFromExtClasspathAndRunTest");
ClassFile cf = null;
FileClassLoader2 fcl = new FileClassLoader2(CLASSPATH_TESTPROJEKT);
cf = fcl.findClass(new File(CLASSPATH_TESTPROJEKT + DIRSEP + "de"
+ DIRSEP + "berndsteindorff" + DIRSEP + "junittca_local" + DIRSEP
+ "tests" + DIRSEP + "StocksSupportOkTest.class"));
assertEquals("de.berndsteindorff.junittca.tests.StocksSupportOkTest",
cf.getClassName());
assertEquals(CLASSPATH_TESTPROJEKT + DIRSEP, cf.getClassPath());
fcl = new FileClassLoader2(CLASSPATH_TESTPROJEKT);
List<ClassFile> classFiles = new ArrayList<ClassFile>(1);
classFiles.add(cf);
Result result = JUnitCore.runClasses(fcl.reloadClasses(classFiles).get(
0));
assertEquals(4, result.getRunCount());
assertEquals(0, result.getIgnoreCount());
assertEquals(0, result.getFailureCount());
}