Problems running tests on air libraries using IntelliJ Idea 10
I'm using IntelliJ Idea as an IDE to develop AIR applications. I use flexmojos-4.0 to compile and run tests in the command line, and they run fine. However, when I try to run the same tests on Idea, I get the following error:
/usr/local/flex/bin/adl -runtime /usr/local/flex/runtimes/air/mac /Users/rafael/dev/commons/project/target/test-classes/_validation-air-flexunit.xml /Users/rafael/dev/commons/project/target/test-classes
Testing started 开发者_如何转开发at 3:38 PM ...
Error: Could not find compiled resource bundle 'SharedResources' for locale 'en_EN'.
at mx.resources::ResourceManagerImpl/http://www.adobe.com/2006/flex/mx/internal::installCompiledResourceBundle()[C:\autobuild\3.5.0\frameworks\projects\framework\src\mx\resources\ResourceManagerImpl.as:306]
at mx.resources::ResourceManagerImpl/installCompiledResourceBundles()[C:\autobuild\3.5.0\frameworks\projects\framework\src\mx\resources\ResourceManagerImpl.as:235]
at mx.managers::SystemManager/installCompiledResourceBundles()[C:\autobuild\3.5.0\frameworks\projects\framework\src\mx\managers\SystemManager.as:3247]
at mx.managers::SystemManager/http://www.adobe.com/2006/flex/mx/internal::docFrameHandler()[C:\autobuild\3.5.0\frameworks\projects\framework\src\mx\managers\SystemManager.as:3221]
at mx.managers::SystemManager/docFrameListener()[C:\autobuild\3.5.0\frameworks\projects\framework\src\mx\managers\SystemManager.as:3069]
Empty test suite.
Process finished with exit code 0
Does anyone have any idea what is happening, or could suggest some tests I could do to try to resolve the problem?
Thanks!
It seems like the generated compiler configuration that IDEA uses is not suited to run unit tests. It misses inclusion of libraries and locales and hence it will throw runtime errors as described in your question.
A workaround is to set the custom compiler configuration location on the Flex facet in IDEA.
- Project structure -> Modules -> Flex facet
- Mark "Custom compiler configuration file for tests" and choose the location. The location should be "{PROJECT}\target\test-classes\TestRunner-configs.xml"
Note that if the config file does not exist, you can generate it by invoking the tests via the command line first.
精彩评论