Package | asunit.textui |
Class | public class XMLResultPrinter |
Inheritance | XMLResultPrinter ResultPrinter flash.display.Sprite |
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.
Property | Defined by | ||
---|---|---|---|
results : Dictionary | XMLResultPrinter | ||
startTime : Number | ResultPrinter | ||
testTimes : Array | ResultPrinter |
Method | Defined by | ||
---|---|---|---|
XMLResultPrinter | |||
XMLResultPrinter | |||
XMLResultPrinter | |||
XMLResultPrinter | |||
endTestMethod(test:Test, methodName:String):void
| XMLResultPrinter | ||
onFormatTimeout(format:TextFormat, startIndex:uint, endIndex:uint):void
| ResultPrinter | ||
print(... args):void
| ResultPrinter | ||
printDefect(booBoo:TestFailure, count:int):void
| ResultPrinter | ||
println(... args):void
| ResultPrinter | ||
printResult(result:TestResult, runTime:Number):void
| XMLResultPrinter | ||
API for use by textui.TestRunner
| ResultPrinter | ||
setShowTrace(showTrace:Boolean):void
| ResultPrinter | ||
XMLResultPrinter | |||
startTestMethod(test:Test, methodName:String):void
| XMLResultPrinter |
results | property |
protected var results:Dictionary
XMLResultPrinter | () | constructor |
public function XMLResultPrinter()
addError | () | method |
addFailure | () | method |
public override function addFailure(test:Test, t:AssertionFailedError):void
Parameters
test:Test |
|
t:AssertionFailedError |
endTest | () | method |
endTestMethod | () | method |
public override function endTestMethod(test:Test, methodName:String):void
Parameters
test:Test |
|
methodName:String |
printResult | () | method |
public override function printResult(result:TestResult, runTime:Number):void
Parameters
result:TestResult |
|
runTime:Number |
startTest | () | method |
startTestMethod | () | method |
public override function startTestMethod(test:Test, methodName:String):void
Parameters
test:Test |
|
methodName:String |
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>