XmlSuiteResultFormatter

public class XmlSuiteResultFormatter
extends Object implements IFormatterGenerator

java.lang.Object
   ↳ com.android.tradefed.result.suite.XmlSuiteResultFormatter


Utility class to save a suite run as an XML. TODO: Remove all the special Compatibility Test format work around to get the same format.

Summary

Constants

String TEST_RESULT_FILE_NAME

Fields

public static final String NS

Public constructors

XmlSuiteResultFormatter()

Public methods

void addBuildInfoAttributes(XmlSerializer serializer, SuiteResultHolder holder)

Allows to add some attributes to the tag via serializer.attribute.

void addSuiteAttributes(XmlSerializer serializer)

Allows to add some attributes to the tag via serializer.attribute.

void parseBuildInfoAttributes(XmlPullParser parser, IInvocationContext context)

Reverse operation from addBuildInfoAttributes(XmlSerializer, SuiteResultHolder).

SuiteResultHolder parseResults(File resultDir)

Reverse operation of writeResults(SuiteResultHolder, File) which takes a result directory and create the SuiteResultHolder out of it.

void parseSuiteAttributes(XmlPullParser parser, IInvocationContext context)

Reverse operation from addSuiteAttributes(XmlSerializer).

File writeResults(SuiteResultHolder holder, File resultDir)

Write the invocation results in an xml format.

Constants

TEST_RESULT_FILE_NAME

public static final String TEST_RESULT_FILE_NAME

Constant Value: "test_result_suite.xml"

Fields

NS

public static final String NS

Public constructors

XmlSuiteResultFormatter

public XmlSuiteResultFormatter ()

Public methods

addBuildInfoAttributes

public void addBuildInfoAttributes (XmlSerializer serializer, 
                SuiteResultHolder holder)

Allows to add some attributes to the tag via serializer.attribute.

Throws
IllegalArgumentException
IllegalStateException
IOException
IllegalArgumentException
IllegalStateException

addSuiteAttributes

public void addSuiteAttributes (XmlSerializer serializer)

Allows to add some attributes to the tag via serializer.attribute.

Throws
IOException
IllegalArgumentException
IllegalStateException

parseBuildInfoAttributes

public void parseBuildInfoAttributes (XmlPullParser parser, 
                IInvocationContext context)

Reverse operation from addBuildInfoAttributes(XmlSerializer, SuiteResultHolder).

Parameters
parser XmlPullParser: The parser where to read the attributes from.

context IInvocationContext: The IInvocationContext where to put the attributes.

Throws
XmlPullParserException

parseResults

public SuiteResultHolder parseResults (File resultDir)

Reverse operation of writeResults(SuiteResultHolder, File) which takes a result directory and create the SuiteResultHolder out of it.

Parameters
resultDir File: The directory where to find the results.

Returns
SuiteResultHolder A SuiteResultHolder containing the results representation. Or null if anything goes wrong.

Throws
IOException

parseSuiteAttributes

public void parseSuiteAttributes (XmlPullParser parser, 
                IInvocationContext context)

Reverse operation from addSuiteAttributes(XmlSerializer).

Parameters
parser XmlPullParser: The parser where to read the attributes from.

context IInvocationContext: The IInvocationContext where to put the attributes.

Throws
XmlPullParserException

writeResults

public File writeResults (SuiteResultHolder holder, 
                File resultDir)

Write the invocation results in an xml format.

Parameters
holder SuiteResultHolder: a SuiteResultHolder holding all the info required for the xml

resultDir File: the result directory File where to put the results.

Returns
File a File pointing to the xml output file.

Throws
IOException