[YANGTOOLS-725] yang-system-test is unable to access yang files Created: 16/Dec/16  Updated: 10/Apr/22  Resolved: 03/Jan/17

Status: Resolved
Project: yangtools
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug
Reporter: Vratko Polak Assignee: Igor Foltin
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All


External issue ID: 7395

 Description   

yang-system-test-*-jar-with-dependencies.jar is a fat jar packing all required dependencies, so the class loader used is looking only inside this jar.
Yang files to be tested are not there, they are on the filesystem.

But the implementation uses YangParserTestUtils.class.getResource() which does not find the filesystem source, returns null, which is not handled.

This means any non-trivial invocation results in NPE:
$ java -jar yang-system-test-1.1.0-SNAPSHOT-jar-with-dependencies.jar -p .
Dec 16, 2016 11:58:53 AM org.opendaylight.yangtools.yang.parser.system.test.Main runSystemTest
SEVERE: Failed to create SchemaContext.
java.lang.NullPointerException
at org.opendaylight.yangtools.yang.test.util.YangParserTestUtils.getYangFiles(YangParserTestUtils.java:483)
at org.opendaylight.yangtools.yang.test.util.YangParserTestUtils.parseYangSources(YangParserTestUtils.java:471)
at org.opendaylight.yangtools.yang.test.util.YangParserTestUtils.parseYangSources(YangParserTestUtils.java:430)
at org.opendaylight.yangtools.yang.parser.system.test.Main.runSystemTest(Main.java:116)
at org.opendaylight.yangtools.yang.parser.system.test.Main.main(Main.java:99)



 Comments   
Comment by Igor Foltin [ 19/Dec/16 ]

fix: https://git.opendaylight.org/gerrit/#/c/49563/

Comment by Vratko Polak [ 03/Jan/17 ]

> fix: https://git.opendaylight.org/gerrit/#/c/49563/

Merged now.

Generated at Wed Feb 07 20:54:07 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.