Skip to content

Commit

Permalink
Adapted the test to feature an assertion
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonBaars committed Sep 18, 2019
1 parent 9da3856 commit db6f1cd
Showing 1 changed file with 5 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.github.javaparser.symbolsolver;

import static org.junit.jupiter.api.Assertions.assertEquals;

import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
Expand All @@ -13,7 +15,6 @@
import com.github.javaparser.StreamProvider;
import com.github.javaparser.ast.CompilationUnit;
import com.github.javaparser.ast.expr.ObjectCreationExpr;
import com.github.javaparser.ast.visitor.VoidVisitorAdapter;
import com.github.javaparser.symbolsolver.resolution.typesolvers.CombinedTypeSolver;
import com.github.javaparser.symbolsolver.resolution.typesolvers.ReflectionTypeSolver;

Expand All @@ -34,12 +35,8 @@ void issue2362() throws IOException {

CompilationUnit unit = javaParser.parse(ParseStart.COMPILATION_UNIT,
new StreamProvider(Files.newInputStream(file))).getResult().get();

unit.accept(new VoidVisitorAdapter<Object>() {
@Override
public void visit(ObjectCreationExpr exp, Object arg) {
System.out.println(exp.resolve().getSignature());
}
}, null);

ObjectCreationExpr oce = unit.findFirst(ObjectCreationExpr.class).get();
assertEquals(oce.resolve().getSignature(), "InnerClass(int)");
}
}

0 comments on commit db6f1cd

Please sign in to comment.