2010-10-19 12 views
0

我想用flexmojos 3.9-SNAPSHOT測試空氣應用和空氣庫。但是,儘管flexmojos確實支持air,但它試圖運行使用flash player生成的swf,並且因爲我需要使用air本機庫,所以我想使用adl(AIR調試啓動程序)運行測試。更改Flexmojos以給空氣應用提供測試支持的問題

爲此,我將github.com中的flexmojos克隆到此存儲庫(http://github.com/mi007/flexmojos)。然後我創建了一個類,爲TestRunner.swf文件創建了一個-app.xml文件,該文件生成並運行: adl TestRunner-app.xml

但是,在測試結束之前,它應該在端口中調用服務器13540報告一些事情。發生這種情況時,我發現了以下錯誤:

Error #2044: Unhandled securityError:. text=Error #2048: Security sandbox violation: app:/TestRunner.swf cannot load data from 127.0.0.1:13540. 
at org.sonatype.flexmojos.unitestingsupport::ControlSocket/connect()[/Users/rafael/p2d/others/flexmojos/flexmojos-testing/flexmojos-unittest-support/src/main/flex/org/sonatype/flexmojos/unitestingsupport/ControlSocket.as:46] 
at org.sonatype.flexmojos.unitestingsupport::TestApplication/runTests()[/Users/rafael/p2d/others/flexmojos/flexmojos-testing/flexmojos-unittest-support/src/main/flex/org/sonatype/flexmojos/unitestingsupport/TestApplication.as:52] 
at flash.events::EventDispatcher/dispatchEventFunction() 
at flash.events::EventDispatcher/dispatchEvent() 
at mx.core::UIComponent/dispatchEvent()[C:\autobuild\galaga\frameworks\projects\framework\src\mx\core\UIComponent.as:9408] 
at mx.core::UIComponent/set initialized()[C:\autobuild\galaga\frameworks\projects\framework\src\mx\core\UIComponent.as:1169] 
at mx.managers::LayoutManager/doPhasedInstantiation()[C:\autobuild\galaga\frameworks\projects\framework\src\mx\managers\LayoutManager.as:718] 
at Function/http://adobe.com/AS3/2006/builtin::apply() 
at mx.core::UIComponent/callLaterDispatcher2()[C:\autobuild\galaga\frameworks\projects\framework\src\mx\core\UIComponent.as:8733] 
at mx.core::UIComponent/callLaterDispatcher()[C:\autobuild\galaga\frameworks\projects\framework\src\mx\core\UIComponent.as:8673] 

我知道它之前成功調用服務器端口13539,因爲它在控制檯上打印測試結果。我也知道它是開放端口13540,因爲我能夠telnet到它。但是,由於某些原因無法從空中應用程序連接。

鑑於circunstances,我有以下問題:

1)有,我可以看的懂這個安全框架是如何工作的任何好的文檔?我發現的唯一文檔非常混亂。

2)有沒有人有任何想法或暗示可能會發生什麼?

3)我讀過flexmojos攻擊安全框架的地方,這樣Flex應用程序可以在測試過程中在沒有任何問題的情況下打開到localhost的套接字。有沒有關於如何完成的文檔?

感謝,

+0

好的,發現一些可能有用的東西。 當flexmojos運行flex應用程序測試時,它將TestRunner.swf放入〜/ Library/Preferences/Macromedia/Flash Player /#Security/FlashPlayerTrust中,以便應用程序可以啓動套接字,從而一切正常。但是,當我使用adl〜/ workspace/project/target/test-classes/something-app.adl運行應用程序時,它不再起作用。 – Rafael 2010-10-20 13:38:11

回答

0

你必須非常接近您的評論的答案...

您需要將行添加到〜/庫/首選項文件/ Macromedia的/ Flash播放器/ #Security/FlashPlayerTrust自己,覆蓋你想運行的swf。您可以直接手動(該文件夾中的所有文件將被處理)或使用Flash Player Settings Manager來完成此操作。

相關問題