source: trunk/fl5/test/PlayerTestLauncher.as @ 367

Revision 367, 1.3 KB checked in by zach, 4 years ago (diff)
  • Making sure test window closes when complete
  • Removing trace from MediaProviderTest
RevLine 
[276]1package {
[365]2                import flash.system.System;
3               
[280]4                import org.flexunit.flexui.TestRunnerBase;
5                import org.flexunit.listeners.UIListener;
6                import org.flexunit.runner.FlexUnitCore;
[287]7                import org.flexunit.runner.notification.async.XMLListener;
[276]8       
9        /**
10         * The test launcher sets up the FlexUnit enviroment for testing, adds the test suites, and
11         * creates the ResultPrinter.
12         *
13         * @author zach@longtailvideo.com
14         * @date 2009-08-18
15         */
[294]16        public class PlayerTestLauncher {
[280]17                private var visualRunner:TestRunnerBase;
[365]18                private var core:FlexUnitCore;                 
[280]19
[365]20                public function PlayerTestLauncher(visualRunner:TestRunnerBase = null) {
21                        try {
22                                core = new FlexUnitCore();
23                                if (visualRunner) {
24                                        this.visualRunner = visualRunner;
25                                        core.addListener(new UIListener(visualRunner));
26                                }
27                                core.addListener(new XMLListener("Astaire"));
28                                core.addListener(new PlayerTestRunListener(this, new PlayerTestResultPrinter()));
29                                core.run(PlayerTestSuite);
30                        } catch (err:Error){
31                                trace (err);
[280]32                        }
[276]33                }
34               
35                /**
36                 * Terminates the Air Debug Launcher, with an appropriate status code, when testing is done.
37                 * @param status The appropriate exit code.
38                 */
39                public function complete(status:Number):void {
[367]40                        flash.system.System.exit(status);
[276]41                }
42        }
43}
Note: See TracBrowser for help on using the repository browser.