Problems when running single FlexUnit based test class.

Intellij IDEA 9 Ultimate
Windows 7
Flex 4

I have a flex project with a number of flexunit tests. The various FlexUnit 4 libraries are included in the project.

If I create a RUN definition for FlexUnit and select to run all the tests in the root package of my project (com) it will execute correctly, running the _flexunit app in the FlashPLayer and showing me all of the passing (and failing) tests in the FlexUnit output window.

However, if I create a RUN definition for FlexUnit and select to run a single test class (one which successfully ran when included in the package run), then FlashPlayer will open but the _flexunit app never runs and the 'Instantiating tests' message is the only thing displayed in the flexunit output window.

I also successfully ran all of the tests using the first method, then I right click on a single test class in the output window and select to run this only. I get the same problem as described above.

Is there anwhere I can check the generated mxml for _flexunit app, or a log file I should be checking to see what is happening 'under the hood' ?


: Images show sucessful run, then selecting a single test class, then blank FlashPLayer and endlss display of 'Instantiating tests' message.


Hello Duncan,

I don't see any label on a screenshot you provided, app is just empty.
Do you get 'Connecting to IDEA...' , 'Executing tests...', 'Executing tests: 0 of 1' messages (some may flicker quickly after the start)?

To look at the launcher files, you need:
1. close IDEA
2. open <IDEA installation folder>\bin\idea.exe.vmoptions
3. add the following line:


4. start IDEA, launch your tests
5. launcher files are to found at the temp directory (by default it's C:\Users\<username>\AppData\Local\Temp), named:
   - <module_name>_<username>____FlexUnitLauncher.mxml (main class)
   - <module_name>_<username>____FlexUnitLauncherBase.mxml (auxiliary class)
   - <module_name>_<username>  (auxiliary class)



Ah sorry, overlooked 'Instantiating tests' message in IDEA tool window. Still do you get some of the mentioned messages in the test application?



Hi Kirill,
   When running that full package of tests I see all of the regular "RUnning test 1 of...." etc. But, when I run a single test I only ever see the "instantiating tests" message. Nothing else. And the FlashPlayer is blank when this happens.

Thanks for the info on keeping generated files.



Hi Duncan,

Can you please provide the compilation output? (Ensure 'Hide warnings' is unchecked at the Output window).



Also, just to clarify. The screen shots I added are in reverse order, so if you look at the last one it shows the full package of tests running, then the middle one shows me picking a single test to run, then the first screenshot shows the single test failing to run.

Using the steps you outlined I generated two seperate _flexunit mxmls to see if there was any major difference between running a single test and running a package of tests. However they don't appear to be very different other than the number of tests being added. See attachments....


Nothing suspicious in the launcher files except for the different ports used (since the default are busy),

Can you please provide the log file? (sorry for making you restart the app every time)

1. close IDEA
2. open <IDEA installation  folder>\bin\log.xml
3. scroll to the bottom, add the following lines before <root> tag:

<category name="com.intellij.lang.javascript.flex.flexunit">
    <priority value="DEBUG"/>

4. start IDEA, run the tests
5. log file is C:\Users\<username>\.IntelliJIdea90\system\log\idea.log



Hi Kirill,
   so I have been able to get a trace of the compilation only for the multiple tests. For some reason during the single test run, the messages window is removed and would not appear again until the test has run. Because I am cancelling it I dont see it again therefore cant take a dump of it.

However I think compilation should look the same below ......

Also, I have switched on DEBUG mode and created two separate clean log files, one for when I attempt to run only the single test class, and the other for when I run all of the tests. See attached files.....



Information:d:\flex\intellij idea 9.0.2\jre\jre\bin\java.exe -Dapplication.home=D:\Flex\SDK_4 -Xmx1024m -Duser.language=en -Duser.region=en -classpath D:\Flex\IntelliJ IDEA 9.0.2\plugins\flex\lib\idea-fcsh-fix.jar;D:\Flex\SDK_4\lib\fcsh.jar com.intellij.flex.FcshLauncher
Information:Adobe Flex Compiler SHell (fcsh)
Information:Version 4.0.0 build 14159
Information:Copyright (c) 2004-2007 Adobe Systems, Inc. All rights reserved.
Information:compc -load-config+=radon_flex_payment_api_Flex_temp_flex_config.xml  -locale en_US -keep-as3-metadata+=Inject
Information:Loading configuration file D:\Flex\SDK_4\frameworks\flex-config.xml
Information:Loading configuration file C:\p4\depot\swat\projects\tsi_projects\radon\hx_r3\radon\hendrix_intellij_project\radon_flex_payment_api_Flex_temp_flex_config.xml
Information:C:\p4\depot\swat\projects\tsi_projects\radon\hx_r3\radon\hendrix_intellij_project\out\production\radon_flex_payment_api\radon_flex_payment_api.swc (3622 bytes)
Information:compc -load-config+=radon_flex_components_Flex_temp_flex_config.xml -locale en_US
Information:Loading configuration file C:\p4\depot\swat\projects\tsi_projects\radon\hx_r3\radon\hendrix_intellij_project\radon_flex_components_Flex_temp_flex_config.xml
Information:C:\p4\depot\swat\projects\tsi_projects\radon\hx_r3\radon\hendrix_intellij_project\out\production\radon_flex_components\radon_flex_components.swc (1251257 bytes)
Information:compc -load-config+=radon_flex_commons_Flex_temp_flex_config.xml -locale en_US -keep-as3-metadata+=Inject
Information:Loading configuration file C:\p4\depot\swat\projects\tsi_projects\radon\hx_r3\radon\hendrix_intellij_project\radon_flex_commons_Flex_temp_flex_config.xml
Information:C:\p4\depot\swat\projects\tsi_projects\radon\hx_r3\radon\hendrix_intellij_project\out\production\radon_flex_commons\radon_flex_commons.swc (984166 bytes)
Information:compc -load-config+=radon_flex_core_Flex_temp_flex_config.xml  -load-config+="C:\p4\depot\swat\projects\tsi_projects\radon\hx_r3\radon\radon_flex_core\src\main\flex\additional_compiler_arguments.xml"
Information:Loading configuration file C:\p4\depot\swat\projects\tsi_projects\radon\hx_r3\radon\hendrix_intellij_project\radon_flex_core_Flex_temp_flex_config.xml
Information:Loading configuration file C:\p4\depot\swat\projects\tsi_projects\radon\hx_r3\radon\radon_flex_core\src\main\flex\additional_compiler_arguments.xml
Information:C:\p4\depot\swat\projects\tsi_projects\radon\hx_r3\radon\hendrix_intellij_project\out\production\radon_flex_core\radon_flex_core.swc (2604629 bytes)
Information:compc -load-config+=hendrix_automation_Flex_temp_flex_config.xml -load-config+="C:\p4\depot\swat\projects\tsi_projects\radon\hx_r3\radon\hendrix_automation\flex\additional_compiler_arguments_automation.xml"
Information:Loading configuration file C:\p4\depot\swat\projects\tsi_projects\radon\hx_r3\radon\hendrix_intellij_project\hendrix_automation_Flex_temp_flex_config.xml
Information:Loading configuration file C:\p4\depot\swat\projects\tsi_projects\radon\hx_r3\radon\hendrix_automation\flex\additional_compiler_arguments_automation.xml
Information:        public function RecordDetailsAccordionAutomationImpl(obj)
Information:                                                             ^
Information:            catch (re)
Information:                   ^
Information:C:\p4\depot\swat\projects\tsi_projects\radon\hx_r3\radon\hendrix_intellij_project\out\production\hendrix_automation\hendrix_automation.swc (886030 bytes)
Information:mxmlc -load-config+=radon_flex_app_temp_flexunit_config.xml  -load-config+="C:\p4\depot\swat\projects\tsi_projects\radon\hx_r3\radon\radon_flex_app\src\main\flex\additional_compiler_arguments.xml" -load-config+="C:\p4\depot\swat\projects\tsi_projects\radon\hx_r3\radon\radon_flex_app\src\main\flex\additional_compiler_arguments_automation.xml"
Information:Loading configuration file C:\p4\depot\swat\projects\tsi_projects\radon\hx_r3\radon\hendrix_intellij_project\radon_flex_app_temp_flexunit_config.xml
Information:Loading configuration file C:\p4\depot\swat\projects\tsi_projects\radon\hx_r3\radon\radon_flex_app\src\main\flex\additional_compiler_arguments.xml
Information:Loading configuration file C:\p4\depot\swat\projects\tsi_projects\radon\hx_r3\radon\radon_flex_app\src\main\flex\additional_compiler_arguments_automation.xml
Information:D:\apps\capabilities\jboss-4.2.3.GA\server\hendrix-flex\deploy\radon_java_webapp.war\bin/_flexunit.swf (3946097 bytes)
Information:Compilation completed successfully with 32 warnings
Information:0 errors
Information:32 warnings


Thanks for the information,

I see two custom config files are used during compilation:


Can we take a look on them?



Duncan, thanks again, still have no clue why test application stays frozen

Can you try debugging the test? If debugger connects and test app is frozen, you can try hitting 'Pause' and then check the stack trace it stays in. Also, console output may be useful.



Hi Kirill,
    I just get this when I try to debug on the single test class

Testing started at 09:17 ...
Adobe fdb (Flash Player Debugger) [build 14159]
Copyright (c) 2004-2007 Adobe, Inc. All rights reserved.
Waiting for Player to connect
Failed to connect; session timed out.
Ensure that:
  1. you compiled your Flash movie with debugging on, and
  2. you are running the Debugger version of the Flash Player.
Empty test suite.

The problem appears to be the actual swf itself. I will try grabbing the generated mxml and compiling it manually to see if this gives any clue.


     I've taken the generated mxml for flexunit on the single test class and compiled it into my project.

When I try to run it, the Flashplayer starts but nothing appears. If I try to debug it, it never connects.

I'll try the same file in a clean project with a very simple test class to see if it is a library issue in my project.



Sorry for jumping on this thread but when I try and run a single test class the instantiating tests dialog is stuck with the yellow circle revolving.


Mind you I think the whole testing approach seems smarter than messing around with test suites and flex compiler classes
like you do in FB4


Ignore it :)

It worked fine when I got  new version of the SA content debugger