Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Adobe AIR Development

Reply
Developer
EraserX
Posts: 168
Registered: ‎01-13-2011
My Device: Not Specified
Accepted Solution

FlexUnit with all AS3 AIR doesn't work?

I have recently been trying to take a stab at TDD (Test Driven Development), that I'm sure many of you are familiar with.  To that end I have been trying to use FlexUnit 4 from within Flash Builder 4. 

 

If I create a project as follows:

  1. New --> Flex Project
  2. Next, Next
  3. (Main Application File) Replace .mxml with .as
  4. Finish

Then when I try to use FlexUnit in the ordinary manner, it fails to generates a proper FlexUnitApplication.mxml file.  This is the contents of that file:

 

<!-- This is an auto generated file and is not intended for modification. -->

package_declaration
{
class_declaration
{
class_body
}
}

 

Consequently, there is a compile error that I can't get around:

Content is not allowed in prolog.

 

 

However:

If I follow the same process as above, without changing the .mxml to .as then the tests run properly. 

 

Things I have tried to get around the error:

  • Updating FlexUnit to 4.1
  • Pressing Refresh in the FlexUnitsResults window
  • Creating a project with .mxml, and subsequently deleting that mxml and replacing it with an actionscript class
  • Pounding on my desk.

None of these have worked.

 

Is anyone here successful using FlexUnit with FlashBuilder 4 for an all AS3 AIR project?  Alternatively, can anyone suggest an alternative Test package?

 

Thanks,

~Nick.

Please use plain text.
Developer
EraserX
Posts: 168
Registered: ‎01-13-2011
My Device: Not Specified

Re: FlexUnit with all AS3 AIR doesn't work?

I found an at least temporary solution.  I restarted FlashBuilder, and compiled despite the marked error under Problems and it worked. 

 

I think restarting Flashbuilder maybe clears it of a previously stored properly compiled build.  (Maybe Clean could also do this?).  Anyways, at compile time, the mxml file was properly generated and all is well.

Please use plain text.