We have a large multi-module product that we are writing in Flex 4.1, running on top of mid-level Java.
Based on the Java background, I want to have support in the Flex environment for writing and running unit tests.
I updated Flash Builder 4.5 with the release of FlexUnit 4.1, and I can write and execute unit tests successfully in an application project, but I have not developed how to get unit tests working on unit or library projects in Flash Builder.
Problems with library projects
Since we need tests compiled for the application (SWF), I need to either create a companion project project in Flash Builder, or change the type of links in the library project dependencies (SWC) to avoid external ones, because external dependencies are expected to be made by someone else (usually this is a top level application).
As an experiment, I tried to change the binding in a project with a model library: the SWF test runner was successfully generated, but FlexUnit could not start it, because error # 1065 was reported about something that made no sense to me.
For our build without headless (using Gradle), I found this easy to solve by simply merging all the dependencies, regardless of their original connection when creating the SWF test runner. I can also easily run this from Eclipse using external tool support, as the result is JUnit-compatible XML results that appear in the normal JUnit view.
How do you do this?
How do other Flex developers structure their unit tests in a multi-module and multi-library project? Are you running tests from Flash Builder 4.5? Can you run tests yourself for any library project or module?
source share