Unit Testing HaXe JavaScript Project


Today I continued to progress on my Samsung Smart TV project with unit test implementation. My aim is to prepare smooth process for automated builds. First, I tought I would struggle with it much more but at the end it appeared that necessary tools already exists.

My first sreps led me to “Writing Unit Tests” article about resources available directly with HaXe, however it seemed that JavaScript testing was not available. The article also referenced MUnit a cross-platform haxe unit testing framework, which looked to have more capabilities.

Read the rest of this entry »

Quick Tip: FlexUnit & JUnitReport & haltonfailure

In case you are using flexunit ant task with your flex builds and you are used to failed builds with haltonfailure=”true”, you may notice that junitreport task is not executed when unit tests fails. Without having test reports, it does not give you much info about what went wrong. Fortunately, there is a solution using attribute failureproperty and fail ant task. Here is a quick ant build config to generate junitreport report for failed unit tests followed by build fail.

Read the rest of this entry »

Quick Tip: Read timed out …/target/test-classes/TestRunner.swf

There has been a terrible issue blocking maven/flexmojos builds randomly with exception:

[INFO] Read timed out /home/user/project/target/test-classes/TestRunner.swf

Even there are some tips how to fix this issue, none of them worked for my case. After all unit tests were removed and one by one added back manualy, I was able to locate the tests causing it. Problematic appeared to be async unit tests and the random factor appeared to be cpu usage. In other words when flashplayer was not able to execute and finish async test, it failed with maven exception. Finally, the day was saved with changed testTimeout value:


Maven version: 2.2, Flexmojos: 3.8, Flex SDK:, FlexUnit: 4.0-rc-1