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

    • Improvement
    • Status: Closed
    • Low
    • Resolution: Fixed
    • None
    • 2.26.00-alpha-1, 2.26.00
    • None

    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

            jsheriff Junaidh Kadhar Sheriff
            wko Woonsan Ko (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: