Suite (Runner class)

From FlexUnit4 Project Documentation
Revision as of 11:05, 9 June 2010 by Jadkins (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Suite (Runner Class)

The Suite runner is used with FlexUnit 4 style suites. If you are using FlexUnit .9 suites, see SuiteMethod.

The Suite Runner is used in two ways. The first way is any time RunWith is specified with the Suite runner. This is the most common way the runner called. It will introspect the class and pass any public (this is important) classes back as possible test classes. Any empty Suite will throw an InitializationError. <source lang="actionscript">

    [Suite]
    [RunWith("org.flexunit.runners.Suite")]
    public class SuitesToRun
    {
         public var mySuite:MySuite;
         public var anotherSuite:AnotherSuite;
    }

</source>

The second way is using a request. When a request is specified with a list of classes or a method, the framework builds them into a suite class before running any of the tests. <source lang="actionscript">

    core = new FlexUnitCore();
    core.run( Request.classes( MyTestClass, AnotherTestClass );

</source>

Back

Personal tools