Package ghidra.util.xml
Class XmlTestHelper
- java.lang.Object
-
- ghidra.util.xml.XmlTestHelper
-
public class XmlTestHelper extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description XmlTestHelper(java.lang.String tmpDirPath)
XmlTestHelper(java.lang.String tmpDirPath, GhidraProject gp)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(java.lang.String xml)
static void
assertXMLFilesEquals(XmlPullParser expectedXMLParser, XmlPullParser testXMLParser)
static void
assertXMLFilesEquals(java.io.File expectedXMLFile, java.io.File testXMLFile)
void
clearXml()
void
compareXml(java.io.File file)
boolean
containsXml(java.lang.String line)
void
dispose()
GhidraProject
getProject()
java.io.File
getTempFile(java.lang.String name)
XmlPullParser
getXmlParser(java.lang.String name)
Program
loadResourceProgram(java.lang.String programName)
void
loadXmlResource(java.lang.Package pkg, java.lang.String name)
Read an XML file as a resource.void
printExpectedLines()
-
-
-
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 residesname
- 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)
-
getProject
public GhidraProject getProject()
-
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()
-
loadResourceProgram
public Program loadResourceProgram(java.lang.String programName) throws java.io.IOException, CancelledException, DuplicateNameException, InvalidNameException, VersionException
- Throws:
java.io.IOException
CancelledException
DuplicateNameException
InvalidNameException
VersionException
-
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)
-
-