Package ghidra.util.xml

# Class XmlTestHelper

java.lang.Object
ghidra.util.xml.XmlTestHelper

public class XmlTestHelper extends Object

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `XmlTestHelper(String tmpDirPath)`
  `XmlTestHelper(String tmpDirPath, GhidraProject gp)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `add(String xml)`
  `static void`
  `assertXMLFilesEquals(XmlPullParser expectedXMLParser, XmlPullParser testXMLParser)`
  `static void`
  `assertXMLFilesEquals(File expectedXMLFile, File testXMLFile)`
  `void`
  `clearXml()`
  `void`
  `compareXml(File file)`
  `boolean`
  `containsXml(String line)`
  `void`
  `dispose()`
  `GhidraProject`
  `getProject()`
  `File`
  `getTempFile(String name)`
  `XmlPullParser`
  `getXmlParser(String name)`
  `Program`
  `loadResourceProgram(String programName)`
  `void`
  `loadXmlResource(Package pkg, String name)`
  Read an XML file as a resource.
  `void`
  `printExpectedLines()`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### XmlTestHelper

    public XmlTestHelper(String tmpDirPath, GhidraProject gp) throws Exception
    Throws:
      `Exception`

  - ### XmlTestHelper

    public XmlTestHelper(String tmpDirPath) throws Exception
    Throws:
      `Exception`

- ## Method Details

  - ### dispose

    public void dispose()

  - ### add

    public void add(String xml)

  - ### loadXmlResource

    public void loadXmlResource(Package pkg, String name) throws 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:
      `IOException` - thrown if there was a problem accessing the xml resource.

  - ### getTempFile

    public File getTempFile(String name)

  - ### getProject

    public GhidraProject getProject()

  - ### compareXml

    public void compareXml(File file) throws Exception
    Throws:
      `Exception`

  - ### containsXml

    public boolean containsXml(String line)

  - ### printExpectedLines

    public void printExpectedLines()

  - ### getXmlParser

    public XmlPullParser getXmlParser(String name) throws IOException, SAXException
    Throws:
      `IOException`
      `SAXException`

  - ### clearXml

    public void clearXml()

  - ### loadResourceProgram

    public Program loadResourceProgram(String programName) throws IOException, CancelledException, DuplicateNameException, InvalidNameException, VersionException
    Throws:
      `IOException`
      `CancelledException`
      `DuplicateNameException`
      `InvalidNameException`
      `VersionException`

  - ### assertXMLFilesEquals

    public static void assertXMLFilesEquals(File expectedXMLFile, File testXMLFile) throws SAXException, IOException
    Throws:
      `SAXException`
      `IOException`

  - ### assertXMLFilesEquals

    public static void assertXMLFilesEquals(XmlPullParser expectedXMLParser, XmlPullParser testXMLParser)