Search in sources :

Example 11 with ResolvedReferenceType

use of com.github.javaparser.resolution.types.ResolvedReferenceType in project javaparser by javaparser.

the class JavaParserInterfaceDeclarationTest method testGetAllAncestorsWithTypeParameters.

@Test
public void testGetAllAncestorsWithTypeParameters() {
    JavaParserClassDeclaration constructorDeclaration = (JavaParserClassDeclaration) typeSolver.solveType("com.github.javaparser.ast.body.ConstructorDeclaration");
    assertEquals(12, constructorDeclaration.getAllAncestors().size());
    ResolvedReferenceType ancestor;
    ancestor = constructorDeclaration.getAllAncestors().get(0);
    assertEquals("com.github.javaparser.ast.body.BodyDeclaration", ancestor.getQualifiedName());
    assertEquals("com.github.javaparser.ast.body.ConstructorDeclaration", ancestor.typeParametersMap().getValueBySignature("com.github.javaparser.ast.body.BodyDeclaration.T").get().asReferenceType().getQualifiedName());
    ancestor = constructorDeclaration.getAllAncestors().get(1);
    assertEquals("com.github.javaparser.ast.Node", ancestor.getQualifiedName());
    ancestor = constructorDeclaration.getAllAncestors().get(2);
    assertEquals("java.lang.Cloneable", ancestor.getQualifiedName());
    ancestor = constructorDeclaration.getAllAncestors().get(3);
    assertEquals("com.github.javaparser.ast.nodeTypes.NodeWithAnnotations", ancestor.getQualifiedName());
    assertEquals("com.github.javaparser.ast.body.ConstructorDeclaration", ancestor.typeParametersMap().getValueBySignature("com.github.javaparser.ast.nodeTypes.NodeWithAnnotations.T").get().asReferenceType().getQualifiedName());
    ancestor = constructorDeclaration.getAllAncestors().get(4);
    assertEquals("java.lang.Object", ancestor.getQualifiedName());
    ancestor = constructorDeclaration.getAllAncestors().get(5);
    assertEquals("com.github.javaparser.ast.nodeTypes.NodeWithJavaDoc", ancestor.getQualifiedName());
    assertEquals("com.github.javaparser.ast.body.ConstructorDeclaration", ancestor.typeParametersMap().getValueBySignature("com.github.javaparser.ast.nodeTypes.NodeWithJavaDoc.T").get().asReferenceType().getQualifiedName());
    ancestor = constructorDeclaration.getAllAncestors().get(6);
    assertEquals("com.github.javaparser.ast.nodeTypes.NodeWithDeclaration", ancestor.getQualifiedName());
    ancestor = constructorDeclaration.getAllAncestors().get(7);
    assertEquals("com.github.javaparser.ast.nodeTypes.NodeWithName", ancestor.getQualifiedName());
    assertEquals("com.github.javaparser.ast.body.ConstructorDeclaration", ancestor.typeParametersMap().getValueBySignature("com.github.javaparser.ast.nodeTypes.NodeWithName.T").get().asReferenceType().getQualifiedName());
    ancestor = constructorDeclaration.getAllAncestors().get(8);
    assertEquals("com.github.javaparser.ast.nodeTypes.NodeWithModifiers", ancestor.getQualifiedName());
    assertEquals("com.github.javaparser.ast.body.ConstructorDeclaration", ancestor.typeParametersMap().getValueBySignature("com.github.javaparser.ast.nodeTypes.NodeWithModifiers.T").get().asReferenceType().getQualifiedName());
    ancestor = constructorDeclaration.getAllAncestors().get(9);
    assertEquals("com.github.javaparser.ast.nodeTypes.NodeWithParameters", ancestor.getQualifiedName());
    assertEquals("com.github.javaparser.ast.body.ConstructorDeclaration", ancestor.typeParametersMap().getValueBySignature("com.github.javaparser.ast.nodeTypes.NodeWithParameters.T").get().asReferenceType().getQualifiedName());
    ancestor = constructorDeclaration.getAllAncestors().get(10);
    assertEquals("com.github.javaparser.ast.nodeTypes.NodeWithThrowable", ancestor.getQualifiedName());
    assertEquals("com.github.javaparser.ast.body.ConstructorDeclaration", ancestor.typeParametersMap().getValueBySignature("com.github.javaparser.ast.nodeTypes.NodeWithThrowable.T").get().asReferenceType().getQualifiedName());
    ancestor = constructorDeclaration.getAllAncestors().get(11);
    assertEquals("com.github.javaparser.ast.nodeTypes.NodeWithBlockStmt", ancestor.getQualifiedName());
    assertEquals("com.github.javaparser.ast.body.ConstructorDeclaration", ancestor.typeParametersMap().getValueBySignature("com.github.javaparser.ast.nodeTypes.NodeWithBlockStmt.T").get().asReferenceType().getQualifiedName());
}
Also used : ResolvedReferenceType(com.github.javaparser.resolution.types.ResolvedReferenceType) AbstractTest(com.github.javaparser.symbolsolver.AbstractTest) Test(org.junit.Test)

