Avg. Rating 4.0

Problem

How to create an application that is able to use the FlexUnit framework classes to create and run tests.

Solution

Download and unpack the FlexUnit framework and include the flexunit.swc in the application's compilation path.

Detailed explanation

The FlexUnit framework includes a graphical test runner and base classes that can be used to create custom tests.

1. Download and unpack the FlexUnit framework

The FlexUnit framework is hosted on Google Code at the following location: http://code.google.com/p/as3flexunitlib/

Download the most recent version of flexunit-*.zip.

Unpack the zip into a location of your choice.

2. Include flexunit.swc in the compilation path

If using Flex Builder, under Project, Properties, Flex Build Path, Library Path, select the Add SWC option. Navigate to the file flexunit/bin/flexunit.swc which is located in the archive unpacked above.

If using the command line, modify the mxmlc arguments to include -library-path+=flexunit/bin/flexunit.swc adjusting the path as needed.

3. Create the test code

Recommended next steps are Create an application to run FlexUnit tests, Create a FlexUnit TestCase, and Adding a TestCase to a TestSuite.
Report abuse

Related recipes