Fix LibraryModulesSchemasTest failure 46/54546/1
authorJakub Morvay <jmorvay@cisco.com>
Fri, 24 Mar 2017 08:59:11 +0000 (09:59 +0100)
committerRobert Varga <nite@hq.sk>
Sat, 8 Apr 2017 09:00:35 +0000 (09:00 +0000)
commit751b3f739cb75bef573f0c9390a84800f5e4dcce
tree632fd3639d6885043375943d30ed2603053ac149
parent7b7e857029e1bd2eaab3bcc38fde7a4e70cb090e
Fix LibraryModulesSchemasTest failure

LibraryModulesSchemasTest#testCreateInvalidModulesEntries() tests
filtering invalid modules entries during resolving
ietf-netconf-yang-library/modules-state/modules node.

Resolution goes as follows. We parse xml document containing
ietf-netconf-yang-library/modules-state retrieved from the device with
help of DomToNormalizedNodeParserFactory. Then we filter invalid modules
entries from the parsed modules list node. Module entry is considered
invalid if its revision or schema url are invalid.

However, change in yangtools
https://git.opendaylight.org/gerrit/#/c/53553 causes that parsing
invalid revision will fail whole parsing xml process with unchecked
exception.

For now, do not test modules with bad revision. This is intended just as
a temporary solution. We will also need to slightly change our
ietf-netconf-yang-library/modules-state/modules node resolution logic.
Opened BUG 8071 to track that.

Change-Id: If12ae8d7bf94528088aac81e78b24058c5152283
Signed-off-by: Jakub Morvay <jmorvay@cisco.com>
(cherry picked from commit 95452d33026b37907b541dc47006426e3b3e35ad)
netconf/sal-netconf-connector/src/main/java/org/opendaylight/netconf/sal/connect/netconf/LibraryModulesSchemas.java
netconf/sal-netconf-connector/src/test/java/org/opendaylight/netconf/sal/connect/netconf/LibraryModulesSchemasTest.java
netconf/sal-netconf-connector/src/test/resources/yang-library-fail.xml