4 Replies Latest reply on Jul 20, 2011 5:52 AM by manu_136

    FlexUnit ant - running tests that make server calls

    manu_136 Level 1



      I am using BlazeDS in my project to connect to a Tomcat server. I have configured my services in the services-config.xml file and passed the location of the file as an argument to the compiler in Flash Builder.


      I have a few unit tests that make asynchronous server calls. When I run these tests from within Flash Builder, the tests run fine. But when I run the tests via the flexunit ant task, these tests alone time out while the other tests pass. Also, it does seem like the server is not contacted at all as my log messeges in my server side code are not visible.


      I tried passing the path to the services-config.xml file and the context root of the application in the mxmlc ant task that compiles my TestRunner.mxml file:


      <mxmlc file="${main.src.loc}/flexUnitTests/TestRunner.mxml" output="${bin.loc}/TestRunner.swf">

      <library-path dir="${lib.loc}" append="true">

      <include name="*.swc" />


      <source-path path-element="${basedir}/src" />

      <source-path path-element="${basedir}/locale/{locale}" />



      <compiler.services>C:\myApp\Source\WebServer\WebContent\WEB-INF\flex\services-config.xml</ compiler.services>




      No use. My tests still time out. Here is my flexUnit task:


      <target name="test" depends="compile">

      <!-- Execute FlexUnit tests and publish reports -->









        <source dir="${basedir}/locale/{locale}" >

           <include name="*.properties" />


      <library dir="${lib.loc}" />



      I guess I am missing somthing - a way to tell ant about the location of my server or something like that. Please help!


      Thanks in advance.