use of com.kyj.fx.voeditor.visual.loder.ProjectInfo in project Gargoyle by callakrsos.
the class DynamicClassLoaderTest method loadTest3.
/**
* classpath를 찾고 classpath의 컴파일 폴더를 기준으로 컴파일을 처리한뒤 정상적으로 특정클래스가 로딩되는지를
* 테스트한다.
*
* @작성자 : KYJ
* @작성일 : 2015. 10. 26.
* @throws Exception
*/
@Test
public void loadTest3() throws Exception {
ClassPath parsingClassPath = DynamicClassLoader.parsingClassPath("C:/Users/KYJ/JAVA_FX/webWorkspace");
List<ClassPathEntry> entryFilter = parsingClassPath.entryFilter(entry -> ValueUtil.isNotEmpty(entry.getOutput()));
entryFilter.forEach(entry -> {
try {
String filePathName = parsingClassPath.getFilePathName();
System.out.println(filePathName);
String replaceFirst = filePathName.replaceFirst(".classPath", "");
String output = entry.getOutput();
System.out.println(output);
System.out.println("output");
String classesLocation = replaceFirst + output;
System.out.println(classesLocation);
List<ProjectInfo> listClases = DynamicClassLoader.listClases(classesLocation);
if (listClases.isEmpty())
return;
ProjectInfo projectInfo = listClases.get(0);
List<String> classes = projectInfo.getClasses();
for (String clzz : classes) {
DynamicClassLoader.load(classesLocation, clzz);
}
System.out.println("load ok.");
} catch (Exception e) {
e.printStackTrace();
}
});
}
Aggregations