3 Replies Latest reply on Mar 8, 2011 2:02 PM by acastrucc

    Running unit tests from ant: flashplayer window remains open


      I'm trying to run flex unit tests from ant but I can't get the flashplayer window to close afterwards. What am I doing wrong?


      <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                      xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600"
                   import sampleSuite.WidgetTest;

                  //import org.flexunit.listeners.UIListener;


                  import org.flexunit.runner.FlexUnitCore;
                   //import org.flexunit.listeners.CIListener;                       
                   private var core:FlexUnitCore;


                  private function onCreationComplete():void
                       //testRunner.runWithFlexUnit4Runner(currentRunTestSuite(), "deleteme");
                       core = new FlexUnitCore();              



              <!-- Place non-visual elements (e.g., services, value objects) here -->


      and my ant script looks like this


      <target name="test" depends="build-test">  <!--  -->
               <taskdef resource="flexUnitTasks.tasks" classpath="./flexunit/flexUnitTasks-4.0.0.jar"/>
               <flexunit swf="./bin/${tester}" verbose="true"  localTrusted="true" timeout="15000" headless="true" toDir="./ASCoverage"  haltonfailure="true"/>

        • 1. Re: Running unit tests from ant: flashplayer window remains open
          acastrucc Level 1

          Oh I should mention this is my resulting output


          [flexunit] Generating default values ...
          [flexunit] Using default snapshot file path [.... \snapshot.jpg]
          [flexunit] Using the following settings:
          [flexunit]     haltonfailure: [true]
          [flexunit]     headless: [true]
          [flexunit]     localTrusted: [true]
          [flexunit]     player: [flash]
          [flexunit]     port: [1024]
          [flexunit]     snapshot: [false]
          [flexunit]     snapshotFile: [... snapshot.jpg]
          [flexunit]     swf: [... \bin\FlexUnitApplication.swf]
          [flexunit]     timeout: [15000ms]
          [flexunit]     toDir: [... \ASCoverage]
          [flexunit]     verbose: [true]
          [flexunit]     xcommand: [xvfb]
          [flexunit] Setting up server process ...
          [flexunit] OS: [Windows]
          [flexunit] Starting server ...
          [flexunit] Launching player:
          [flexunit] Executing 'rundll32' with arguments:
          [flexunit] 'url.dll,FileProtocolHandler'
          [flexunit] '... \FlexUnitApplication.swf'
          [flexunit] The ' characters around the executable and arguments are
          [flexunit] not part of the command.
          [flexunit] Opening server socket on port [1024].
          [flexunit] Waiting for client connection ...
          [flexunit] Created local trust file at [C:\WINDOWS\system32\Macromed\Flash\FlashPlayerTrust\flexUnit.cfg]
          [flexunit] Stopping server ...
          [flexunit] End of test data reached, sending acknowledgement to player ...
          [flexunit] Closing client connection ...
          [flexunit] Closing server on port [1024] ...


          BUILD FAILED

          ... \build.xml:19: java.util.concurrent.ExecutionException: Socket timeout waiting for flexunit report

          • 2. Re: Running unit tests from ant: flashplayer window remains open
            Simeon Bateman Level 2

            Hi There,


            The CIListener is actually responsible for closing that, but you don't appear to be adding that as a listener.


            Checkout the runner we use with our FlexUnit tests, you will see we add a CIListener.




            Let me know if that works out for you.


            Simeon Bateman


            Principal Instigator

            PNW Rain LLC



            1 person found this helpful