Uploaded image for project: '[Read Only] - Hippo Repository'
  1. [Read Only] - Hippo Repository
  2. REPO-817

TestUtils - Support MockNode fromXml() with URL argument

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Low
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.26.00-alpha-1, 2.26.00
    • Component/s: None
    • Labels:

      Description

      Currently, MockNode#fromXml(String resourceName) is only supported with absolute resource name which should be starting with leading slash and fully qualified names.

      However, in real unit tests, I think it would be more helpful if we support URL argument as well.
      For example, a unit test can be written like this:

      MockNode folderNode = MockNodeFactory.fromXml(getClass().getResource("testcontent1.xml"));
      Node handleNode = folderNode.getNode("myarticle1");

      As you can see, getClass().getResource(resourceName) seems very useful in many cases because you don't have to create the absolute resource name, but you can simply use the class context relative resource name there.

        Attachments

          Activity

            People

            Assignee:
            jsheriff Junaidh Kadhar Sheriff
            Reporter:
            wko Woonsan Ko
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: