org.as2lib.app.exec.AbstractProcess +--org.as2lib.test.unit.TestRunner
Process Central TestSystem Class to run Testcases and TestSuites. This is the heart of the TestSystem. All Tests get executed here. It contains a execution service for TestSuites and TestCase.
To use the TestRunner you simple have to instanciate it and run some
TestCase to it.
Example:
import org.as2lib.test.unit.TestRunner;
import org.as2lib.test.unit.LoggerTestListener;
var testRunner:TestRunner = new TestRunner();
testRunner.addProcessListener(new LoggerTestListener());
testRunner.run(new MyTestCase()); // alternativly you have a faster .runTestCase
You can get the result of the running testcase(s) by @see #getTestResult. It contains all Informations about the resulted testcases.
The Testrunner is designed as process so its possible to add Listener to the
TestRunner by addProcessListener. In this way it is possible to build a
graphical view to the TestRunner (TestRunner is the Controller and TestResult the
Model -> MVC).
Note: There is currently no better abstraction Level Possible so we have to differ between TestCase & TestSuite. The current implementation of .run allows only those two classes.
new TestRunner()
addAllProcessListeners(), addProcessListener(), getAllProcessListeners(), getParentProcess(), hasFinished(), hasStarted(), isPaused(), isRunning(), onFinishProcess(), onPauseProcess(), onProcessError(), onResumeProcess(), onStartProcess(), onUpdateProcess(), removeAllProcessListeners(), removeProcessListener(), setParentProcess(), startSubProcess()
static public MAX_TIME_UNTIL_AUTO_PAUSE:Numberstatic public FRAMES_UNTIL_RESUME:Numberpublic function getTestResult(Void):TestResultGetter for the Testresult. The Testresult contains all informations about the process.
Result of the TestRunner.
public function start()public function pause(Void):VoidPauses the process. This is only possible during the execution of a testmethod (not before, not after). Else it will add a error to the methodInfo.
public function isTestCaseMethodFinished(testCaseMethodInfo:TestCaseMethodInfo):Boolean
testCaseMethodInfo | Information about a TestCaseMethod that should be checked if it was run already or not. |
true if a testcasemethod has already been processed.
public function getCurrentTestCase(Void):TestCaseResultGetter for the current executing TestCase.
TestCaseResult Result to the current executing TestCase.
public function getCurrentTestCaseMethodInfo(Void):TestCaseMethodInfoGetter for the current executing TestCaseMethod.
TestCaseMethodInfo Information about the current executing TestCaseMethod
public function getPercentage(Void):NumberDescription copied from AbstractProcess
Getter for the currently executed percentage of the process.
getPercentage() in org.as2lib.app.exec.Process