FlexUnit Support in Maia
May 26th, 2009 by ksafonovMaia is capable of running FlexUnit tests — you can run a single test method, all methods in a certain class, or all classes in a given package and its subpackages. For that, you’re provided with a new FlexUnit Run Configuration, which allows you to specify a module (Flex module or Java module with Flex facet) and configure the test scope:
To run tests you need to set up a dependency on FlexUnit.swc library, but this is something you must have already done to get your tests compiled. Tests are actually executed in debug mode with all the functionality like breakpoints, watches, etc. available.
When a run is finished the results window shows you the tests overview, output and statistics panel:
Mouse click on an item in the tree or statistics panel navigates you to the test source. Same is true for the stack traces of the failed tests.
Also, new context menu actions are provided to run test for a selected method, class, or package. Just right-click them and select Debug Flex, then click FlexUnit.

May 26th, 2009 at 7:59 am
lovely! I’ll give it a go straight away
May 26th, 2009 at 9:38 am
Can you post a sample project? I can’t get it to work with FlexUnit 4.
May 26th, 2009 at 10:38 am
Currently Maia has support for FlexUnit 0.9. Support for FlexUnit 4 is to come while FlexUnit 4 project gets more stable.
May 26th, 2009 at 12:54 pm
Any plans on supporting Fluint? http://code.google.com/p/fluint/
May 27th, 2009 at 4:43 am
@dave FlexUnit4 is the ‘best of both worlds’ combination of fluint and FlexUnit so there will be no need to support fluint
May 27th, 2009 at 12:16 pm
If you find any issues or need any help integrating FlexUnit 4, just let me know. Will be glad to accomodate.
May 28th, 2009 at 2:56 pm
Is there a JIRA ticket to watch for full FlexUnit4 support?
May 29th, 2009 at 12:50 am
Just created one: http://www.jetbrains.net/jira/browse/IDEADEV-37141
October 21st, 2009 at 10:00 am
Hi,
I trayed to run a test but i got the folloeing message:
Failed to connect; session timed out.
Ensure that:
1. you compiled your Flash movie with debugging on, and
2. you are running the Debugger version of the Flash Player.
Empty test suite.
October 21st, 2009 at 10:55 am
Hello zeswif,
Please answer a few questions:
It should have an item ‘Show redraw regions’ in context menu.
1. can you run your test (Run your FlexUnit run configuration instead of Debug)? Do you get your test displayed in IDEA’s test results view?
2. What IDEA build do you use?
3. Well, are you sure that your flash player is a debug one?
Thanks, Kirill
January 10th, 2010 at 3:19 am
Hi, I’m gettin gthe same problem. When trying to use the debugger, the following message appears:
Failed to connect; session timed out.
Ensure that:
1. you compiled your Flash movie with debugging on, and
2. you are running the Debugger version of the Flash Player.
I do compile with debug set to true, and I have the Debug Flash Player (I see the Show redraw regions” item). I’m using IDEA 9.0, build#IU-93.13.
Thanks
January 13th, 2010 at 3:41 pm
Hello Jean-Marie,
What is your Flex SDK version? Does the problem arise when you’re trying to debug your Flex application, not the tests?
Thanks,
Kirill
January 15th, 2010 at 7:52 am
Hello Kirill,
I tried with 2 Flex SDK versions: 4.0.10485, and 4.0.13383.
I also have another problem: IDEA freezes when I work on a Flex project, after 2 or 3 minutes, even if I do nothing but open an MXML file. I have to kill it. I saw http://www.jetbrains.net/devnet/message/5250899#5250899 which seems close, I’ll post in this other thread.
Best regards,
January 15th, 2010 at 8:10 am
Hello Jean-Marie,
Let me ask again: does the problem arise when you’re trying to debug your Flex application, not the tests?
Thanks,
Kirill
January 27th, 2010 at 5:12 am
Hello Kirill,
Yes the problem occurs when trying to debug the Felx app, not the tests.
Best regards,
JM
January 27th, 2010 at 6:08 am
Hello Jean-Marie,
Please try IDEA 9.0.1 (http://www.jetbrains.com/idea/download/index.html). If the problem persists, please file an issue at http://youtrack.jetbrains.net/welcome#newissue=yes and five some details there:
- can you run your application?
- does Flash Player show up when you start debugging session?
Regards,
Kirill
June 11th, 2011 at 1:04 pm
“To run tests you need to set up a dependency on FlexUnit.swc library, but this is something you must have already done to get your tests compiled.”
Good info… HOW?!?!? A link to instructions to do this would be nice. I have included FlexUnit SWCs in my module and the error persists on saying I need to add a dependency to FlexUnit. A link on how to do this instead of just saying “this is something you must have already done” would be a hell of a lot more helpful.
June 14th, 2011 at 5:14 am
@s9tpepper: Apologies, this post assumes reader knows how to configure IDEA project. Anyway, please click File | Project structure | Modules | (your module with tests), switch to Dependencies tab, click Add, choose Single-entry module library and navigate to FlexUnit.swc. Does it help?