How to automatically test swf modules with maven

Comments Off on How to automatically test swf modules with maven


Running unit tests with maven, that require runtime resources such as runtime CSS, runtime resource bundles, or other resources throws error because the resources have not been marked as trusted.

To be more detailed, maven has a file within the #Security folder of Flash Player, in which it stores a list with trusted swfs. For example, when maven runs the unit tests, it automatically adds the FlexUnit.swf to be trusted by Flash Player. This file, named maven.cfg is stored into ~/Library/Preferences/Macromedia/Flash\ Player/#Security/FlashPlayerTrust/ folder on a Mac. Other operating systems have a different path, as described in this link .

In my case, the problem was that I was writing some unit-tests that would load modules placed under /src/test/resources folder within my maven project.



In other words, I had to add this little script to the maven build in order to fix my problem:


After updating the pom.xml and running "mvn test" command, I could notice that my files were added to the maven.cfg file.

[INFO] Updating Flash Player Trust directory .../target/test-classes/test/LoginModule.swf
[INFO] Updating Flash Player Trust directory .../target/test-classes/test/LoginModuleSkin.swf

No Comments

No comments yet.

Sorry, the comment form is closed at this time.

Comments RSS Feed