使用IntelliJ Idea 10在空中库上运行测试时出现问题

时间:2011-04-04 18:48:30

标签: flex unit-testing intellij-idea

我正在使用IntelliJ Idea作为IDE来开发AIR应用程序。我使用flexmojos-4.0在命令行中编译和运行测试,它们运行正常。但是,当我尝试在Idea上运行相同的测试时,我收到以下错误:

/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

有没有人知道发生了什么,或者可以提出一些我可以尝试解决问题的测试?

谢谢!

1 个答案:

答案 0 :(得分:1)

似乎IDEA使用的生成的编译器配置不适合运行单元测试。它错过了包含库和语言环境,因此它会抛出运行时错误,如问题中所述。

解决方法是在IDEA中的Flex构面上设置自定义编译器配置位置。

  • 项目结构 - >模块 - > Flex facet
  • 标记“用于测试的自定义编译器配置文件”并选择位置。位置应为“{PROJECT} \ target \ test-classes \ TestRunner-configs.xml”

请注意,如果配置文件不存在,您可以通过首先通过命令行调用测试来生成它。