Packageasunit.textui
Classpublic class ResultPrinter
InheritanceResultPrinter Inheritance flash.display.Sprite
ImplementsTestListener
SubclassesXMLResultPrinter

This is the base class for collecting test output and formatting for different displays. This class simply presents test results as if they were being shown on a terminal. The XMLResultPrinter provides a good example of how this class can be subclassed and used to emit different/additional output.

See also

XMLResultPrinter


Public Properties
 PropertyDefined by
  height : Number
[write-only]
ResultPrinter
  width : Number
[write-only]
ResultPrinter
Protected Properties
 PropertyDefined by
  startTime : Number
ResultPrinter
  testTimes : Array
ResultPrinter
Public Methods
 MethodDefined by
  
ResultPrinter(showTrace:Boolean = false)
ResultPrinter
  
addError(test:Test, t:Error):void
ResultPrinter
  
ResultPrinter
  
endTest(test:Test):void
ResultPrinter
  
endTestMethod(test:Test, methodName:String):void
ResultPrinter
  
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
ResultPrinter
  
run(test:Test):void
API for use by textui.TestRunner
ResultPrinter
  
setShowTrace(showTrace:Boolean):void
ResultPrinter
  
startTest(test:Test):void
ResultPrinter
  
startTestMethod(test:Test, methodName:String):void
ResultPrinter
Protected Methods
 MethodDefined by
  
elapsedTimeAsString(runTime:Number):String
Returns the formatted string of the elapsed time.
ResultPrinter
  
printDefectHeader(booBoo:TestFailure, count:int):void
ResultPrinter
  
printDefects(booBoos:Object, count:int, type:String):void
ResultPrinter
  
ResultPrinter
  
printErrors(result:TestResult):void
ResultPrinter
  
ResultPrinter
  
printFooter(result:TestResult):void
ResultPrinter
  
printHeader(runTime:Number):void
ResultPrinter
  
ResultPrinter
Property detail
heightproperty
height:Number  [write-only]Implementation
    public function set height(value:Number):void
startTimeproperty 
protected var startTime:Number
testTimesproperty 
protected var testTimes:Array
widthproperty 
width:Number  [write-only]Implementation
    public function set width(value:Number):void
Constructor detail
ResultPrinter()constructor
public function ResultPrinter(showTrace:Boolean = false)Parameters
showTrace:Boolean (default = false)
Method detail
addError()method
public function addError(test:Test, t:Error):void

Parameters
test:Test
 
t:Error

See also

addFailure()method 
public function addFailure(test:Test, t:AssertionFailedError):void

Parameters
test:Test
 
t:AssertionFailedError

See also

elapsedTimeAsString()method 
protected function elapsedTimeAsString(runTime:Number):String

Returns the formatted string of the elapsed time. Duplicated from BaseTestRunner. Fix it.

Parameters
runTime:Number

Returns
String
endTest()method 
public function endTest(test:Test):void

Parameters
test:Test

See also

endTestMethod()method 
public function endTestMethod(test:Test, methodName:String):void

Parameters
test:Test
 
methodName:String

See also

onFormatTimeout()method 
public function onFormatTimeout(format:TextFormat, startIndex:uint, endIndex:uint):voidParameters
format:TextFormat
 
startIndex:uint
 
endIndex:uint
print()method 
public function print(... args):voidParameters
... args
printDefect()method 
public function printDefect(booBoo:TestFailure, count:int):voidParameters
booBoo:TestFailure
 
count:int
printDefectHeader()method 
protected function printDefectHeader(booBoo:TestFailure, count:int):voidParameters
booBoo:TestFailure
 
count:int
printDefects()method 
protected function printDefects(booBoos:Object, count:int, type:String):voidParameters
booBoos:Object
 
count:int
 
type:String
printDefectTrace()method 
protected function printDefectTrace(booBoo:TestFailure):voidParameters
booBoo:TestFailure
printErrors()method 
protected function printErrors(result:TestResult):voidParameters
result:TestResult
printFailures()method 
protected function printFailures(result:TestResult):voidParameters
result:TestResult
printFooter()method 
protected function printFooter(result:TestResult):voidParameters
result:TestResult
printHeader()method 
protected function printHeader(runTime:Number):voidParameters
runTime:Number
println()method 
public function println(... args):voidParameters
... args
printResult()method 
public function printResult(result:TestResult, runTime:Number):voidParameters
result:TestResult
 
runTime:Number
printTimeSummary()method 
protected function printTimeSummary():void
run()method 
public function run(test:Test):void

API for use by textui.TestRunner

Parameters
test:Test
setShowTrace()method 
public function setShowTrace(showTrace:Boolean):voidParameters
showTrace:Boolean
startTest()method 
public function startTest(test:Test):void

Parameters
test:Test

See also

startTestMethod()method 
public function startTestMethod(test:Test, methodName:String):void

Parameters
test:Test
 
methodName:String

See also