Package com.piketec.jenkins.plugins.tpt
Class TestcaseParser
- java.lang.Object
-
- org.xml.sax.helpers.DefaultHandler
-
- com.piketec.jenkins.plugins.tpt.TestcaseParser
-
- All Implemented Interfaces:
ContentHandler
,DTDHandler
,EntityResolver
,ErrorHandler
public class TestcaseParser extends DefaultHandler
Parser for TPT test case execution result (testcase_information.xml) files.- Author:
- jkuhnert, PikeTec GmbH
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
characters(char[] ac, int i, int j)
void
endElement(String uri, String localName, String qName)
static Testcase
parseXml(FilePath xmlFile)
Parse an XML file to retrieve a testcase info instance (non null)void
startElement(String s, String s1, String elementName, Attributes attributes)
-
Methods inherited from class org.xml.sax.helpers.DefaultHandler
endDocument, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl, warning
-
-
-
-
Method Detail
-
parseXml
public static Testcase parseXml(FilePath xmlFile) throws IOException, InterruptedException
Parse an XML file to retrieve a testcase info instance (non null)- Parameters:
xmlFile
- testcase_information.xml- Returns:
- A testcase, filled with the content of the xml-file.
- Throws:
IOException
- if the xml file cannot be read or has a wrong formatInterruptedException
- If the Job is cancelled
-
startElement
public void startElement(String s, String s1, String elementName, Attributes attributes) throws SAXException
- Specified by:
startElement
in interfaceContentHandler
- Overrides:
startElement
in classDefaultHandler
- Throws:
SAXException
-
endElement
public void endElement(String uri, String localName, String qName) throws SAXException
- Specified by:
endElement
in interfaceContentHandler
- Overrides:
endElement
in classDefaultHandler
- Throws:
SAXException
-
characters
public void characters(char[] ac, int i, int j) throws SAXException
- Specified by:
characters
in interfaceContentHandler
- Overrides:
characters
in classDefaultHandler
- Throws:
SAXException
-
-