Packageasunit.textui
Classpublic class XMLResultPrinter
InheritanceXMLResultPrinter Inheritance ResultPrinter Inheritance flash.display.Sprite

The XMLResultPrinter is used to transform AsUnit test results to JUnit-compatible XML content. This printer will send JUnit-compatible XML content to trace output. The XML content will be enclosed by '<XMLResultPrinter/>' tags.

View the examples.



Public Properties
 PropertyDefined by
 Inheritedheight : Number
ResultPrinter
 Inheritedwidth : Number
ResultPrinter
Protected Properties
 PropertyDefined by
  results : Dictionary
XMLResultPrinter
 InheritedstartTime : Number
ResultPrinter
 InheritedtestTimes : Array
ResultPrinter
Public Methods
 MethodDefined by
  
XMLResultPrinter
  
addError(test:Test, t:Error):void
XMLResultPrinter
  
XMLResultPrinter
  
endTest(test:Test):void
XMLResultPrinter
  
endTestMethod(test:Test, methodName:String):void
XMLResultPrinter
 Inherited
onFormatTimeout(format:TextFormat, startIndex:uint, endIndex:uint):void
ResultPrinter
 Inherited
print(... args):void
ResultPrinter
 Inherited
printDefect(booBoo:TestFailure, count:int):void
ResultPrinter
 Inherited
println(... args):void
ResultPrinter
  
printResult(result:TestResult, runTime:Number):void
XMLResultPrinter
 Inherited
run(test:Test):void
API for use by textui.TestRunner
ResultPrinter
 Inherited
setShowTrace(showTrace:Boolean):void
ResultPrinter
  
startTest(test:Test):void
XMLResultPrinter
  
startTestMethod(test:Test, methodName:String):void
XMLResultPrinter
Protected Methods
 MethodDefined by
 Inherited
elapsedTimeAsString(runTime:Number):String
Returns the formatted string of the elapsed time.
ResultPrinter
 Inherited
printDefectHeader(booBoo:TestFailure, count:int):void
ResultPrinter
 Inherited
printDefects(booBoos:Object, count:int, type:String):void
ResultPrinter
 Inherited
ResultPrinter
 Inherited
printErrors(result:TestResult):void
ResultPrinter
 Inherited
ResultPrinter
 Inherited
printFooter(result:TestResult):void
ResultPrinter
 Inherited
printHeader(runTime:Number):void
ResultPrinter
 Inherited
ResultPrinter
Property detail
resultsproperty
protected var results:Dictionary
Constructor detail
XMLResultPrinter()constructor
public function XMLResultPrinter()
Method detail
addError()method
public override function addError(test:Test, t:Error):voidParameters
test:Test
 
t:Error
addFailure()method 
public override function addFailure(test:Test, t:AssertionFailedError):voidParameters
test:Test
 
t:AssertionFailedError
endTest()method 
public override function endTest(test:Test):voidParameters
test:Test
endTestMethod()method 
public override function endTestMethod(test:Test, methodName:String):voidParameters
test:Test
 
methodName:String
printResult()method 
public override function printResult(result:TestResult, runTime:Number):voidParameters
result:TestResult
 
runTime:Number
startTest()method 
public override function startTest(test:Test):voidParameters
test:Test
startTestMethod()method 
public override function startTestMethod(test:Test, methodName:String):voidParameters
test:Test
 
methodName:String
Examples

package {
    import asunit.textui.TestRunner;
    import asunit.textui.XMLResultPrinter;
    
    public class XMLResultPrinterExample extends TestRunner {

        public function XMLResultPrinterExample() {
            // start(clazz:Class, methodName:String, showTrace:Boolean)
            // NOTE: sending a particular class and method name will
            // execute setUp(), the method and NOT tearDown.
            // This allows you to get visual confirmation while developing
            // visual entities
            setPrinter(new XMLResultPrinter());
            start(AllTests, null, TestRunner.SHOW_TRACE);
        }
    }
}
<testsuites>
  <testsuite name="Flash Profile Card AsUnit Test Suite" errors="1" failures="1" tests="8" time="8.002">
    <testcase classname="lib.test.cases.FailureTest" name="testError" time="0.049">
      <error type="java.lang.NullPointerException">
          <!-- stack trace -->
      </error>
      <failure type="Error">Reference runtime test error</failure>
    </testcase>
    <testcase classname="lib.test.cases.FailureTest" name="testAssertion">
      <failure type="AssertionFailedError">Reference assertion test failure</failure>
    </testcase>
  </testsuite>
</testsuites>