use of spoon.support.comparator.DeepRepresentationComparator in project spoon by INRIA.
the class ConstructorCallTest method setUp.
@Before
public void setUp() throws Exception {
final Launcher launcher = new Launcher();
launcher.addInputResource("./src/test/java/" + Foo.class.getCanonicalName().replace(".", "/") + ".java");
launcher.addInputResource("./src/test/java/" + Panini.class.getCanonicalName().replace(".", "/") + ".java");
launcher.setSourceOutputDirectory("./target/spooned");
launcher.run();
final Factory factory = launcher.getFactory();
final CtClass<?> foo = (CtClass<?>) factory.Type().get(Foo.class);
TreeSet ts = new TreeSet(new DeepRepresentationComparator());
ts.addAll(foo.getElements(new AbstractFilter<CtConstructorCall<?>>(CtConstructorCall.class) {
@Override
public boolean matches(CtConstructorCall<?> element) {
return true;
}
}));
constructorCalls = new ArrayList(ts);
final CtType<Panini> panini = factory.Type().get(Panini.class);
constructorCallsPanini = panini.getElements(new TypeFilter<CtConstructorCall<?>>(CtConstructorCall.class));
}
Aggregations