Class org.as2lib.test.unit.TestSuite

Implemented Interfaces

Test TestRunner

Description

TestSuite is a composite implementation of Test.

A TestSuite is a collection of Tests. A TestSuite does not contain any executable code but it may contain different Tests that can be added with addTest.

In contrast to TestCase the TestSuite has no external TestRunner. TestSuite is its own implementation of TestRunner.

See Also

Field Index

Inherited from LogSupport

Method Index

new TestSuite()
addProcess(), addTest(), blockCollecting(), getCurrentTestCase(), getCurrentTestCaseMethodInfo(), getName(), getTestResult(), getTestRunner(), getTests(), onProcessError(), run()

Inherited from BatchProcess

Inherited from AbstractProcess

Inherited from AbstractTimeConsumer

Inherited from EventSupport

Inherited from LogSupport

Inherited from BasicClass

Constructor Detail

TestSuite

public function TestSuite(name:String)

Constructs a new TestSuite.

Parameters

namename of the TestSuite

Method Detail

blockCollecting

static public function blockCollecting(Void):Boolean

Blocks the collection of .

Return

true to block the collection

addProcess

public function addProcess(p:Process):Void

Adds a process to the TestSuite.

TestSuite does only allow TestRunner as sub processes.

Overrides the implementation in BatchProcess.addProcess.

Parameters

p Process to be added to the TestSuite

Throws

IllegalArgumentExceptionif the passed-in p contains this instance as child.

Specified By

addProcess() in org.as2lib.app.exec.Batch

Overrides

addProcess() in org.as2lib.app.exec.BatchProcess

addTest

public function addTest(test:Test):Void

Adds a Test to the TestSuite.

Parameters

test Test to be added

Throws

IllegalArgumentExceptionif the passed-in Test contains this instance as child.

getName

public function getName(Void):String

Returns the name of the TestSuite.

Return

name of the TestSuite.

run

public function run(Void):TestRunner

Runs the TestSuite.

Return

TestRunner that run this test

Specified By

run() in org.as2lib.test.unit.Test

Overrides

run() in org.as2lib.app.exec.AbstractProcess

getTestRunner

public function getTestRunner(Void):TestRunner

Returns the TestRunner that executes this TestSuite.

Return

TestRunner that executes this TestSuite

Specified By

getTestRunner() in org.as2lib.test.unit.Test

getTests

public function getTests(Void):TypedArray

Returns all Tests contained within this TestSuite.

Return

TypedArray that contains all Tests of this TestSuite.

onProcessError

public function onProcessError(process:Process, error):Boolean

Event handling for a error during a proces.

Parameters

process Process that throws the error

Return

false to stop further execution

Specified By

onProcessError() in org.as2lib.app.exec.ProcessErrorListener

Overrides

onProcessError() in org.as2lib.app.exec.BatchProcess

getTestResult

public function getTestResult(Void):TestResult

Returns the TestResult to the TestSuite.

The returned TestResult may not be complete. This is the case if the test has not been executed or has not finished yet.

Return

TestResult for the TestSuite that contains all informations

Specified By

getTestResult() in org.as2lib.test.unit.TestRunner

getCurrentTestCase

public function getCurrentTestCase(Void):TestCaseResult

Returns the current executing TestCaseResult.

It is necessary to get the TestCaseResult for the TestCase that just gets executed because there can be more than one TestCase available within a TestResult.

Return

TestResult to the current executing TestCase

Specified By

getCurrentTestCase() in org.as2lib.test.unit.TestRunner

getCurrentTestCaseMethodInfo

public function getCurrentTestCaseMethodInfo(Void):TestCaseMethodInfo

Returns the current executing TestCaseMethodInfo.

It is necessary to get the TestCaseMethodInfo for the method that just gets executed because there can be more than one methods available within a TestCaseResult.

Return

informations about the current executing method

Specified By

getCurrentTestCaseMethodInfo() in org.as2lib.test.unit.TestRunner

See Also