Unit Test help on new Robotlegs book

Uno Dos's Avatar

Uno Dos

03 Sep, 2011 11:36 PM

Hello,

I wanted to run the unit tests included in the new Robotlegs book by Stray and Joel, but am having difficulties. I am using FlashBuilder 4.5 and when I try to run the FlexUnit tests on the PersonalKanBan app - the compiler starts to complain about textDecoration on Labels all of a sudden. If I remove the libraries that are included (automatically) when you try to run unit tests - then the compiler error goes away.

Can anyone give me any pointers?

Thanks

  1. Support Staff 1 Posted by Joel Hooks on 04 Sep, 2011 04:02 AM

    Joel Hooks's Avatar

    So it works if you remove the included libs? I never ran the tests in Flash Builder, which is an oversight on my part. I used IntelliJ

  2. 2 Posted by Uno Dos on 04 Sep, 2011 07:34 AM

    Uno Dos's Avatar

    Sorry for not clarifying: no, I could not get the tests to run. When the libs are included it results in a compiler error. It would be really helpful for me (and I'm sure others) if you could document the steps required to get FlexUnit4 tests running in your project and AsUnit tests running in Stray's project. Even if it's from the command line. For those unfamiliar with testing, I don't know where to start tinkering.

    Thank you

  3. Support Staff 3 Posted by Stray on 04 Sep, 2011 08:30 AM

    Stray's Avatar

    Hi Uno Dos,

    Sorry about that! I use project sprouts and the command line, so IDE compiling is all a bit of a mystery to me. Thanks for pointing it out.

    Here's the mxmlc command to run the mosaic project tests (from the project folder):

    >> mxmlc -debug -default-background-color=#222222 -default-frame-rate=24 -default-size 900 550 -library-path+=lib/FlashComps.swc -library-path+=lib/flashComponents.swc -library-path+=lib/asx.swc -library-path+=lib/hamcrest.swc -library-path+=lib/FLoxy.swc -output=bin/mosaictoolRunner.swf -source-path+=src -source-path+=assets -source-path+=lib/robotlegs -source-path+=test -source-path+=support -source-path+=lib/mockolate -source-path+=lib/asunit3 -verbose-stacktraces=true -warnings=true src/mosaictoolRunner.as
    

    Outputs:

    >>  Some/path/to/mosaictoolRunner.swf
    

    Then, to debug in command line:

    >>  fdb
    >>  run Some/path/to/mosaictoolRunner.swf
    >>  continue
    

    That should run the tests, and in my suite all 574 tests are passing.

    I actually run the tests from a project sprouts rake file - the version of project sprouts I use is 0.7 - it's quite a detailed process to get it up and running, but if you want to take that route then I'm happy to send my sprouts files (you'd need to install manually I think).

    Meanwhile - Joel could you create some Ant build files?

    Stray

  4. Support Staff 4 Posted by Joel Hooks on 04 Sep, 2011 05:27 PM

    Joel Hooks's Avatar

    The problem with the FlexUnit integration is that there appears to be some dependency on MX components in the FlexUnit libs that Adobe supplies.

    File>Properties>Flex Build Path>MX + Spark

  5. Joel Hooks closed this discussion on 04 Sep, 2011 05:27 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac