Uploaded image for project: 'yangtools'
  1. yangtools
  2. YANGTOOLS-725

yang-system-test is unable to access yang files

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • Resolution: Done
    • None
    • None
    • None
    • None
    • Operating System: All
      Platform: All

    • 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)

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            ifoltin Igor Foltin
            vrpolak Vratko Polak
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: