-
Get a monthly update on best practices for delivering successful software.
I recently had an issue in flex where I needed the click event for a component in an ItemRenderer to not bubble up to the parent list. Since the click event was being dispatched by Flex SDK code, I could not directly do this by passing false into the event's constructor. I had hoped to find a property I could set on the object, something like "clickBubbles", which I could set which would accomplish this.
Either that property doesn't exist or I could not find it. My solution was to basically hijack the event and send an impersonator in its place.

One of the nice extensions available for FlexUnit is the ability to easily unit test event behavior using EventfulTestCase.
This library has support for testing Cairngorm, but unfortunately support is lacking for PureMVC. I searched for existing solutions which added PureMVC notification support, but was not satisfied with their APIs. Luckily, it was not difficult to write some code to support PureMVC which mirrored the API of EventfulTestCase.
Topics: actionscript, Flex, flexunit, PureMVC, Testing
In most projects, people tend to separate source and test code into separate directories. However, out of the box, FlexUnit with Antennae is geared toward a single directory which contains all source and test code. I didn't really want to mix everything together like this, so I modified Antennae to work with a separated structure. Here is the quick and dirty on getting it to work (assuming you're using FlexUnit .85 and Antennae 1.2.0)
Topics: actionscript, antennae, Flex, flexunit