Class XmlResource

  • All Implemented Interfaces:
    org.junit.rules.TestRule

    @Deprecated
    public class XmlResource
    extends TestResource<org.dom4j.Document>
    Deprecated.
    Load an XML resource into memory for testing purposes.

    E.g. the following files reside in a Maven module with Surefire setup:

    • src/test/java/com/atlassian/confluence/notifications/impl/VersionedTemplateTest.java
    • src/test/resources/com/atlassian/confluence/notifications/impl/multiple-version-groups-expected.xml
    • src/test/resources/com/atlassian/confluence/notifications/impl/multiple-version-groups-source.xml
    then you can load the files in the test class the following way:
     {@code public class VersionedTemplateTest
       {
    • Constructor Detail

      • XmlResource

        public XmlResource​(Class testClass,
                           String nameSuffix)
        Deprecated.
    • Method Detail

      • load

        protected org.dom4j.Document load​(InputStream testResourceStream)
        Deprecated.
        Specified by:
        load in class TestResource<org.dom4j.Document>
      • assertEquals

        public void assertEquals​(org.dom4j.Document actualDocument)
        Deprecated.
      • serialize

        public static String serialize​(org.dom4j.Document document)
        Deprecated.