Example 12 with ResolvedReferenceType

use of com.github.javaparser.resolution.types.ResolvedReferenceType in project javaparser by javaparser.

the class JavaParserInterfaceDeclarationTest method testGetAllInterfacesWithParameters.

// @Test
// public void testGetAllInterfacesWithoutParameters() {
// JavaParserInterfaceDeclaration nodeWithAnnotations = (JavaParserInterfaceDeclaration) typeSolver.solveType("com.github.javaparser.ast.nodeTypes.NodeWithAnnotations");
// assertEquals(ImmutableSet.of("java.lang.Cloneable"), compilationUnit.getAllInterfaces().stream().map(i -> i.getQualifiedName()).collect(Collectors.toSet()));
// 
// JavaParserClassDeclaration coid = (JavaParserClassDeclaration) typeSolver.solveType("com.github.javaparser.ast.body.ClassOrInterfaceDeclaration");
// assertEquals(ImmutableSet.of("java.lang.Cloneable", "com.github.javaparser.ast.NamedNode", "com.github.javaparser.ast.body.AnnotableNode", "com.github.javaparser.ast.DocumentableNode"), coid.getAllInterfaces().stream().map(i -> i.getQualifiedName()).collect(Collectors.toSet()));
// }
@Test
public void testGetAllInterfacesWithParameters() {
    JavaParserClassDeclaration constructorDeclaration = (JavaParserClassDeclaration) typeSolver.solveType("com.github.javaparser.ast.body.ConstructorDeclaration");
    assertEquals(9, constructorDeclaration.getAllInterfaces().size());
    ResolvedReferenceType interfaze;
    interfaze = constructorDeclaration.getAllInterfaces().get(0);
    assertEquals("com.github.javaparser.ast.nodeTypes.NodeWithJavaDoc", interfaze.getQualifiedName());
    assertEquals("com.github.javaparser.ast.body.ConstructorDeclaration", interfaze.typeParametersMap().getValueBySignature("com.github.javaparser.ast.nodeTypes.NodeWithJavaDoc.T").get().asReferenceType().getQualifiedName());
    interfaze = constructorDeclaration.getAllInterfaces().get(1);
    assertEquals("com.github.javaparser.ast.nodeTypes.NodeWithDeclaration", interfaze.getQualifiedName());
    interfaze = constructorDeclaration.getAllInterfaces().get(2);
    assertEquals("com.github.javaparser.ast.nodeTypes.NodeWithName", interfaze.getQualifiedName());
    assertEquals("com.github.javaparser.ast.body.ConstructorDeclaration", interfaze.typeParametersMap().getValueBySignature("com.github.javaparser.ast.nodeTypes.NodeWithName.T").get().asReferenceType().getQualifiedName());
    interfaze = constructorDeclaration.getAllInterfaces().get(3);
    assertEquals("com.github.javaparser.ast.nodeTypes.NodeWithModifiers", interfaze.getQualifiedName());
    assertEquals("com.github.javaparser.ast.body.ConstructorDeclaration", interfaze.typeParametersMap().getValueBySignature("com.github.javaparser.ast.nodeTypes.NodeWithModifiers.T").get().asReferenceType().getQualifiedName());
    interfaze = constructorDeclaration.getAllInterfaces().get(4);
    assertEquals("com.github.javaparser.ast.nodeTypes.NodeWithParameters", interfaze.getQualifiedName());
    assertEquals("com.github.javaparser.ast.body.ConstructorDeclaration", interfaze.typeParametersMap().getValueBySignature("com.github.javaparser.ast.nodeTypes.NodeWithParameters.T").get().asReferenceType().getQualifiedName());
    interfaze = constructorDeclaration.getAllInterfaces().get(5);
    assertEquals("com.github.javaparser.ast.nodeTypes.NodeWithThrowable", interfaze.getQualifiedName());
    assertEquals("com.github.javaparser.ast.body.ConstructorDeclaration", interfaze.typeParametersMap().getValueBySignature("com.github.javaparser.ast.nodeTypes.NodeWithThrowable.T").get().asReferenceType().getQualifiedName());
    interfaze = constructorDeclaration.getAllInterfaces().get(6);
    assertEquals("com.github.javaparser.ast.nodeTypes.NodeWithBlockStmt", interfaze.getQualifiedName());
    assertEquals("com.github.javaparser.ast.body.ConstructorDeclaration", interfaze.typeParametersMap().getValueBySignature("com.github.javaparser.ast.nodeTypes.NodeWithBlockStmt.T").get().asReferenceType().getQualifiedName());
    interfaze = constructorDeclaration.getAllInterfaces().get(7);
    assertEquals("java.lang.Cloneable", interfaze.getQualifiedName());
    interfaze = constructorDeclaration.getAllInterfaces().get(8);
    assertEquals("com.github.javaparser.ast.nodeTypes.NodeWithAnnotations", interfaze.getQualifiedName());
    assertEquals("com.github.javaparser.ast.body.ConstructorDeclaration", interfaze.typeParametersMap().getValueBySignature("com.github.javaparser.ast.nodeTypes.NodeWithAnnotations.T").get().asReferenceType().getQualifiedName());
}
Also used : ResolvedReferenceType(com.github.javaparser.resolution.types.ResolvedReferenceType) AbstractTest(com.github.javaparser.symbolsolver.AbstractTest) Test(org.junit.Test)

Example 13 with ResolvedReferenceType

use of com.github.javaparser.resolution.types.ResolvedReferenceType in project javaparser by javaparser.

the class JavaParserInterfaceDeclarationTest method testGetInterfacesWithParameters.

// @Test
// public void testGetInterfacesWithoutParameters() {
// JavaParserInterfaceDeclaration nodeWithAnnotations = (JavaParserInterfaceDeclaration) typeSolver.solveType("com.github.javaparser.ast.nodeTypes.NodeWithAnnotations");
// assertEquals(ImmutableSet.of(), compilationUnit.getInterfaces().stream().map(i -> i.getQualifiedName()).collect(Collectors.toSet()));
// 
// JavaParserClassDeclaration coid = (JavaParserClassDeclaration) typeSolver.solveType("com.github.javaparser.ast.body.ClassOrInterfaceDeclaration");
// assertEquals(ImmutableSet.of("com.github.javaparser.ast.DocumentableNode"), coid.getInterfaces().stream().map(i -> i.getQualifiedName()).collect(Collectors.toSet()));
// }
@Test
public void testGetInterfacesWithParameters() {
    JavaParserClassDeclaration constructorDeclaration = (JavaParserClassDeclaration) typeSolver.solveType("com.github.javaparser.ast.body.ConstructorDeclaration");
    assertEquals(7, constructorDeclaration.getInterfaces().size());
    ResolvedReferenceType interfaze = null;
    interfaze = constructorDeclaration.getInterfaces().get(0);
    assertEquals("com.github.javaparser.ast.nodeTypes.NodeWithJavaDoc", interfaze.getQualifiedName());
    assertEquals("com.github.javaparser.ast.body.ConstructorDeclaration", interfaze.typeParametersMap().getValueBySignature("com.github.javaparser.ast.nodeTypes.NodeWithJavaDoc.T").get().asReferenceType().getQualifiedName());
    interfaze = constructorDeclaration.getInterfaces().get(1);
    assertEquals("com.github.javaparser.ast.nodeTypes.NodeWithDeclaration", interfaze.getQualifiedName());
    interfaze = constructorDeclaration.getInterfaces().get(2);
    assertEquals("com.github.javaparser.ast.nodeTypes.NodeWithName", interfaze.getQualifiedName());
    assertEquals("com.github.javaparser.ast.body.ConstructorDeclaration", interfaze.typeParametersMap().getValueBySignature("com.github.javaparser.ast.nodeTypes.NodeWithName.T").get().asReferenceType().getQualifiedName());
    interfaze = constructorDeclaration.getInterfaces().get(3);
    assertEquals("com.github.javaparser.ast.nodeTypes.NodeWithModifiers", interfaze.getQualifiedName());
    assertEquals("com.github.javaparser.ast.body.ConstructorDeclaration", interfaze.typeParametersMap().getValueBySignature("com.github.javaparser.ast.nodeTypes.NodeWithModifiers.T").get().asReferenceType().getQualifiedName());
    interfaze = constructorDeclaration.getInterfaces().get(4);
    assertEquals("com.github.javaparser.ast.nodeTypes.NodeWithParameters", interfaze.getQualifiedName());
    assertEquals("com.github.javaparser.ast.body.ConstructorDeclaration", interfaze.typeParametersMap().getValueBySignature("com.github.javaparser.ast.nodeTypes.NodeWithParameters.T").get().asReferenceType().getQualifiedName());
    interfaze = constructorDeclaration.getInterfaces().get(5);
    assertEquals("com.github.javaparser.ast.nodeTypes.NodeWithThrowable", interfaze.getQualifiedName());
    assertEquals("com.github.javaparser.ast.body.ConstructorDeclaration", interfaze.typeParametersMap().getValueBySignature("com.github.javaparser.ast.nodeTypes.NodeWithThrowable.T").get().asReferenceType().getQualifiedName());
    interfaze = constructorDeclaration.getInterfaces().get(6);
    assertEquals("com.github.javaparser.ast.nodeTypes.NodeWithBlockStmt", interfaze.getQualifiedName());
    assertEquals("com.github.javaparser.ast.body.ConstructorDeclaration", interfaze.typeParametersMap().getValueBySignature("com.github.javaparser.ast.nodeTypes.NodeWithBlockStmt.T").get().asReferenceType().getQualifiedName());
}
Also used : ResolvedReferenceType(com.github.javaparser.resolution.types.ResolvedReferenceType) AbstractTest(com.github.javaparser.symbolsolver.AbstractTest) Test(org.junit.Test)

Example 14 with ResolvedReferenceType

use of com.github.javaparser.resolution.types.ResolvedReferenceType in project javaparser by javaparser.

the class JavaParserAPIIntegrationTest method setup.

@Before
public void setup() {
    File src = adaptPath(new File("src/test/test_sourcecode/javaparser_new_src/javaparser-core"));
    CombinedTypeSolver combinedTypeSolverNewCode = new CombinedTypeSolver();
    combinedTypeSolverNewCode.add(new ReflectionTypeSolver());
    combinedTypeSolverNewCode.add(new JavaParserTypeSolver(src));
    combinedTypeSolverNewCode.add(new JavaParserTypeSolver(adaptPath(new File("src/test/test_sourcecode/javaparser_new_src/javaparser-generated-sources"))));
    typeSolver = combinedTypeSolverNewCode;
    TypeSolver ts = new ReflectionTypeSolver();
    string = new ReferenceTypeImpl(ts.solveType(String.class.getCanonicalName()), ts);
    ResolvedReferenceType booleanC = new ReferenceTypeImpl(ts.solveType(Boolean.class.getCanonicalName()), ts);
    listOfBoolean = new ReferenceTypeImpl(ts.solveType(List.class.getCanonicalName()), ImmutableList.of(booleanC), ts);
}
Also used : ResolvedReferenceType(com.github.javaparser.resolution.types.ResolvedReferenceType) JavaParserTypeSolver(com.github.javaparser.symbolsolver.resolution.typesolvers.JavaParserTypeSolver) TypeSolver(com.github.javaparser.symbolsolver.model.resolution.TypeSolver) CombinedTypeSolver(com.github.javaparser.symbolsolver.resolution.typesolvers.CombinedTypeSolver) ReflectionTypeSolver(com.github.javaparser.symbolsolver.resolution.typesolvers.ReflectionTypeSolver) ReferenceTypeImpl(com.github.javaparser.symbolsolver.model.typesystem.ReferenceTypeImpl) JavaParserTypeSolver(com.github.javaparser.symbolsolver.resolution.typesolvers.JavaParserTypeSolver) List(java.util.List) ImmutableList(com.google.common.collect.ImmutableList) ReflectionTypeSolver(com.github.javaparser.symbolsolver.resolution.typesolvers.ReflectionTypeSolver) File(java.io.File) CombinedTypeSolver(com.github.javaparser.symbolsolver.resolution.typesolvers.CombinedTypeSolver) Before(org.junit.Before)

