• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
Locked
0

FlexUnit UIImpersonator doesn't work with Actionscript projects when run from within FlashBuilder?

Guest
Aug 03, 2010 Aug 03, 2010

Copy link to clipboard

Copied

Hi there-

I've been using the UIImpersonator in FlexUnit (for AS, not Flex) to unit test certain components that need to be added to the stage to function correctly.  To do so, one must initialize the FlexUnitCore.visualDisplayRoot with the stage, which I do when I hand craft the test runner in my own source code.

In FlashBuilder, the test program runner is auto generated by the builder and it uses something called flexunit.flexui.FlexUnitTestRunnerUIAS, for which I cannot find any documentation or source code in the FlexUnit depot.  I suspect this is some Flash Builder custom file?  In any event, it appears to add itself to the stage, but it seems to not be internally initializing the UIImpersonator correctly.  Any DisplayObjects that are added to the UIImpersonator are *not* on the stage.

Has anyone investigated how to make this work correctly?  Seems like a bug.

Richard

Views

995

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Aug 11, 2010 Aug 11, 2010

Copy link to clipboard

Copied

Hi,

You are right, Flash Builder creates a wrapper around FlexUnit runner class to generate FlexUnitApplication.as and then runs the required tests.

Also, this API is not exposed.

Does it work with Flex projects?

Is your requirement to customize the same and add your custom logic?

If yes, you could extend FB generated FlexUnitApplication and create your application with the logic you would want and configure the same in Window->Preference->Flash Builder->FlexUnit->Custom Application name.

Let us know if it helps.

Thanks,

Balaji

http://balajisridhar.wordpress.com

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Aug 11, 2010 Aug 11, 2010

Copy link to clipboard

Copied

LATEST

I am not using Flex, so unsure if it works there. 

I found the source code for FlexUnitTestRunnerUIAS.as in my .eclipse configuration directory (FlexBuilder must have installed it there, which was nice).  I patched the file to properly configure the UIImpersonator and rebuild the flexunitextendedAS.swc used by FlashBuilder's FlexUnit wrapper.  Put it back into my .eclipse configuration directory and all was better.

It would be nice if adobe fixed this in their next release so I don't need to patch the file again.

Richard

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines