FlexUnit Support in Maia

Posted on by ksafonov

Maia 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.

Comments below can no longer be edited.

18 Responses to FlexUnit Support in Maia

  1. Jan K says:

    May 26, 2009

    lovely! I’ll give it a go straight away

  2. Jan K says:

    May 26, 2009

    Can you post a sample project? I can’t get it to work with FlexUnit 4.

  3. ksafonov says:

    May 26, 2009

    Currently Maia has support for FlexUnit 0.9. Support for FlexUnit 4 is to come while FlexUnit 4 project gets more stable.

  4. dave says:

    May 26, 2009

    Any plans on supporting Fluint? http://code.google.com/p/fluint/

  5. Jan K says:

    May 27, 2009

    @dave FlexUnit4 is the ‘best of both worlds’ combination of fluint and FlexUnit so there will be no need to support fluint

  6. Michael Labriola says:

    May 27, 2009

    If you find any issues or need any help integrating FlexUnit 4, just let me know. Will be glad to accomodate.

  7. Taras Tielkes says:

    May 28, 2009

    Is there a JIRA ticket to watch for full FlexUnit4 support?

  8. ksafonov says:

    May 29, 2009

    Just created one: http://www.jetbrains.net/jira/browse/IDEADEV-37141

  9. zeswif says:

    October 21, 2009

    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.

  10. ksafonov says:

    October 21, 2009

    Hello zeswif,

    Please answer a few questions:
    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? 🙂 It should have an item ‘Show redraw regions’ in context menu.

    Thanks, Kirill

  11. Jean-Marie says:

    January 10, 2010

    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

  12. ksafonov says:

    January 13, 2010

    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

  13. Jean-Marie says:

    January 15, 2010

    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,

  14. ksafonov says:

    January 15, 2010

    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

  15. Jean-Marie says:

    January 27, 2010

    Hello Kirill,
    Yes the problem occurs when trying to debug the Felx app, not the tests.
    Best regards,
    JM

  16. ksafonov says:

    January 27, 2010

    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

  17. s9tpepper says:

    June 11, 2011

    “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.

  18. ksafonov says:

    June 14, 2011

    @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?

Subscribe

Subscribe for updates