Example 15 with ResolvedReferenceType

use of com.github.javaparser.resolution.types.ResolvedReferenceType in project javaparser by javaparser.

the class ReflectionClassDeclarationTest method testGetAllInterfacesWithParameters.

@Test
public void testGetAllInterfacesWithParameters() {
    ReflectionClassDeclaration constructorDeclaration = (ReflectionClassDeclaration) typeResolver.solveType("com.github.javaparser.ast.body.ConstructorDeclaration");
    List<ResolvedReferenceType> interfaces = constructorDeclaration.getAllInterfaces();
    assertEquals(34, interfaces.size());
    ResolvedReferenceType interfaze;
    int i = 0;
    interfaze = constructorDeclaration.getAllInterfaces().get(i++);
    assertEquals("com.github.javaparser.ast.nodeTypes.NodeWithBlockStmt", interfaze.getQualifiedName());
    assertEquals("com.github.javaparser.ast.body.ConstructorDeclaration", interfaze.typeParametersMap().getValueBySignature("com.github.javaparser.ast.nodeTypes.NodeWithBlockStmt.N").get().asReferenceType().getQualifiedName());
    interfaze = constructorDeclaration.getAllInterfaces().get(i++);
    assertEquals("com.github.javaparser.ast.nodeTypes.modifiers.NodeWithAccessModifiers", interfaze.getQualifiedName());
    assertEquals("com.github.javaparser.ast.body.ConstructorDeclaration", interfaze.typeParametersMap().getValueBySignature("com.github.javaparser.ast.nodeTypes.modifiers.NodeWithAccessModifiers.N").get().asReferenceType().getQualifiedName());
    interfaze = constructorDeclaration.getAllInterfaces().get(i++);
    assertEquals("com.github.javaparser.ast.nodeTypes.modifiers.NodeWithPublicModifier", interfaze.getQualifiedName());
    assertEquals("com.github.javaparser.ast.body.ConstructorDeclaration", interfaze.typeParametersMap().getValueBySignature("com.github.javaparser.ast.nodeTypes.modifiers.NodeWithPublicModifier.N").get().asReferenceType().getQualifiedName());
    interfaze = constructorDeclaration.getAllInterfaces().get(i++);
    assertEquals("com.github.javaparser.ast.nodeTypes.NodeWithModifiers", interfaze.getQualifiedName());
    assertEquals("com.github.javaparser.ast.body.ConstructorDeclaration", interfaze.typeParametersMap().getValueBySignature("com.github.javaparser.ast.nodeTypes.NodeWithModifiers.N").get().asReferenceType().getQualifiedName());
    interfaze = constructorDeclaration.getAllInterfaces().get(i++);
    assertEquals("com.github.javaparser.ast.nodeTypes.modifiers.NodeWithPrivateModifier", interfaze.getQualifiedName());
    assertEquals("com.github.javaparser.ast.body.ConstructorDeclaration", interfaze.typeParametersMap().getValueBySignature("com.github.javaparser.ast.nodeTypes.modifiers.NodeWithPrivateModifier.N").get().asReferenceType().getQualifiedName());
    interfaze = constructorDeclaration.getAllInterfaces().get(i++);
    assertEquals("com.github.javaparser.ast.nodeTypes.modifiers.NodeWithProtectedModifier", interfaze.getQualifiedName());
    assertEquals("com.github.javaparser.ast.body.ConstructorDeclaration", interfaze.typeParametersMap().getValueBySignature("com.github.javaparser.ast.nodeTypes.modifiers.NodeWithProtectedModifier.N").get().asReferenceType().getQualifiedName());
    interfaze = constructorDeclaration.getAllInterfaces().get(i++);
    assertEquals("com.github.javaparser.ast.nodeTypes.NodeWithJavadoc", interfaze.getQualifiedName());
    assertEquals("com.github.javaparser.ast.body.ConstructorDeclaration", interfaze.typeParametersMap().getValueBySignature("com.github.javaparser.ast.nodeTypes.NodeWithJavadoc.N").get().asReferenceType().getQualifiedName());
    interfaze = constructorDeclaration.getAllInterfaces().get(i++);
    assertEquals("com.github.javaparser.ast.nodeTypes.NodeWithSimpleName", interfaze.getQualifiedName());
    assertEquals("com.github.javaparser.ast.body.ConstructorDeclaration", interfaze.typeParametersMap().getValueBySignature("com.github.javaparser.ast.nodeTypes.NodeWithSimpleName.N").get().asReferenceType().getQualifiedName());
    interfaze = constructorDeclaration.getAllInterfaces().get(i++);
    assertEquals("com.github.javaparser.ast.nodeTypes.NodeWithParameters", interfaze.getQualifiedName());
    assertEquals("com.github.javaparser.ast.body.ConstructorDeclaration", interfaze.typeParametersMap().getValueBySignature("com.github.javaparser.ast.nodeTypes.NodeWithParameters.N").get().asReferenceType().getQualifiedName());
    interfaze = constructorDeclaration.getAllInterfaces().get(i++);
    assertEquals("com.github.javaparser.ast.nodeTypes.NodeWithThrownExceptions", interfaze.getQualifiedName());
    assertEquals("com.github.javaparser.ast.body.ConstructorDeclaration", interfaze.typeParametersMap().getValueBySignature("com.github.javaparser.ast.nodeTypes.NodeWithThrownExceptions.N").get().asReferenceType().getQualifiedName());
    interfaze = constructorDeclaration.getAllInterfaces().get(i++);
    assertEquals("com.github.javaparser.ast.nodeTypes.NodeWithTypeParameters", interfaze.getQualifiedName());
    assertEquals("com.github.javaparser.ast.body.ConstructorDeclaration", interfaze.typeParametersMap().getValueBySignature("com.github.javaparser.ast.nodeTypes.NodeWithTypeParameters.N").get().asReferenceType().getQualifiedName());
    interfaze = constructorDeclaration.getAllInterfaces().get(i++);
    assertEquals("com.github.javaparser.resolution.Resolvable", interfaze.getQualifiedName());
    interfaze = constructorDeclaration.getAllInterfaces().get(i++);
    assertEquals("java.lang.Cloneable", interfaze.getQualifiedName());
    interfaze = constructorDeclaration.getAllInterfaces().get(i++);
    assertEquals("com.github.javaparser.HasParentNode", interfaze.getQualifiedName());
    assertEquals("com.github.javaparser.ast.Node", interfaze.typeParametersMap().getValueBySignature("com.github.javaparser.HasParentNode.T").get().asReferenceType().getQualifiedName());
    interfaze = constructorDeclaration.getAllInterfaces().get(i++);
    assertEquals("com.github.javaparser.ast.observer.Observable", interfaze.getQualifiedName());
    interfaze = constructorDeclaration.getAllInterfaces().get(i++);
    assertEquals("com.github.javaparser.ast.visitor.Visitable", interfaze.getQualifiedName());
    interfaze = constructorDeclaration.getAllInterfaces().get(i++);
    assertEquals("com.github.javaparser.ast.nodeTypes.NodeWithRange", interfaze.getQualifiedName());
    assertEquals("com.github.javaparser.ast.Node", interfaze.typeParametersMap().getValueBySignature("com.github.javaparser.ast.nodeTypes.NodeWithRange.N").get().asReferenceType().getQualifiedName());
    interfaze = constructorDeclaration.getAllInterfaces().get(i++);
    assertEquals("com.github.javaparser.ast.nodeTypes.NodeWithTokenRange", interfaze.getQualifiedName());
    assertEquals("com.github.javaparser.ast.Node", interfaze.typeParametersMap().getValueBySignature("com.github.javaparser.ast.nodeTypes.NodeWithTokenRange.N").get().asReferenceType().getQualifiedName());
    interfaze = constructorDeclaration.getAllInterfaces().get(i++);
    assertEquals("com.github.javaparser.ast.nodeTypes.NodeWithAnnotations", interfaze.getQualifiedName());
    assertEquals("com.github.javaparser.ast.body.ConstructorDeclaration", interfaze.typeParametersMap().getValueBySignature("com.github.javaparser.ast.nodeTypes.NodeWithAnnotations.N").get().asReferenceType().getQualifiedName());
    interfaze = constructorDeclaration.getAllInterfaces().get(i++);
    assertEquals("com.github.javaparser.ast.nodeTypes.modifiers.NodeWithAccessModifiers", interfaze.getQualifiedName());
    assertEquals("com.github.javaparser.ast.body.ConstructorDeclaration", interfaze.typeParametersMap().getValueBySignature("com.github.javaparser.ast.nodeTypes.modifiers.NodeWithAccessModifiers.N").get().asReferenceType().getQualifiedName());
    interfaze = constructorDeclaration.getAllInterfaces().get(i++);
    assertEquals("com.github.javaparser.ast.nodeTypes.modifiers.NodeWithPublicModifier", interfaze.getQualifiedName());
    assertEquals("com.github.javaparser.ast.body.ConstructorDeclaration", interfaze.typeParametersMap().getValueBySignature("com.github.javaparser.ast.nodeTypes.modifiers.NodeWithPublicModifier.N").get().asReferenceType().getQualifiedName());
    interfaze = constructorDeclaration.getAllInterfaces().get(i++);
    assertEquals("com.github.javaparser.ast.nodeTypes.NodeWithModifiers", interfaze.getQualifiedName());
    assertEquals("com.github.javaparser.ast.body.ConstructorDeclaration", interfaze.typeParametersMap().getValueBySignature("com.github.javaparser.ast.nodeTypes.NodeWithModifiers.N").get().asReferenceType().getQualifiedName());
    interfaze = constructorDeclaration.getAllInterfaces().get(i++);
    assertEquals("com.github.javaparser.ast.nodeTypes.modifiers.NodeWithPrivateModifier", interfaze.getQualifiedName());
    assertEquals("com.github.javaparser.ast.body.ConstructorDeclaration", interfaze.typeParametersMap().getValueBySignature("com.github.javaparser.ast.nodeTypes.modifiers.NodeWithPrivateModifier.N").get().asReferenceType().getQualifiedName());
    interfaze = constructorDeclaration.getAllInterfaces().get(i++);
    assertEquals("com.github.javaparser.ast.nodeTypes.modifiers.NodeWithProtectedModifier", interfaze.getQualifiedName());
    assertEquals("com.github.javaparser.ast.body.ConstructorDeclaration", interfaze.typeParametersMap().getValueBySignature("com.github.javaparser.ast.nodeTypes.modifiers.NodeWithProtectedModifier.N").get().asReferenceType().getQualifiedName());
    interfaze = constructorDeclaration.getAllInterfaces().get(i++);
    assertEquals("com.github.javaparser.ast.nodeTypes.NodeWithDeclaration", interfaze.getQualifiedName());
    interfaze = constructorDeclaration.getAllInterfaces().get(i++);
    assertEquals("com.github.javaparser.ast.nodeTypes.NodeWithSimpleName", interfaze.getQualifiedName());
    assertEquals("com.github.javaparser.ast.body.ConstructorDeclaration", interfaze.typeParametersMap().getValueBySignature("com.github.javaparser.ast.nodeTypes.NodeWithSimpleName.N").get().asReferenceType().getQualifiedName());
    interfaze = constructorDeclaration.getAllInterfaces().get(i++);
    assertEquals("com.github.javaparser.ast.nodeTypes.NodeWithParameters", interfaze.getQualifiedName());
    assertEquals("com.github.javaparser.ast.body.ConstructorDeclaration", interfaze.typeParametersMap().getValueBySignature("com.github.javaparser.ast.nodeTypes.NodeWithParameters.N").get().asReferenceType().getQualifiedName());
    interfaze = constructorDeclaration.getAllInterfaces().get(i++);
    assertEquals("com.github.javaparser.ast.nodeTypes.NodeWithThrownExceptions", interfaze.getQualifiedName());
    assertEquals("com.github.javaparser.ast.body.ConstructorDeclaration", interfaze.typeParametersMap().getValueBySignature("com.github.javaparser.ast.nodeTypes.NodeWithThrownExceptions.N").get().asReferenceType().getQualifiedName());
    interfaze = constructorDeclaration.getAllInterfaces().get(i++);
    assertEquals("com.github.javaparser.ast.nodeTypes.NodeWithTypeParameters", interfaze.getQualifiedName());
    assertEquals("com.github.javaparser.ast.body.ConstructorDeclaration", interfaze.typeParametersMap().getValueBySignature("com.github.javaparser.ast.nodeTypes.NodeWithTypeParameters.N").get().asReferenceType().getQualifiedName());
    interfaze = constructorDeclaration.getAllInterfaces().get(i++);
    assertEquals("com.github.javaparser.ast.nodeTypes.NodeWithJavadoc", interfaze.getQualifiedName());
    assertEquals("com.github.javaparser.ast.body.ConstructorDeclaration", interfaze.typeParametersMap().getValueBySignature("com.github.javaparser.ast.nodeTypes.NodeWithJavadoc.N").get().asReferenceType().getQualifiedName());
    interfaze = constructorDeclaration.getAllInterfaces().get(i++);
    assertEquals("com.github.javaparser.ast.nodeTypes.modifiers.NodeWithAbstractModifier", interfaze.getQualifiedName());
    assertEquals("com.github.javaparser.ast.body.ConstructorDeclaration", interfaze.typeParametersMap().getValueBySignature("com.github.javaparser.ast.nodeTypes.modifiers.NodeWithAbstractModifier.N").get().asReferenceType().getQualifiedName());
    interfaze = constructorDeclaration.getAllInterfaces().get(i++);
    assertEquals("com.github.javaparser.ast.nodeTypes.modifiers.NodeWithStaticModifier", interfaze.getQualifiedName());
    assertEquals("com.github.javaparser.ast.body.ConstructorDeclaration", interfaze.typeParametersMap().getValueBySignature("com.github.javaparser.ast.nodeTypes.modifiers.NodeWithStaticModifier.N").get().asReferenceType().getQualifiedName());
    interfaze = constructorDeclaration.getAllInterfaces().get(i++);
    assertEquals("com.github.javaparser.ast.nodeTypes.modifiers.NodeWithFinalModifier", interfaze.getQualifiedName());
    assertEquals("com.github.javaparser.ast.body.ConstructorDeclaration", interfaze.typeParametersMap().getValueBySignature("com.github.javaparser.ast.nodeTypes.modifiers.NodeWithFinalModifier.N").get().asReferenceType().getQualifiedName());
    interfaze = constructorDeclaration.getAllInterfaces().get(i++);
    assertEquals("com.github.javaparser.ast.nodeTypes.modifiers.NodeWithStrictfpModifier", interfaze.getQualifiedName());
    assertEquals("com.github.javaparser.ast.body.ConstructorDeclaration", interfaze.typeParametersMap().getValueBySignature("com.github.javaparser.ast.nodeTypes.modifiers.NodeWithStrictfpModifier.N").get().asReferenceType().getQualifiedName());
}
Also used : ResolvedReferenceType(com.github.javaparser.resolution.types.ResolvedReferenceType) AbstractTest(com.github.javaparser.symbolsolver.AbstractTest) Test(org.junit.Test)

