TestResult Output Formats

MXUnit TestResult output formats

MXUnit provides a high level of flexibility by providing test results in various output formats. Some of these are preformatted, such as HTML, and others are raw to allow developers to generate customizable output formats.

The available TestResult output formats are:

  1. HTML Format
  2. ExtJs Format (deprecated)
  3. XML Format
  4. JUnit Report XML
  5. ColdFusion Query Format
  6. ColdFusion Array format
    We will use the MXUnit example found in the installation package mxunit/samples/MyTestSuite.cfm as the base TestResults. You may want to refer to your local TestResult API for details; e.g., http://localhost:8500/mxunit/doc/api/

The syntax for generating the various types of output is:

Note: Since the above query and array types are complex data structures, you will get an error by trying to print those directly, as illustrated above. You most likely be computing other outputs if you use those types.

Following are simple examples of how to handle the various output types.

Note that in order to toggle between HTML and ExtJs format, pass in a URL.output=['html'|'extjs'] to your TestSuite

1. HTML Format

The HTML output is basic preformatted HTML:

2. ExtJs Format

ExtJs is a rich user interface set of APIs written in JavaScript.

3. XML Format

This is basic raw XML format that can be transformed into custom HTML output.

4. JUnit Report XML

This is an XML format that is used by Ant's JunitReport Task. Also see the MXUnit Ant Task for usage information.

5. ColdFusion Query Format

Returns a CF Query object that you can loop over as if it were a database query.

Summary data members ( q = results.getResultsOutput('query') ) :
q.testRuns = How many tests were run,
q.failures = How many tests fail,
q.errors = How many errors occurred,
q.successes = How many successes occurred,
q.totalExecutionTime = How long it took, in milliseconds, to run all the tests

6. ColdFusion Array Format

This is how internal test results are stored within the TestResult component.
To access specific members, you can execute the following:

Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.