Class XmlTestHelper


  • public class XmlTestHelper
    extends java.lang.Object
    • Constructor Detail

      • XmlTestHelper

        public XmlTestHelper​(java.lang.String tmpDirPath,
                             GhidraProject gp)
                      throws java.lang.Exception
        Throws:
        java.lang.Exception
      • XmlTestHelper

        public XmlTestHelper​(java.lang.String tmpDirPath)
                      throws java.lang.Exception
        Throws:
        java.lang.Exception
    • Method Detail

      • dispose

        public void dispose()
      • add

        public void add​(java.lang.String xml)
      • loadXmlResource

        public void loadXmlResource​(java.lang.Package pkg,
                                    java.lang.String name)
                             throws java.io.IOException
        Read an XML file as a resource.
        Parameters:
        pkg - where resource resides
        name - name of the resource that is in the given package
        Throws:
        java.io.IOException - thrown if there was a problem accessing the xml resource.
      • getTempFile

        public java.io.File getTempFile​(java.lang.String name)
      • compareXml

        public void compareXml​(java.io.File file)
                        throws java.lang.Exception
        Throws:
        java.lang.Exception
      • containsXml

        public boolean containsXml​(java.lang.String line)
      • printExpectedLines

        public void printExpectedLines()
      • getXmlParser

        public XmlPullParser getXmlParser​(java.lang.String name)
                                   throws java.io.IOException,
                                          org.xml.sax.SAXException
        Throws:
        java.io.IOException
        org.xml.sax.SAXException
      • clearXml

        public void clearXml()
      • assertXMLFilesEquals

        public static void assertXMLFilesEquals​(java.io.File expectedXMLFile,
                                                java.io.File testXMLFile)
                                         throws org.xml.sax.SAXException,
                                                java.io.IOException
        Throws:
        org.xml.sax.SAXException
        java.io.IOException
      • assertXMLFilesEquals

        public static void assertXMLFilesEquals​(XmlPullParser expectedXMLParser,
                                                XmlPullParser testXMLParser)