use of com.github.javaparser.symbolsolver.resolution.typesolvers.ReflectionTypeSolver in project javaparser by javaparser.
the class JavassistClassDeclarationTest method setup.
@Before
public void setup() throws IOException {
String pathToJar = adaptPath("src/test/resources/javaparser-core-2.1.0.jar");
typeSolver = new CombinedTypeSolver(new JarTypeSolver(pathToJar), new ReflectionTypeSolver());
String newPathToJar = adaptPath("src/test/resources/javaparser-core-3.0.0-alpha.2.jar");
newTypeSolver = new CombinedTypeSolver(new JarTypeSolver(newPathToJar), new ReflectionTypeSolver());
String anotherPathToJar = adaptPath("src/test/resources/test-artifact-1.0.0.jar");
anotherTypeSolver = new CombinedTypeSolver(new JarTypeSolver(anotherPathToJar), new ReflectionTypeSolver());
}
use of com.github.javaparser.symbolsolver.resolution.typesolvers.ReflectionTypeSolver in project javaparser by javaparser.
the class JavassistInterfaceDeclarationTest method setup.
@Before
public void setup() throws IOException {
String pathToJar = adaptPath("src/test/resources/javaparser-core-3.0.0-alpha.2.jar");
typeSolver = new CombinedTypeSolver(new JarTypeSolver(pathToJar), new ReflectionTypeSolver());
String anotherPathToJar = adaptPath("src/test/resources/test-artifact-1.0.0.jar");
anotherTypeSolver = new CombinedTypeSolver(new JarTypeSolver(anotherPathToJar), new ReflectionTypeSolver());
}
use of com.github.javaparser.symbolsolver.resolution.typesolvers.ReflectionTypeSolver in project javaparser by javaparser.
the class FunctionInterfaceLogicTest method testGetFunctionalMethodPositiveCasesOnInterfaces.
@Test
public void testGetFunctionalMethodPositiveCasesOnInterfaces() {
TypeSolver typeSolver = new ReflectionTypeSolver();
ResolvedType function = new ReferenceTypeImpl(new ReflectionInterfaceDeclaration(Function.class, typeSolver), typeSolver);
assertEquals(true, FunctionalInterfaceLogic.getFunctionalMethod(function).isPresent());
assertEquals("apply", FunctionalInterfaceLogic.getFunctionalMethod(function).get().getName());
ResolvedType consumer = new ReferenceTypeImpl(new ReflectionInterfaceDeclaration(Consumer.class, typeSolver), typeSolver);
assertEquals(true, FunctionalInterfaceLogic.getFunctionalMethod(consumer).isPresent());
assertEquals("accept", FunctionalInterfaceLogic.getFunctionalMethod(consumer).get().getName());
}
use of com.github.javaparser.symbolsolver.resolution.typesolvers.ReflectionTypeSolver in project javaparser by javaparser.
the class FunctionInterfaceLogicTest method testGetFunctionalMethodNegativeCaseOnClass.
@Test
public void testGetFunctionalMethodNegativeCaseOnClass() {
TypeSolver typeSolver = new ReflectionTypeSolver();
ResolvedType string = new ReferenceTypeImpl(new ReflectionClassDeclaration(String.class, typeSolver), typeSolver);
assertEquals(false, FunctionalInterfaceLogic.getFunctionalMethod(string).isPresent());
}
use of com.github.javaparser.symbolsolver.resolution.typesolvers.ReflectionTypeSolver in project javaparser by javaparser.
the class ArrayTypeTest method setup.
@Before
public void setup() {
typeSolver = new ReflectionTypeSolver();
OBJECT = new ReferenceTypeImpl(new ReflectionClassDeclaration(Object.class, typeSolver), typeSolver);
STRING = new ReferenceTypeImpl(new ReflectionClassDeclaration(String.class, typeSolver), typeSolver);
arrayOfBooleans = new ResolvedArrayType(ResolvedPrimitiveType.BOOLEAN);
arrayOfStrings = new ResolvedArrayType(STRING);
tpA = ResolvedTypeParameterDeclaration.onType("A", "foo.Bar", Collections.emptyList());
arrayOfListOfA = new ResolvedArrayType(new ReferenceTypeImpl(new ReflectionInterfaceDeclaration(List.class, typeSolver), ImmutableList.of(new ResolvedTypeVariable(tpA)), typeSolver));
arrayOfListOfStrings = new ResolvedArrayType(new ReferenceTypeImpl(new ReflectionInterfaceDeclaration(List.class, typeSolver), ImmutableList.of(new ReferenceTypeImpl(new ReflectionClassDeclaration(String.class, typeSolver), typeSolver)), typeSolver));
}
Aggregations