WALA
WALA copied to clipboard
define entry point for JUnit4 and do across files analysis
When I try to add JUnit4 entrypoint support #669 ,I failed to build call graph for the java class without main method. I'm not sure how to make call graph in a directory across multiple files #648 and analyze the source file(.java) dir of java programs #573.
How can we define our own entry point for JUnit4,and how to do across files analysis?
This is my code: scope = new JavaSourceAnalysisScope(); scope.addSourceFileToScope(JavaSourceAnalysisScope.SOURCE,new File(path),".java"); scope.addClassFileToScope(ClassLoaderReference.Application,new File(path)); scope.addToScope(ClassLoaderReference.Application,new SourceDirectoryTreeModule(new File(path)); cha = ClassHierarchyFactory.make(scope,new ECJClassLoaderFactory(scope.getExclusions()));
Iterable<Entrypoint> entryPoints = findMethod1(); AnalysisOptions options = new AnalysisOptions(scope, entryPoints); //options.setEntrypoints(entryPoints);
And this is the error.
Class Hierarchy construction failed
com.ibm.wala.ipa.cha.ClassHierarchyException: failed to load root <Primordial,Ljava/lang/Object> of class hierarchy
com.ibm.wala.ipa.cha.ClassHierarchyException: failed to load root <Primordial,Ljava/lang/Object> of class hierarchy
at com.ibm.wala.ipa.cha.ClassHierarchy.