| Revision 367,
1.3 KB
checked in by zach, 4 years ago
(diff) |
- Making sure test window closes when complete
- Removing trace from MediaProviderTest
|
| Line | |
|---|
| 1 | package { |
|---|
| 2 | import flash.system.System; |
|---|
| 3 | |
|---|
| 4 | import org.flexunit.flexui.TestRunnerBase; |
|---|
| 5 | import org.flexunit.listeners.UIListener; |
|---|
| 6 | import org.flexunit.runner.FlexUnitCore; |
|---|
| 7 | import org.flexunit.runner.notification.async.XMLListener; |
|---|
| 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 | */ |
|---|
| 16 | public class PlayerTestLauncher { |
|---|
| 17 | private var visualRunner:TestRunnerBase; |
|---|
| 18 | private var core:FlexUnitCore; |
|---|
| 19 | |
|---|
| 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); |
|---|
| 32 | } |
|---|
| 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 { |
|---|
| 40 | flash.system.System.exit(status); |
|---|
| 41 | } |
|---|
| 42 | } |
|---|
| 43 | } |
|---|
Note: See
TracBrowser
for help on using the repository browser.