use of spoon.reflect.visitor.DefaultJavaPrettyPrinter in project spoon by INRIA.
the class QualifiedThisRefTest method testQualifiedThisRef.
@Test
public void testQualifiedThisRef() {
DefaultJavaPrettyPrinter printer = new DefaultJavaPrettyPrinter(factory.getEnvironment());
CtType<?> ctClass = factory.Type().get(QualifiedThisRef.class);
Collection<CtImport> imports = printer.computeImports(ctClass);
final List<CtType<?>> ctTypes = new ArrayList<>();
ctTypes.add(ctClass);
printer.getElementPrinterHelper().writeHeader(ctTypes, imports);
printer.scan(ctClass);
Assert.assertTrue(printer.getResult().contains("Object o = this"));
Assert.assertTrue(printer.getResult().contains("Object o2 = QualifiedThisRef.this"));
}
Aggregations