import org.opendaylight.yangtools.yang.model.api.LeafSchemaNode;
import org.opendaylight.yangtools.yang.model.api.ListSchemaNode;
import org.opendaylight.yangtools.yang.model.api.Module;
-import org.opendaylight.yangtools.yang.model.api.SchemaNode;
import org.opendaylight.yangtools.yang.model.api.TypeDefinition;
+import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
import org.opendaylight.yangtools.yang.model.api.type.LeafrefTypeDefinition;
import org.opendaylight.yangtools.yang.test.util.YangParserTestUtils;
final TypeDefinition<?> typeNodeType = secondaryType.getType();
assertThat(typeNodeType, isA(LeafrefTypeDefinition.class));
- final SchemaNode found = SchemaContextUtil.findDataSchemaNodeForRelativeXPath(context, module, secondaryType,
- ((LeafrefTypeDefinition) typeNodeType).getPathStatement());
+ final SchemaInferenceStack stack = SchemaInferenceStack.of(context);
+ stack.enterGrouping(QName.create(module.getQNameModule(), "grp"));
+ stack.enterSchemaTree(QName.create(module.getQNameModule(), "secondary"));
+ stack.enterSchemaTree(secondaryType.getQName());
+ final EffectiveStatement<?, ?> found = stack.resolvePathExpression(((LeafrefTypeDefinition) typeNodeType)
+ .getPathStatement());
assertSame(primaryType, found);
}
}