Ok, so it seems it's just a namespace issue: if I add
to the root tag (and use the 'flexui' prefix in mxml), that seems to fix it. I'm not sure why the flexUnitUIRunner namespace declaration doesn't work (I imagine something to do with the build process, but I don't quite understand namespaces that aren't baed on packages). At the moment, I'm still getting errors:
1046: Type was not found or was not a compile-time constant: [mx.binding]::IWatcherSetupUtil2.
This looks like a Flex 4 dependency. I'm downloading the Flex 4 SDK to try it out, but can I not run FlexUnit 4.1 tests with a Flex 3 SDK? This worked fine for 4.0, but I really, really want the test dataProvider feature from 4.1...
The FlexUnit 4.1 library itself doesn't have any Flex 4 specific dependencies so you can absolutely using the dataProvider feature in Flex 3.x ... in fact, I used 3.x to develop it. The turnkey project is usually offered for either 4.x or 3.x as different downloads, so do make sure you grabbed the correct one first.
Since the FlexUnit library does have convenience methods for things like Binding, it means that we do need to offer separate builds (or let you build it yourself) for the different SDKs as Adobe has changed some of those interface between versions. However, I guess the point is that, so long as you have the correct set, you can use FlexUnit 4.1 in every version of Flex from 2.x forward.
Ok, thanks. That's great to hear. I just grabbed the turnkey project from the 4.1 beta release--I guess that was a 4.0 SDK build. I'll try to hunt down the correct version tonight.
I had the same problem initially, I fixed it by using the swcs from FlexUnit 4.0 (i.e. not the beta):
From what I could see the turnkey project was only in the beta download so to get this working with the Flex 4 SDK, use the turnkey project from the beta, but in the libs folder, clear out everything except "hamcrest-1.0.2.swc". Then from your 4.0 download, copy "flexunit-4.0.0.swc" and "flexunit-uilistener-4.0.0.swc" in to the libs folder in your turnkey project.
That worked first time for me (apart from 2 CSS warnings which can be safely ignored).
Hope that helps.