use of com.github.javaparser.symbolsolver.resolution.typesolvers.JavaParserTypeSolver in project javaparser by javaparser.
the class AnalyseJavaSymbolSolver060Test method getSourceFileInfoExtractor.
private static SourceFileInfoExtractor getSourceFileInfoExtractor() {
CombinedTypeSolver combinedTypeSolver = new CombinedTypeSolver();
combinedTypeSolver.add(new ReflectionTypeSolver());
combinedTypeSolver.add(new JavaParserTypeSolver(new File(src + "/java-symbol-solver-core")));
combinedTypeSolver.add(new JavaParserTypeSolver(new File(src + "/java-symbol-solver-logic")));
combinedTypeSolver.add(new JavaParserTypeSolver(new File(src + "/java-symbol-solver-model")));
try {
combinedTypeSolver.add(new JarTypeSolver(lib + "/guava-21.0.jar"));
combinedTypeSolver.add(new JarTypeSolver(lib + "/javaparser-core-3.3.0.jar"));
combinedTypeSolver.add(new JarTypeSolver(lib + "/javaslang-2.0.3.jar"));
combinedTypeSolver.add(new JarTypeSolver(lib + "/javassist-3.19.0-GA.jar"));
} catch (IOException e) {
Assert.fail("one or more jar dependencies could not be found.");
e.printStackTrace();
}
SourceFileInfoExtractor sourceFileInfoExtractor = new SourceFileInfoExtractor();
sourceFileInfoExtractor.setTypeSolver(combinedTypeSolver);
sourceFileInfoExtractor.setPrintFileName(false);
sourceFileInfoExtractor.setVerbose(true);
return sourceFileInfoExtractor;
}
use of com.github.javaparser.symbolsolver.resolution.typesolvers.JavaParserTypeSolver in project javaparser by javaparser.
the class AnalyseNewJavaParserTest method getSourceFileInfoExtractor.
private static SourceFileInfoExtractor getSourceFileInfoExtractor() {
CombinedTypeSolver combinedTypeSolver = new CombinedTypeSolver();
combinedTypeSolver.add(new ReflectionTypeSolver());
combinedTypeSolver.add(new JavaParserTypeSolver(src));
combinedTypeSolver.add(new JavaParserTypeSolver(adaptPath(new File("src/test/test_sourcecode/javaparser_new_src/javaparser-generated-sources"))));
SourceFileInfoExtractor sourceFileInfoExtractor = new SourceFileInfoExtractor();
sourceFileInfoExtractor.setTypeSolver(combinedTypeSolver);
sourceFileInfoExtractor.setPrintFileName(false);
sourceFileInfoExtractor.setVerbose(true);
return sourceFileInfoExtractor;
}
use of com.github.javaparser.symbolsolver.resolution.typesolvers.JavaParserTypeSolver in project javaparser by javaparser.
the class Issue144 method setup.
@Before
public void setup() throws IOException {
File srcDir = adaptPath(new File("src/test/resources/issue144"));
typeSolver = new JavaParserTypeSolver(srcDir);
}
use of com.github.javaparser.symbolsolver.resolution.typesolvers.JavaParserTypeSolver in project javaparser by javaparser.
the class Issue185 method testIssue.
@Test
public void testIssue() throws FileNotFoundException {
File src = adaptPath(new File("src/test/resources/recursion-issue"));
CombinedTypeSolver combinedTypeSolver = new CombinedTypeSolver();
combinedTypeSolver.add(new JavaParserTypeSolver(src));
combinedTypeSolver.add(new ReflectionTypeSolver());
CompilationUnit agendaCu = JavaParser.parse(adaptPath(new File("src/test/resources/recursion-issue/Usage.java")));
MethodCallExpr foo = Navigator.findMethodCall(agendaCu, "foo").get();
assertNotNull(foo);
JavaParserFacade.get(combinedTypeSolver).getType(foo);
}
use of com.github.javaparser.symbolsolver.resolution.typesolvers.JavaParserTypeSolver in project javaparser by javaparser.
the class Issue128 method setup.
@Before
public void setup() throws IOException {
File srcDir = adaptPath(new File("src/test/resources/issue128"));
typeSolver = new CombinedTypeSolver(new ReflectionTypeSolver(), new JavaParserTypeSolver(srcDir));
}
Aggregations