FlexUnit Developer Documentation

Here you can find information and resources regarding FlexUnit open source development. It contains information for developers, and the FlexUnit community in general.

If you cannot find your answers here, then please ask about it on the Developers forum.

Note that many existing articles use the previous version of the graphical test runner, but the underlying testing code should remain the same.

FlexUnit Tutorials

Get source code

Release and milestone versions of the FlexUnit 4 are available from the FlexUnit 4 Download Page. These downloads are also available from the Adobe Open Source website. Unless you are planning on developing or building modifications on the framework, these are the suggested locations to use. For instructions using the FlexUnit library ''only'' see Getting Started

Day to day development work facilitated by the Flex, Flash and ActionScript communities continues on the FlexUnit 4 framework over on GitHub. If you simply want to view or work with stable milestone builds, use the download link above.

Web browsing

To browse the FlexUnit 4 project, go to http://flex.apache.org/dev-sourcecode.html. This should take you to the source page. At the top of the page you will notice links for branches and tags.

The master branch is the main development branch for FlexUnit 4. Branches are created when projects need to stabilize code for a release.

Tags record the code that shipped as a specific release, or other milestones in a project. The code which was used to build the 4.x release of the FlexUnit has been tagged as tags/4.x. Builds prior are tagged in the tags directory.

This site often uses the word “branch” as shorthand for “trunk, branch, or tag”.

To understand what's where inside each branch, see FlexUnit Organization.

You can access directories and files inside the project by appending them onto the project's URL. For example, to browse the FlexUnit 4 directory of the most recent build of FlexUnit, you can go directly to https://git-wip-us.apache.org/repos/asf?p=flex-flexunit.git;a=tree;h=refs/heads/master;hb=master.

Installing git

To get your own working copy of the source code, you'll need to use git. Git is primarily a command line environment, however there are gui versions of of the client as well. A client will also let you see the repository structure, look at the revision history of any file or directory, diff two versions of a file, etc.

Github has detailed instructions on using git with Windows, Linux and Mac. Below are quickstart instructions for getting the latest build. For Windows users these instructions assume you are not already using mysys or another terminal client.

You can get the latest versions as well as installation instructions for git from the following addresses:

:* Windows: http://help.github.com/win-git-installation/
:* Mac: http://help.github.com/mac-git-installation/
:* Linux: http://help.github.com/linux-git-installation/

Checking out code

When you access the repository with a git client, the FlexUnit project is at the URL https://git-wip-us.apache.org/repos/asf?p=flex-flexunit.git

To get the entire source code for the project, do a "checkout" from this URL into a local directory on your machine. Using the command-line client, you would execute:

git clone https://git-wip-us.apache.org/repos/asf/flex-flexunit.git

This will create a local copy of the code. ''Note:'' If you would like to contribute to the project you will need to create a fork of the branch and commit changes to the fork. Once you have made changes, you may "push" them to the branch and the author may incorporate them into the existing project.

Building and testing

If you want to build and test the source code, see How to build and test FlexUnit.

For instructions using Ant, see below:

  1. Change directories to the root of the recently checked out source code. This directory should contain all of the FlexUnit project folders prefixed with FlexUnit4.
  2. If you haven't already, set the value of an environment variable named FLEX_HOME to the absolute path of the Flex SDK with which you want to build FlexUnit.
  3. To quickly get started, execute the Ant build script in this directory use the following command to run the unit tests and produce the flexunit.zip build artifact: <pre>ant -v clean package</pre>
  4. You may notice that the flexunit.zip artifact is missing the asdocs for the project as well as any supplemental static code analysis reports. To avoid cross platform issues when building the API, we've established an opt-in policy for reporting. The following arguments can be adding to activate various forms of reporting:
    1. -Dbuild.report=true – Used to generate asdocs
    2. -Dbuild.pmd=true – Used to generate PMD, CPD, and Metrics reports. Must be used with -Dbuild.report=true.
  5. There are also other options which are opt-out when using the build:
    1. -Dbuild.skipTests – Skips all tests.
    2. -Dbuild.useFlex=true|false – Determines whether to build the the FlexUnit core with a dependency on Flex or just for use with AS3
    3. -Dbuild.instrument – Attempts to run the build using FlexCover assuming the CoverageViewer AIR application is installed and the environment variable FLEX_COVER_SDK is defined pointing to the absolute path of the custom FlexCover SDK. (currently broken)

Contributing to FlexUnit

If you are interested in contributing to FlexUnit, please see the http://flex.apache.org/community-getinvolved.html page.

FlexUnit Project Structure

Find out how individual projects inside the FlexUnit4 repository are used.

Submitting a patch

If you filed a bug, you may have already coded a fix for it. If you have a fix, then submit a patch!

  • No labels