<p>I'm currently working on an application with a frontend written in Adobe Flex 3. I'm aware of <a href="http://code.google.com/p/as3flexunitlib/" rel="noreferrer">FlexUnit</a> but what I'd really like is a unit test runner for Ant/NAnt and a runner that integrates with the Flex Builder IDE (AKA Eclipse). Does one exist? </p>

<p>Also, are there any other resources on how to do Flex development "the right way" besides the <a href="http://labs.adobe.com/wiki/index.php/Cairngorm" rel="noreferrer">Cairngorm microarchitecture</a> example?</p>

[{'answer_id': 8753, 'author': 'Theo', 'author_id': 1109, 'author_profile': 'https://Stackoverflow.com/users/1109', 'pm_score': 4, 'selected': True, 'text': '<p>The <a href="http://code.google.com/p/dpuint/" rel="noreferrer">dpUint</a> testing framework has a test runner built with AIR which can be integrated with a build script.</p>\n\n<p>There is also my <a href="http://developer.iconara.net/objectlib/flexunitautomation.html" rel="noreferrer">FlexUnit</a> automation kit which does more or less the same for FlexUnit. It has an Ant macro that makes it possible to run the tests as a part of an Ant script, for example:</p>\n\n<pre><code>&lt;target name="run-tests" depends="compile-tests"&gt;\n  &lt;flexunit swf="${build.home}/tests.swf" failonerror="true"/&gt;\n&lt;/target&gt;\n</code></pre>\n'}, {'answer_id': 8770, 'author': 'Theo', 'author_id': 1109, 'author_profile': 'https://Stackoverflow.com/users/1109', 'pm_score': 2, 'selected': False, 'text': '<p>About how to develop Flex applications the right way, I wouldn\'t look too much at the Cairngorm framework. It does claim to show "best practice" and so on, but I would say that the opposite is true. It\'s based around the use of global variables, and other things you should try to avoid. I\'ve <a href="http://blog.iconara.net/2008/04/13/architectural-atrocities-part-x-cairngorms-model-locator-pattern/" rel="nofollow noreferrer">outlined some of the problems on my blog</a>.</p>\n\n<p>I would suggest that you look at the <a href="http://mate.asfusion.com" rel="nofollow noreferrer">Mate framework</a> instead, which has good documentation and good examples to get you going. It uses Flex to its full potential, doesn\'t rely on global variables as Cairngorm and PureMVC, and it makes it possible to write much more decoupled code.</p>\n'}, {'answer_id': 10232, 'author': 'Mike Deck', 'author_id': 1247, 'author_profile': 'https://Stackoverflow.com/users/1247', 'pm_score': 2, 'selected': False, 'text': '<p>On my project we\'re using Maven to build both our Flex RIA and the Java-based back end.  In order to build and test the Flex app we use the <a href="http://code.google.com/p/flex-mojos/" rel="nofollow noreferrer">flex-mojos</a> maven plugins.  They do a great job for us and I would highly recommend using Maven over Ant.</p>\n\n<p>That being said, if you\'re already using Ant it can be a little tricky to transition over to Maven.  So if you\'re in that position I would recommend using the flexunit tasks available here: <a href="http://docs.flexunit.org/index.php?title=Ant_Task" rel="nofollow noreferrer">Ant Task</a></p>\n\n<p>Both of these libraries do basically the same thing, they launch a generated flexunit test runner mxml application in a window and open a socket connection back to the build process using a JUnit test runner.  Amazingly enough it works pretty well.  The only problem is that you can\'t run it headless so if you want to run the build from a CI server you have to make sure that process has the ability to launch new windows otherwise it won\'t work.</p>\n'}, {'answer_id': 106837, 'author': 'marstonstudio', 'author_id': 19447, 'author_profile': 'https://Stackoverflow.com/users/19447', 'pm_score': 0, 'selected': False, 'text': '<p>An alternative to FlexUnit is the <a href="http://www.asunit.org/" rel="nofollow noreferrer">AsUnit</a> testing tools. There are versions for actionscript 2 and 3. It also has good integration with <a href="http://www.projectsprouts.org/" rel="nofollow noreferrer">Project Sprouts</a>, which is a build tool for Flex and Flash similar to ant, however it uses ruby rake tasks and includes excellent dependency management along the lines of maven.</p>\n\n<p>No IDE integration that I know of however.</p>\n'}]
['https://Stackoverflow.com/questions/2222', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/266/']