Do not catch instantiation exceptions during augment 28/94628/5
authorRobert Varga <robert.varga@pantheon.tech>
Thu, 14 Jan 2021 08:39:33 +0000 (09:39 +0100)
committerRobert Varga <robert.varga@pantheon.tech>
Thu, 14 Jan 2021 11:29:48 +0000 (12:29 +0100)
commit4cf9500ea52a77d1b71024093aefe5d45d92827e
tree27e7db41609f25259517ddd6b9f25f067f81b771
parent27709b9466a704c93cdabf06ccd902becb8bbbf5
Do not catch instantiation exceptions during augment

The try/catch block here is overly broad and ill-defined, as it
suppresses failures produced by onStatementAdded().

A number of test cases actually worked around this by checking
either effects of the omission or that the presence of a message
being logged. These are corrected to assert the equivalent failure.

This necessitates splitting Bug8126Test into legal and illegal parts.

JIRA: YANGTOOLS-1186
Change-Id: Icd7c15ed82df38ccbdbd64e635c5a479e5a180aa
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
14 files changed:
yang/yang-parser-rfc7950/src/main/java/org/opendaylight/yangtools/yang/parser/rfc7950/stmt/augment/AugmentInferenceAction.java
yang/yang-parser-rfc7950/src/test/java/org/opendaylight/yangtools/yang/parser/stmt/rfc7950/Bug6876Test.java
yang/yang-parser-rfc7950/src/test/java/org/opendaylight/yangtools/yang/stmt/Bug5335Test.java
yang/yang-parser-rfc7950/src/test/java/org/opendaylight/yangtools/yang/stmt/Bug6669Test.java
yang/yang-parser-rfc7950/src/test/java/org/opendaylight/yangtools/yang/stmt/Bug8126Test.java
yang/yang-parser-rfc7950/src/test/java/org/opendaylight/yangtools/yang/stmt/YangParserNegativeTest.java
yang/yang-parser-rfc7950/src/test/resources/bugs/bug8126/inv-choice/foo.yang [moved from yang/yang-parser-rfc7950/src/test/resources/bugs/bug8126/foo.yang with 100% similarity]
yang/yang-parser-rfc7950/src/test/resources/bugs/bug8126/inv-choice/ill1.yang [new file with mode: 0644]
yang/yang-parser-rfc7950/src/test/resources/bugs/bug8126/inv-cont/foo.yang [new file with mode: 0644]
yang/yang-parser-rfc7950/src/test/resources/bugs/bug8126/inv-cont/ill3.yang [new file with mode: 0644]
yang/yang-parser-rfc7950/src/test/resources/bugs/bug8126/inv-list/foo.yang [new file with mode: 0644]
yang/yang-parser-rfc7950/src/test/resources/bugs/bug8126/inv-list/ill2.yang [new file with mode: 0644]
yang/yang-parser-rfc7950/src/test/resources/bugs/bug8126/valid/bar.yang [moved from yang/yang-parser-rfc7950/src/test/resources/bugs/bug8126/bar.yang with 54% similarity]
yang/yang-parser-rfc7950/src/test/resources/bugs/bug8126/valid/foo.yang [new file with mode: 0644]