use of spoon.reflect.path.CtElementPathBuilder in project spoon by INRIA.
the class PathTest method testGetPathFromNonParent.
@Test
public void testGetPathFromNonParent() throws Exception {
CtMethod fooMethod = (CtMethod) new CtPathStringBuilder().fromString(".spoon.test.path.Foo.foo").evaluateOn(factory.getModel().getRootPackage()).iterator().next();
CtMethod barMethod = (CtMethod) new CtPathStringBuilder().fromString(".spoon.test.path.Foo.bar").evaluateOn(factory.getModel().getRootPackage()).iterator().next();
try {
new CtElementPathBuilder().fromElement(fooMethod, barMethod);
fail("No path should be found to .spoon.test.path.Foo.foo from .spoon.test.path.Foo.bar");
} catch (CtPathException e) {
}
}
Aggregations