public class XMLDog extends Object implements XMLDogConstants
APP_NAME, DEBUG, EVENT_NODE_IDENTICAL, EVENT_NODE_MISMATCH, EVENT_NODE_SIMILAR
Constructor and Description |
---|
XMLDog()
Default Constructor.
|
XMLDog(Config config)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
Differences |
compare(File controlFile,
File testFile)
Compares Test XML file with the Control XML file.
|
Differences |
compare(String controlFilename,
String testFilename)
Compares test document with the control document.
|
void |
compareDir(String controlDirPath,
String testDirPath,
String resultDirPath,
String suffix)
Compares XML files in the control directory with the corresponding files in the test directory.
|
Document |
getDocument(String xmlFilePath)
Gets Document for a given XML file path.
|
static void |
log(String msg)
Prints msg to System.out.
|
static void |
log(String msg,
Throwable t)
Prints msg and Exception to System.out.
|
static void |
main(String[] args)
Main method for debugging purpose only.
|
void |
setConfig(Config config)
Sets config.
|
public XMLDog() throws ParserConfigurationException
ParserConfigurationException
public XMLDog(Config config) throws ParserConfigurationException
config
- the XML Parser ConfigurationParserConfigurationException
Config
public Differences compare(String controlFilename, String testFilename) throws SAXException, IOException
controlFilename
- the name of the control/golden XML filetestFilename
- the name of the test XML fileSAXException
IOException
Differences
public void setConfig(Config config) throws ParserConfigurationException
ParserConfigurationException
public Differences compare(File controlFile, File testFile) throws SAXException, IOException
SAXException
IOException
Differences, FileUtil.writeListAsStr()
public void compareDir(String controlDirPath, String testDirPath, String resultDirPath, String suffix) throws SAXException, IOException
controlDirPath
- the directory containing control docstestDirPath
- the directory containing test docssuffix
- the suffix string to be appended to each file in controlDirPath, if null nothing will be
appendedSAXException
IOException
public Document getDocument(String xmlFilePath) throws SAXException, IOException
xmlFilePath
- the path of the XML fileSAXException
IOException
public static void log(String msg)
public static void main(String[] args)
args
- array of program argumentsCopyright © 2016. All rights reserved.