FlexUnit Support in Maia

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.

This entry was posted in New Features and tagged , . Bookmark the permalink.

18 Responses to FlexUnit Support in Maia

  1. Jan K says:

    lovely! I’ll give it a go straight away

  2. Jan K says:

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

  3. ksafonov says:

    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:

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

  5. Jan K says:

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

  6. 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:

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

  8. zeswif says:

    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.

  9. ksafonov says:

    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

  10. Jean-Marie says:

    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

  11. ksafonov says:

    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

  12. Jean-Marie says:

    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,

  13. ksafonov says:

    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

  14. Jean-Marie says:

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

  15. ksafonov says:

    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

  16. s9tpepper says:

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

  17. ksafonov says:

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

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>