Aggregations

ResolvedReferenceType (com.github.javaparser.resolution.types.ResolvedReferenceType)55 Test (org.junit.Test)34 AbstractTest (com.github.javaparser.symbolsolver.AbstractTest)28 ReferenceTypeImpl (com.github.javaparser.symbolsolver.model.typesystem.ReferenceTypeImpl)15 TypeSolver (com.github.javaparser.symbolsolver.model.resolution.TypeSolver)14 MethodUsage (com.github.javaparser.resolution.MethodUsage)9 ReflectionTypeSolver (com.github.javaparser.symbolsolver.resolution.typesolvers.ReflectionTypeSolver)9 ResolvedType (com.github.javaparser.resolution.types.ResolvedType)8 Collectors (java.util.stream.Collectors)8 ResolvedMethodDeclaration (com.github.javaparser.resolution.declarations.ResolvedMethodDeclaration)6 ArrayList (java.util.ArrayList)6 List (java.util.List)6 ResolvedTypeVariable (com.github.javaparser.resolution.types.ResolvedTypeVariable)5 AccessSpecifier (com.github.javaparser.ast.AccessSpecifier)4 CompilationUnit (com.github.javaparser.ast.CompilationUnit)4 JavaParserClassDeclaration (com.github.javaparser.symbolsolver.javaparsermodel.declarations.JavaParserClassDeclaration)4 SymbolReference (com.github.javaparser.symbolsolver.model.resolution.SymbolReference)4 CombinedTypeSolver (com.github.javaparser.symbolsolver.resolution.typesolvers.CombinedTypeSolver)4 ImmutableList (com.google.common.collect.ImmutableList)4 Before (org.junit.Before)4