package UU.Testing { import flash.events.* ; public class BaseTestDriver { public var app : Object ; public var resetfunction : Function ; public var testsuite : Array = new Array() ; public function BaseTestDriver(app_ : Object, resetf : Function) { app = app_ ; resetfunction = resetf ; } public function getEventDispatcher(id : String) : EventDispatcher { // override this function return null ; } public function getComponentProperty(id : String, prop : String) : Object { // override this function return null ; } public function setComponentProperty(id : String, prop : String, val : Object) : void { // override this function } public function reset() : void { resetfunction() ; } public function step(targetEventDispatcher : String, event : Event , args : Array) : void { var argi : Array ; for (var i:int = 0; i< args.length; i++ ) { argi = args[i] ; setComponentProperty(argi[0],argi[1],argi[2]) ; } var disp : EventDispatcher = getEventDispatcher(targetEventDispatcher) ; disp.dispatchEvent(event) ; } public function addTestCase(name: String, tc : Function) : void { var n : uint = testsuite.length ; testsuite[n] = [name,tc] ; } public function clearTestSuite() : void { testsuite = new Array() ; } public function runTestSuite() : Array { trace("** Start testing...") ; var results : Array = new Array() ; for (var i:int; i