Correct deref() leafref handling 49/86549/8
authorRobert Varga <robert.varga@pantheon.tech>
Mon, 23 Dec 2019 19:06:56 +0000 (20:06 +0100)
committerRobert Varga <robert.varga@pantheon.tech>
Tue, 24 Dec 2019 20:07:29 +0000 (21:07 +0100)
commit2ef2f65082021eab8213c4a9e0d71a2cc42a6962
tree9dcf7638cec5569210021ab0aa1147bbf2c93403
parent2788395b6edecb26c9c2e59b2ab94275e8276987
Correct deref() leafref handling

deref() invocation requires the target node to actually be examined,
derefenced and any subsequent path evaluated on top of it.

We correct the implementation to account for correct derefence and
add a UT for a confusing test case. This is implemented using
YangParserTestUtils in a separate internal artifact, hence future
test cases are easy to implement.

JIRA: YANGTOOLS-1050
Change-Id: I0777da339577f93ecc2786f5beab40b29554fe0e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
yang/pom.xml
yang/yang-model-util-ut/pom.xml [new file with mode: 0644]
yang/yang-model-util-ut/src/test/java/org/opendaylight/yangtools/yang/model/util/ut/LeafrefStaticAnalysisTest.java [new file with mode: 0644]
yang/yang-model-util-ut/src/test/java/org/opendaylight/yangtools/yang/model/util/ut/YT1050Test.java [new file with mode: 0644]
yang/yang-model-util-ut/src/test/java/org/opendaylight/yangtools/yang/model/util/ut/package-info.java [new file with mode: 0644]
yang/yang-model-util-ut/src/test/resources/leafrefs.yang [new file with mode: 0644]
yang/yang-model-util-ut/src/test/resources/yt1050.yang [new file with mode: 0644]
yang/yang-model-util/src/main/java/org/opendaylight/yangtools/yang/model/util/SchemaContextUtil.java
yang/yang-model-util/src/test/java/org/opendaylight/yangtools/yang/model/util/SchemaContextUtilTest.java