Improve SchemaInferenceStack error reporting 83/97683/5
authorRobert Varga <robert.varga@pantheon.tech>
Wed, 29 Sep 2021 13:34:37 +0000 (15:34 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Wed, 29 Sep 2021 14:26:23 +0000 (16:26 +0200)
commitb13eeb7d98bd4cc1374604a6047e78ed70efd04b
tree0781ae8266095ea2120f0d36c82d48aa33beb830
parenta5ff861c56bd331485f9fc3fd6bf5afa02fc7627
Improve SchemaInferenceStack error reporting

Include a description of parent's identity when we fail to locate
its child. This makes it easier to understand what is going on in most
failure situations.

The message now ends with something like
- not present in schema parent (namespace)parentName
- not present in grouping (namespace)groupingName
- not present in module (namespace)moduleName
or similar.

Also expand the test suite to cover negative scenarios around
enterChoice().

JIRA: YANGTOOLS-1336
Change-Id: I8a642dcd0fe5705f4c33c1a3e9d779c6db91ef24
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
model/yang-model-util/src/main/java/org/opendaylight/yangtools/yang/model/util/SchemaInferenceStack.java
model/yang-model-util/src/test/java/org/opendaylight/yangtools/yang/model/util/LeafrefStaticAnalysisTest.java
model/yang-model-util/src/test/java/org/opendaylight/yangtools/yang/model/util/SchemaInferenceStackTest.java
model/yang-model-util/src/test/java/org/opendaylight/yangtools/yang/model/util/YT1231Test.java