Showing posts with label flex. Show all posts
Showing posts with label flex. Show all posts

Wednesday, May 12, 2010

Clear improperly cached compile errors in FlexBuilder

If FlexBuilder is giving you a compile error that shouldn't be happening, and nothing you do seems to make it go away, it's possible FB is failing to clear its cache. Try going to:

workspace\.metadata\.plugins\org.eclipse.core.resources\.projects\<project>\

and deleting the .markers file. Restart FB and do a clean build.

Explanation after the break.

Thursday, March 25, 2010

Event testing helper for FlexUnit 4

I noticed a little while ago that assertions made in event handlers don’t work the way you’d expect in FlexUnit.  It looks like the event dispatcher wraps its calls to event handlers with a try/catch block and treats any errors it receives as unhandled (showing the exception dialog if you have the debug player installed, ignoring it otherwise).  This means if you have an assertion fail in an event handler it will not cause the test to fail.

Thursday, February 11, 2010

Asynchronous unit tests in FlexUnit 4

FlexUnit looks like a fairly decent Flex unit testing framework and we've started using it in our new Flex project. Unfortunately FlexUnit has pretty much zero documentation, so unless you can find a blog post from someone about how to do something you'll have to just figure it out from scratch.

My coworker and I end up having to dig into the FlexUnit code occasionally to figure out how things work. The latest instance of this for me was to try and figure out how to test asynchronous events. I found a couple posts showing that it was possible with basic examples, but no real explanation of the different options.

I've managed to get a few different types of async tests working, so I figured I'd give examples of the different async methods provided by the Async FlexUnit class.