use of com.github.javaparser.symbolsolver.javaparsermodel.contexts.EnumDeclarationContext in project javaparser by javaparser.
the class EnumDeclarationContextResolutionTest method solveSymbolReferringToValue.
@Test
public void solveSymbolReferringToValue() {
CompilationUnit cu = parseSample("AnEnum");
com.github.javaparser.ast.body.EnumDeclaration enumDeclaration = Navigator.demandEnum(cu, "MyEnum");
Context context = new EnumDeclarationContext(enumDeclaration, typeSolver);
SymbolReference<? extends ResolvedValueDeclaration> ref = context.solveSymbol("E1", new MemoryTypeSolver());
assertEquals(true, ref.isSolved());
assertEquals("MyEnum", ref.getCorrespondingDeclaration().getType().describe());
}
Aggregations