Can i reference external flex-config in flexunit ant task?

flexunit gurus,
i'm trying to figure out how to best specify the compiler arguments for the flexunit ant task in flexunit 4.1 beta 1.  from the documentation i see this sample flexunit usage:
<flexunit workingDir="${bin.loc}" toDir="${report.loc}"
haltonfailure="false" verbose="true" localTrusted="true">
<testSource dir="${main.src.loc}" />
<testSource dir="${test.src.loc}">
<include name="**/*Test.as" />
</testSource>
<library dir="${lib.loc}" />
</flexunit>
in this example, the source and library paths are explicitly listed.  in this simple example all the needed libraries reside within a single directory.
when i build my application, i use a custom flex-config.xml file, as the following snippet shows:
        <mxmlc file="${application.file}" output="${swf.debug.file}" debug="true" headless-server="${headless.server}">
            <load-config filename="${flex.config.file}" />
        </mxmlc>
in that custom flex-config.xml file i list all the build options (e.g. source dirs, library paths, theme, etc.) appropriate for building the application.  the libraries i reference are in a number of different directories (in general each 3rd party library is in a different directory).
in the flexunit task, i could individually reference all the same libraries that are in the flex-config.xml, but that'd be a pain to keep them in sync.  i suppose i also could parse the flex-config.xml to extract the library information and use that to populate the library argument.  really what i want to say in the flexunit task is "build all source and tests as indicated in flex-config.xml, then run the tests", perhaps with a syntax like the following:
<flexunit workingDir="${bin.loc}"  toDir="${report.loc}"
haltonfailure="false" verbose="true" localTrusted="true">
            <load-config filename="${flex.config.file}" />
<testSource dir="${test.src.loc}">
<include name="**/*Test.as" />
</testSource>
<library dir="${flexunit.lib}" />
</flexunit>
i'd rather keep the flex-config.xml file free of any test specific information, so ideally i'd specify the path to the flexunit swc's and the test path in the flexunit task (as in the above example).
is there support for such usage currently or planned for in the future?  recommendations on how best to accomplish my goal of not duplicating library information already present in a custom flex-config.xml?
thanks.
-mike

hi brian,
thanks for your response.
i understand the desire to avoid re-implementing the flex sdk ant tasks.  i'm not sure that can reasonably be accomplished wihen the TestRunner is dynamically generated from within the flexunit task.  in addition to the source path and library path, the theme setting and namespaces settings can affect successful compilation, and the runtime-shared-library-path setting can affect whether the produced swf runs correctly.
perhaps there's an alternative.  what if we separate the creation of the TestRunner.mxml from the compilation and the execution of the tests.  if flexunit offers an ant task that can produce (but not run) a TestRunner.mxml, i can write the mxmlc task that compiles it properly, and then i can invoke the old style flexunit specifying the swf argument.  this would still accomplish my primary goal of not needing to manually enumerate every test file in a TestRunner.mxml that i have to maintain (and which neither Flash Builder nor maven builds require).  to compile the TestRunner.mxml, i'd load in my custom flex-config.xml, then append to the source path and library path to include my test directory and flexunit libraries.
maybe something like the following to create the TestRunner:
<generatetestrunner output="${bin.loc}/TestRunner.mxml">
          <testSource dir="${test.dir}">
             <include name="**/*Test.as" />
          </testSource>
</generatetestrunner>
thoughts?
one other thing i noticed about the current library argument to flexunit is that it assumes a directory even if you provide an explicit path to an swc (i tried switching <library dir...> to <library file...> but that didn't seem to make a difference).  in my case, there are specific swc's i need in the library path, and the task assuming i mean a directory when i specify an explicit swc is problematic.  the directory my swc libraries are contained in sometimes contain multiple and conflicting versions of a library (each library directory contains various snapshot builds of the library).  i need a way to explicitly indicate which library to use.
finally, could you point me to the java source for the flexunit ant tasks?  i've found the flexunit action script source ok but haven't found where the java ant task is defined.
thanks.
-mike

Similar Messages

  • FlexUnit Ant task freeze at Reciving Data...

    Hello,
    I'm trying to use flex unit task and when I run it, get this on console and stay there for ever.
    "*****" is just to privacy
    this is my ant task
    <target name="UNIT TEST">
                        <echo>COMPILING TEST SWF..</echo>
                        <mxmlc output="${basedir}/bin/Test.swf" file="${basedir}/test-src/TestRunner.as">
                                  <target-player>${env.TARGET_PLAYER}</target-player>
                                  <load-config filename="${FLEX_HOME}/frameworks/flex-config.xml"/>
                                  <source-path path-element="${FLEX_HOME}/frameworks"/>
                                  <compiler.library-path dir="${FLEX_HOME}/frameworks" append="true">
                           <include name="libs" />
                    <include name="../bundles/{locale}" />
                        </compiler.library-path>       
                                  <source-path path-element="${env.WIP_CLIENT_COM_SRC_PATH}"/>
                                  <define name="CONFIG::FLASH_AUTHORING" value="false"/>
                                  <source-path path-element="${basedir}/test-src"/>
                                  <source-path path-element="${basedir}/src"/>
                                  <compiler.library-path dir="${basedir}" append="true">
                                 <include name="libs" />
                              </compiler.library-path>  
                                  <compiler.library-path dir="${env.WIP_CLIENT_COM_SRC_PATH}" append="true">
                                 <include name="libs" />
                              </compiler.library-path>  
                                  <compiler.external-library-path dir="${env.WIP_CLIENT_COM_SRC_PATH}/libs" append="true">
                                            <include name="GenericChat.swc"/>
                                  </compiler.external-library-path>
                         </mxmlc>
                        <echo>COMPILED TEST SWF..</echo>
                        <echo>Running Test Runner SWF</echo>
            <flexunit swf="${basedir}\bin\Test.swf"
                toDir="${basedir}\bin"
                haltonfailure="true"
                verbose="true"
                localTrusted="false"/>
            <echo>Ran Test Runner SWF</echo>
            <echo>Generate Readable Tests</echo>
            <junitreport todir="${basedir}\bin">
                <fileset dir="${basedir}\bin">
                    <include name="TEST-*.xml"/>
                </fileset>
                <report format="frames" todir="${basedir}\bin\html"/>
            </junitreport>
            <echo>Generated Readable Tests</echo>
              </target>
    Buildfile:******.xml
    UNIT TEST:
         [echo] COMPILING TEST SWF..
        [mxmlc] Cargando el archivo de configuración D:\Desarrollo\fdk\flex_sdk_4.5.1.21328\frameworks\flex-config.xml
        [mxmlc] D:\Proyectos\Bubble\Cliente\trunk\test-src\TestRunner.as: Advertencia: Esta unidad de compilación no tiene ninguna factoryClass especificada en los metadatos del fotograma para cargar las bibliotecas compartidas en tiempo de ejecución configuradas. Para compilar sin bibliotecas compartidas en tiempo de ejecución establezca la opción -static-link-runtime-shared-libraries en true o elimine la opción -runtime-shared-libraries.
        [mxmlc] *********Test.swf (50729 bytes)
         [echo] COMPILED TEST SWF..
         [echo] Running Test Runner SWF
    [flexunit] Validating task attributes ...
    [flexunit] Generating default values ...
    [flexunit] Using default working dir [****]
    [flexunit] Using the following settings for the test run:
    [flexunit]           FLEX_HOME: [*****fdk\flex_sdk_4.5.1.21328]
    [flexunit]           haltonfailure: [true]
    [flexunit]           headless: [false]
    [flexunit]           display: [99]
    [flexunit]           localTrusted: [false]
    [flexunit]           player: [flash]
    [flexunit]           port: [1024]
    [flexunit]           swf: [****\Test.swf]
    [flexunit]           timeout: [60000ms]
    [flexunit]           toDir: [********\bin]
    [flexunit] Setting up server process ...
    [flexunit] Starting server ...
    [flexunit] Opening server socket on port [1024].
    [flexunit] Waiting for client connection ...
    [flexunit] Executing 'rundll32' with arguments:
    [flexunit] 'url.dll,FileProtocolHandler'
    [flexunit] '********\Test.swf'
    [flexunit] The ' characters around the executable and arguments are
    [flexunit] not part of the command.
    [flexunit] Client connected.
    [flexunit] Setting inbound buffer size to [262144] bytes.
    [flexunit] Receiving data ...
    Thank you in advance.
    Javier

    I still have not been able to get FlexUnit running with AIR SDK 15. But I found a workaround:
    Compile the source code with SDK 15 into swc files.
    Set FlexUnit to use SDK 4.
    Do not include source code in the FlexUnit Ant task.
    Include the swc files in stead by adding another library dir parameter to the flexunit call.

  • Passing extra compiler options to flexunit ANT task?

    Hi,
    Is there a way to send any extra compiler options to the <flexunit> ANT task?
    I'm using conditional compilation and compilation (mxmlc) is failing from the <flexunit> task:
    "Error: Access of undefined property DEBUG.
    CONFIG::DEBUG {"
    I tried sneaking "-define+=CONFIG::DEBUG,false" in with one of the other compiler options you can set on the <flexunit> task, but that just doesn't work or results in a validation error like this:
    "One of the directories specified as a 'testSource' element does not exist."
    Let me know if this is possible at all.
    Thanks,
    Wijnand

    Hi Brian,
    legrosb wrote:
    @Wijnand - Sorry for the belated response.
    Not late at all! I think a response within a day on a forum is quite fast!
    legrosb wrote:
    I thought I had captured this on the wiki, but it looks like I haven't, so thank you for the heads up.
    I'll also update the wiki @ http://docs.flexunit.org/index.php?title=Ant_Task to be more detailed regarding compilation so other don't have to dig. 
    Did you just do an update on that Wiki page or did I completely miss the part that explained the <flexunit> parameters?
    legrosb wrote:
    In 4.2, which is super pre-alpha right now, I've added support to accept a series of flex-config.xml files provided by the user.  Not sure if conditional compilation can be tackled with a custom flex-config.xml file, but if so then that'd be the feature that may help you.
    Yes, being able to add (+=) a custom config file will solve this problem for me. You can define properties and values like this:
    <flex-config>
        <compiler>
            <define>
                <name>CONFIG::DEBUG</name>
                <value>false</value>
            </define>
        </compiler>
    <flex-config>
    So in your AS code you can use:
    CONFIG::DEBUG {
        // Do something that only should be done in debug mode.
    I have another question, I ran into this one during testing my SWF with flexunit.
    unittest.xml:82: java.util.concurrent.ExecutionException: command [<testcase classname='com.tuenti.video.unittest.testcase.player::MockPlayerCase' name='loadPlayer' time='0.000'  status='success'/>] not understood
    I had a look at the FlexUnitSocketThread.parseInboundMessages method that throws this error and it looks like that your defined END_OF_SUCCESS doesn't entirely match what the SWF is spitting out. They are of by 1 space: END_OF_SUCCESS is defined as: "status=\"success\" />", whereas my SWF spits out the following: "status='success'/>" (single quotes and no space before the closing of the tag).
    It looks like I'm not the only one with the ExecutionException as it is reported on StackOverflow as well: http://stackoverflow.com/questions/3953677/flexunittasks-error-of-command-not-understood
    Cheers,
    Wijnand

  • Java.lang.NullPointerException running flexunit ant task in 4.1 Beta 2

    Hello,
    After trying to debug this all day, I thought I would ask the community.
    I am trying out the new FU4.1 Beta 2 (3.5) from the downloads page.  We have a working CI system set up with 4.0, and I thought trying out 4.1 beta 2 would simply be a matter of replacing the binaries in my lib folder and re-running the ant script.  Evidently not, or else I am missing something.
    After updating to the 4.1 Beta 2 binaries, if I re-run a sample project in Eclipse, the build fails with a java NullPointerException when the <flexunit> ant task is invoked. We have an involved setup that uses the groovy AntBuilder and other esoteric constructs, so I thought I would create a very simple test script similar to the sample CI project to see if that would work.  Unfortunately, I am still seeing the NPE.  The worst part is that there is absolutely no debug information provided - no message, no traceback.  I even attached the Ant source and debugged it. I could see the NPE being caught, but it contained a null message and null traceback.
    Here is the simplified ant script:
    <project name="tests" basedir=".">
        <target name="test-init" depends="">
            <mkdir dir="${build.dir}"/>
            <mkdir dir="${reports.dir}"/>
            <mkdir dir="${reports.xml}"/>
            <mkdir dir="${reports.html}"/>
            <!-- Setup Flex and FlexUnit ant tasks -->
            <!-- You can set this directly so mxmlc will work correctly, or set
            <taskdef resource="flexUnitTasks.tasks" classpath="${lib}/flexUnitTasks-4.1.0-beta2.18.jar" />
        </target>
        <target name="run-flex-tests" depends="test-init">
          <sequential>
            <!-- Execute TestRunner.swf as FlexUnit tests and publish reports -->
            <flexunit
                swf="${build.dir}/TestRunner.swf"
                toDir="${reports.xml}"
                haltonfailure="false"
                verbose="true"
                localTrusted="true"
                timeout="60000"/>
            <!-- Generate readable JUnit-style reports -->
            <junitreport todir="${reports.xml}">
                <fileset dir="${reports.xml}">
                    <include name="TEST-*.xml" />
                </fileset>
                <report format="frames" todir="${reports.html}" />
            </junitreport>
          </sequential>   
        </target>
    </project>
    The output is:
    Buildfile: C:\EclipseWorkspace\tests\Source\Flex\build_test.xml
    test-init:
    run-flex-tests:
    [flexunit] Validating task attributes ...
    BUILD FAILED
    C:\EclipseWorkspace\tests\Source\Flex\build_test.xml:23: java.lang.NullPointerException
    Total time: 297 milliseconds
    Is there something obvious I am missing?
    Thanks for any help!
    Trevor

    Brian,
    OK, a colleague worked with me (thanks, John!) to debug the problem a little further, and I think we found the fundamental problem.  I wanted to post that info to save you some time...
    Aside: One thing we did have to do was to rebuild the flexUnitTasks.jar to include debug information, since the binary in the 4.1 beta 2 package did not have debug=true.  I'd suggest that we might want to change the build script to build the binaries with debug moving forward.
    Back to the problem.
    The NullPointerException is thrown in TaskConfiguration::validateSharedProperties(), when equals() is invoked. Here is the code snippet:
       //if we can't find the FLEX_HOME and we're using ADL or compilation
       if((flexHome == null || !flexHome.exists()) && (testRunConfiguration.getPlayer().equals("air") || shouldCompile()))
          throw new BuildException("Please specify, or verify the location for, the FLEX_HOME property.  "
                + "It is required when testing with 'air' as the player or when using the 'testSource' element.  "
                + "It should point to the installation directory for a Flex SDK.");
    In my case, I do not have a FLEX_HOME property set in Ant currently.  I'll bet most folks have this set, so the logic would run differently for them. For my case, the (flexHome == null) check is true.  That means that the testRunConfiguration.getPlayer().equals("air")check will occur next, and here is the problem. The "player" member is not set in the testRunConfiguration yet at this point, so testRunConfiguration.getPlayer() returns null. testRunConfiguration.setPlayer() is called in generateDefaults().  But generateDefaults() is not called until after validateSharedProperties() is called.  So, if properties initialization could be improved here and I think this code will run more robustly.
    I can work-around my issue temporarily by just setting a FLEX_HOME property in Ant.  But I hope you will agree that the initialization issue with "player" still should be addressed. Would you like me to open a bug report, or is this thread enough?
    Thanks,
    Trevor

  • Flexunit ant task on CI Server - rundll32.exe causing problems

    My team is using flexunit and a CI server running Hudson. On a development system, everything runs fine, and we get the reports just like we need them. It also works fine on the CI server when just the flexunit task is run, but the build fails when the CI server tries to run a full build - the build tries to run the tests and clean to prepare for the next build, but the clean fails because there is a "rundll32.exe" process using one of the files and it can't be deleted. We tracked this process down to the one run by the flexunit task.
    Our task is:
        <target name="xci-test" depends="set-flex-coverage-home, prepare-domain-metadata-to-war, prepare-sounds-to-war, prepare-domain-metadata-for-testing, compile-unit-test-flex">
            <echo>**** The flexunit target requires that you have the standalone flash player installed and configured to run .swf files automatically! ****</echo>
            <mkdir dir="${dir.flexgui.test.output}"/>
        <!-- Execute TestRunner.swf as FlexUnit tests and publish reports -->
        <!-- Please see http://docs.flexunit.org/index.php?title=Ant_Task -->
        <flexunit workingDir="${dir.flexgui.test.output}"   
                  swf="${dir.flexgui.build.war}/${flex.swf.name}test.swf"
                  toDir="${dir.flexgui.test.output}"
                  haltonfailure="false" verbose="true" localTrusted="true"
                                port="11028" timeout="40000"/>
            <!-- Generate readable JUnit-style reports -->
            <junitreport todir="${dir.flexgui.test.output}">
                <fileset dir="${dir.flexgui.test.output}">
                    <include name="TEST-*.xml"/>
                </fileset>
                <report format="frames" todir="${dir.flexgui.test.output}/"/>
            </junitreport>
            <sleep seconds="10"/>
        </target>
    I can reproduce this behavior on my dev machine by running "ant xci-test clean". We tried putting a sleep in to give the process time to shut down, no change. We attempted to use the 'command' option to the flexunit task to bypass the use of rundll32.exe, but then the flash player just hangs onto the file and the clean still fails. Since "ant xci-test" followed by "ant clean" works, we also tried running ant from within ant in order to force the process to stop, but that also didn't work. Any help on this would be greatly appreciated.
    Thanks for your time,
    Linden

    @Linden - Have not heard of this side effect from anyone as of yet, but good to know.  Sounds like the file lock is coming from the Flash Player and causing the spawning process (rundll32.exe) to hang around as well.  The FlexUnit team runs on Hudson using the FlexUnit Ant task, but we don't seem to encounter the same issue.  What's the longest interval you've tried to use with the sleep task?  Does the FP ever release its handle to the test SWF on your development machines?
    Not sure this is a problem with the FlexUnit Ant task, but in 4.2 we could try to explicitly kill the rundll32 process since we'll have the PID when the task launches it.  Head on over to JIRA and file a feature request for us and I'll see what I can do in the new year.  In the short term though, maybe try upgrading your version of the stand alone debug flash player to see if that helps.  Has anyone else seen this issue?  Could you possible just move the clean target to be called before the xci-test target is run?  Just some suggestions.
    -Brian

  • Can I reference page-flow bean from a bounded-task-flow page-fragment?

    I have a view activity implemented as page fragment in my bounded task flow.
    I declare a page-flow scope managed-bean in adfc-config.xml to do some initialization for the bounded-task-flow:
    <managed-bean id="__23">
    <managed-bean-name id="__22">TaskFlowBean</managed-bean-name>
    <managed-bean-class id="__21">view.backing.TaskFlowBackingBean</managed-bean-class>
    <managed-bean-scope id="__20">pageFlow</managed-bean-scope>
    </managed-bean>
    In my bounded task flow, the default activity is a method-call activity which call the page-flow bean method
    <method-call id="initFlow">
    <method>#{pageFlowScope.TaskFlowBean.initFlow}</method>
    <outcome id="__27">
    <fixed-outcome>showPanel</fixed-outcome>
    </outcome>
    </method-call>
    But JDeveloper (11.1.1.2) show a warning "Refereneed pageFlowScope not found" at the "Diagram" view of the flow definition.
    The fixed outcome of the default activity is to render a page-fragment which also reference the page-flow scope bean method getPanelTitle():
    <af:panelBox text="#{pageFlowScope.TaskFlowBean.panelTitle}" id="pb1">
    <f:facet name="toolbar"/>
    </af:panelBox>
    At runtime, the page fragment was rendered properly except the panel box title is missing. No other error is reported
    When I debugged the application, the bean methods initFlow() and getPanelTitle() didn't get call as the program didn't stop at the breakpoint set in the bean methods.
    The page fragment was rendered properly except the panel box title is missing.
    When I change the scope to backing bean, both initFlow() and getPanelTitle() get called but under a different backing bean.
    As the bean attributes set by initFlow() were not no longer set when getPanelTitle() was invoked even though the methods were invoked in the correct order.
    Why can't I use a page-flow scope bean within the bounded task flow?
    On further debugging, I noticed the bean was not created when it is set to be page-flow scope. I put a debug message in the constructor... never get called.
    When should a page-flow scope bean be created to be accessible on entry to a bounded task flow?
    Edited by: Pricilla on Apr 29, 2010 3:16 PM

    Please check the scope of the pageFlow from the manual.
    pageFlowScope is only available for the pages/views in that taskflow and not in the included taskflows.

  • Is it possible to run the flexunit ant task without prompting the browser or anything?

    Every time I run the task the browser prompts out and ask me to unblock the generated "TestRunner.swf", only after which the build continues. I only need the test reports and I don't want to be interupted during the build. What can I do to hide the player behind the scene? Thanks very much.

    @sotestspacetimeriskind - Ideally I'd suggest using the stand-alone (projector) debug flash player rather than a browser to run the tests unless you have a need to use the browser; sounds like you're using IE on Windows currently.  You can find the latest SA Debug FP for Windows @  http://download.macromedia.com/pub/flashplayer/updaters/10/flashplayer_10_sa_debug.exe.  After it's installed, you need to associate files with the SWF extension to be opened by the FP application.  On Windows you can do this by right-clicking on a SWF file and selecting "Open With..." from the context menu, then selecting the FP executable just installed, then selecting the check box on the file dialog choosing to open all future files with the application.  If you require the browser to run your tests due to features only found in Flex running in the browser, I'd suggest using a browser other than IE and the latest FlexUnit 4.1 binaries with the command property (see http://github.com/blegros/flexunit/blob/master/FlexUnit4SampleCIProject/build.custom.xml for an example and http://docs.flexunit.org/index.php?title=Ant_Task).
    If you're having trouble implementing the above, post your build script and environment specs and we'll try to help you out further.
    -Brian

  • Is there an ant task on FlexUnit to open browser with swf embedded?

    Here is the same (unanswered) question asked by someone else: http://forums.adobe.com/thread/740495?tstart=0#740495
    Basically I need to open my flex app in a browser window from ant, and the FlexUnit task apparently does not support this.
    I have downloaded a sample from FlexMonkey. When they (sample writers) execute flexunit in this sample, one of the arguments to FU is "url". However, I can find no evidence of this version of FU (that uses that "url" argument) existing anywhere. Using the swf argument doesn't work as documented in the previous question above. So I don't know if my problem is Flex version, or it's just not supported by FlexUnit.
    I'm using the Flex sdk 3.2.0 and the FU libraries below:
    flexunit-4.1.0-33-as3_3.5.0.12683.swc
    flexunit-4.1.0-33-flex_3.5.0.12683.swc
    flexunit-cilistener-4.1.0-33-3.5.0.12683.swc
    flexunit-uilistener-4.1.0-33-3.5.0.12683.swc
    flexUnitTasks-4.1.0-33.jar
    Please tell me if this issue has been solved and if so what libraries I need to implement it. If it is done for Flex 4.x, but not for Flex 3.2, perhaps you could guide me to the java source for the ant task for Flex 4.x so that I can implement this for Flex 3.2 or Flex 3.x.
    thanks,
    Phil

    @Linden - Have not heard of this side effect from anyone as of yet, but good to know.  Sounds like the file lock is coming from the Flash Player and causing the spawning process (rundll32.exe) to hang around as well.  The FlexUnit team runs on Hudson using the FlexUnit Ant task, but we don't seem to encounter the same issue.  What's the longest interval you've tried to use with the sleep task?  Does the FP ever release its handle to the test SWF on your development machines?
    Not sure this is a problem with the FlexUnit Ant task, but in 4.2 we could try to explicitly kill the rundll32 process since we'll have the PID when the task launches it.  Head on over to JIRA and file a feature request for us and I'll see what I can do in the new year.  In the short term though, maybe try upgrading your version of the stand alone debug flash player to see if that helps.  Has anyone else seen this issue?  Could you possible just move the clean target to be called before the xci-test target is run?  Just some suggestions.
    -Brian

  • FlexUnit ant - running tests that make server calls

    Hi,
    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" />
    </library-path>
    <source-path path-element="${basedir}/src" />
    <source-path path-element="${basedir}/locale/{locale}" />
    <compiler.verbose-stacktraces>true</compiler.verbose-stacktraces>
    <compiler.headless-server>true</compiler.headless-server>
    <compiler.services>C:\myApp\Source\WebServer\WebContent\WEB-INF\flex\services-config.xml</ compiler.services>
    <compiler.context-root>myApp</compiler.context-root>
    </mxmlc>
    No use. My tests still time out. Here is my flexUnit task:
    <target name="test" depends="compile">
    <!-- Execute FlexUnit tests and publish reports -->
    <flexunit
    swf="${bin.loc}/TestRunner.swf"
    workingDir="${bin.loc}"
    toDir="${report.loc}"
    haltonfailure="false"
    verbose="true"
    localTrusted="true"
    headless="${headless}">
      <source dir="${basedir}/locale/{locale}" >
         <include name="*.properties" />
      </source>
    <library dir="${lib.loc}" />
    </flexunit>
    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.
    Manoj

    Thanks for the reply Michael. Here is the code that describes my channel in services-config.xml:
    <channel-definition id="my-amf" class="mx.messaging.channels.AMFChannel">
                <endpoint url="http://{server.name}:{server.port}/{context.root}/messagebroker/amf" class="flex.messaging.endpoints.AMFEndpoint"/>
    </channel-definition>
    Should I be passing the server.port and server.name keys somehow?
    Thanks.
    Manoj

  • Flexunit 4.1 beta 1 ant task fails if SDK or project dir contains spaces

    downloaded FlexUnit 4.1 beta 1 for its directory scanning and test loading support.  found a problem - if either the SDK dir (e.g. C:\Program Files\Adobe\Adobe Flash Builder 4\sdks\4.0.0) or the project dir (e.g. C:\Documents and Settings\flexuser\My Documents\mike\Adobe Flash Builder 4\AntFlexUnit4.1betaSampleCIProject) contain spaces, the flexunit ant task will fail, as the following output indicates:
    <snip>
    [flexunit] '+flexlib'
    [flexunit] 'C:\Program'
    [flexunit] 'Files\Adobe\Adobe'
    [flexunit] 'Flash'
    [flexunit] 'Builder'
    [flexunit] '4\sdks\4.0.0\frameworks'
    [flexunit] '-output'
    [flexunit] 'C:\Documents'
    [flexunit] 'and'
    [flexunit] 'Settings\flexuser\My'
    [flexunit] 'Documents\mike\Adobe'
    [flexunit] 'Flash'
    [flexunit] 'Builder'
    [flexunit] '4\AntFlexUnit4.1betaSampleCIProject\target\bin\TestRunner.swf'
    <snip>
    BUILD FAILED
    C:\Documents and Settings\flexuser\My Documents\mike\Adobe Flash Builder 4\AntFlex
    Unit4.1betaSampleCIProject\build.xml:72: Compilation failed:
    command line: Error: default arguments may not be interspersed with other options
    everything worked fine if i relocated both the SDK and project dir.  unfortunately most of our developers use SDK and project directories with spaces.
    what's the ETA for beta 2 ;-) ?  anxious to integrate this excellent new feature once the spacing problem is resolved.
    thanks.
    -mike

    @mike - Ok I've updated my fork @ http://github.com/blegros/flexunit with the fix.  If you don't want to build from source, you can download the flexunit.zip file from my fork and just pull the Ant task out to use temporarily.  You can find the artifact from my fork's build @ http://flexunit.digitalprimates.net:8080/view/Contributors/job/blegros/lastSuccessfulBuild /artifact/flexunit.zip.
    Let me know if this works out for you.
    -Brian

  • flexunit 4.1 B3 Ant task fails to run Air-based tests

    Folks,
    I am using FlexUnit4.1 Beta 3 and am seeing the <flexunit> Ant task fail when running tests that use the Air libraries. The project in question used to test just fine with version 4.0 earlier this year, but I just dusted it off after a branch change and tried re-running with 4.1and started seeing the failure.Here is the relevant console output:
    [com.djte.library:flexunit] Validating task attributes ...
    [com.djte.library:flexunit] Generating default values ...
    [com.djte.library:flexunit] Using default working dir [C:\EclipseWorkspace3.5\report.renderer_tests_2\Source\Flex]
    [com.djte.library:flexunit] Using the following settings for the test run:
    [com.djte.library:flexunit]     FLEX_HOME: [C:\iFABS_DE\dev\vert-d3flxcmn24\204100.32.0.20100926233508_d3flxcmn24]
    [com.djte.library:flexunit]     haltonfailure: [false]
    [com.djte.library:flexunit]     headless: [false]
    [com.djte.library:flexunit]     display: [99]
    [com.djte.library:flexunit]     localTrusted: [true]
    [com.djte.library:flexunit]     player: [air]
    [com.djte.library:flexunit]     port: [1024]
    [com.djte.library:flexunit]     swf: [C:\EclipseWorkspace3.5\report.renderer_tests_2\build\report.renderer.tests.unit.swf]
    [com.djte.library:flexunit]     timeout: [1800000ms]
    [com.djte.library:flexunit]     toDir: [C:\EclipseWorkspace3.5\report.renderer_tests_2\build\reports\xml]
    [com.djte.library:flexunit] Setting up server process ...
    [com.djte.library:flexunit] Starting server ...
    [com.djte.library:flexunit] OS: [Windows]
    [com.djte.library:flexunit] Opening server socket on port [1024].
    [com.djte.library:flexunit] Waiting for client connection ...
    [com.djte.library:flexunit] Launching player:
    [com.djte.library:flexunit] Found AIR version: 1.5
    BUILD FAILED
    C:\public\JavaTools\DJTE\latest\DjteLibrary\library.xml:57: The following error occurred while executing this line:
    : Error launching the test runner.
    The error message is not very specific... The last output seen before the failure is "Found AIR version: 1.5". This makes me wonder if the problem is related to how I have Air installed on my Windows XP machine. Come to think of it, I am not sure exactly how the host machine should be configured to run FlexUnit tests that require Air.  Do I really need Air to be installed?  I have Air 2.0.3.13070 installed, but the <flexunit> task thinks it found version 1.5 - hmmm...  I also have the debug Flash 10 player, and SWF appplications are configued to run using this player. Flex tests run fine, just not Air tests.  What am I missing?
    I see that 4.1 RC1 is now out, so I will grab that and give it a try.
    If anyone who tests air more often has any advice - I am all ears!
    Thanks,
    Trevor

    Thanks for your responses, Brian!
    Yes, I think I see the immediate problem.  The problem is that there is no Air runtime in our customized Flex SDK (based on 3.2), even though it appears to have the Air compile libraries. I had been attempting to use this custom SDK to run FlexUnit with, and I think that needs to change.
    Why was I doing this?
    Well, I had tripped over some problems with 4.1 earlier on when I attempted to run it without having FLEX_HOME set in the environment. So, now I have been setting FLEX_HOME programmatically in my code before calling the <flexunit> task. And I had figured that it would be a good idea to set FLEX_HOME to the same SDK that the tests had been built with, i.e. our customized one.  Now I am thinking that this is not necessary, since our end users will never have access to this SDK. I now think that I should be able to install a new stock Adobe Flex SDK on my CI server, install the Air runtime into it, and then use that location when I set FLEX_HOME.  Is that how others are doing it?  If anyone could validate this approach, I would be grateful.
    One question that arises in my mind now: How does the Air runtime get into the Flex SDK? I have installed the Air runtime using the installer from Adobe some time ago, so I am not quite sure what all that did.  I assume the  Air installer finds all the Flex SDKs on your machine and inserts the runtime in each location appropriately? Again, pardon my ignorance...
    I have just tried out the above idea, i.e. setting FLEX_HOME to a different SDK that has Air runtime, and the <flexunit> task worked when I ran it!  An Air window opened, the tests ran, and reports were generated. So, it would appear my problem is solved! Cool beans!
    Brian, you made some comments about another possible issue with the "custom app descriptor".  I am not sure if that applies to me or not.  How would I know whether or not we need that support?  Again, I know it would help if I was the developer who had actually written the Flex tests, but I am not...
    Anyway, I hope this thread helps other folks who are having similar issues.  I am going to reinstall a fresh Adobe SDK and the Air installer on a clean machine next, and see if the tests will run there.
    Before ending this thread, I do want to point out that the ant task might have need of improvement in the case in which the user attempts to run the air "player" but the Air runtime is not setup in the SDK. On Windows, the ant process simply hung at this point, apparently thinking that the launch of the player had been successful, but in reality, the message about the air runtime being not found had occurred. It might be nice if it exited gracefully with a warning message instead of hanging. Just a suggestion...
    Brian, as always, thanks again for your help with this issue.You guys are doing a great job with this project. Please keep it up!
    Thanks,
    Trevor

  • [svn] 3037: Update flex-config. xml files used by the team and qa webapps to use the {targetPlayerMajorVersion} token instead of a hardcoded player version in the library-path and external-library-path .

    Revision: 3037
    Author: [email protected]
    Date: 2008-08-29 06:54:15 -0700 (Fri, 29 Aug 2008)
    Log Message:
    Update flex-config.xml files used by the team and qa webapps to use the {targetPlayerMajorVersion} token instead of a hardcoded player version in the library-path and external-library-path. This will allow the correct playerglobal.swc to be located when the target player version is set in the flex-config.xml or passed to mxmlc or compc.
    Modified Paths:
    blazeds/trunk/apps/team/WEB-INF/flex/flex-config.xml
    blazeds/trunk/qa/resources/config/flex-config.xml

    Unfortunately I don't have the
    "org.eclipse.swt.win32.win32.x86_3.1.2.jar" file. On my computer
    the folder is not set up the same way (C:\Program Files\Adobe\Flex
    Builder 2\plugins) instead it is set up as (C:\Program
    Files\Adobe\Flex Builder 2\metadata\plugins) but I've looked in
    everything and that file just isn't in there. I've re downloaded it
    twice. Still not there. Is there anything else i can do.

  • Where I can get flex-config.xml in Linux machine

    Hell All,
    We are using Linux machine as OS for portal.
    Normally we can get flex-config.xml at UNIX machine atj2ee\cluster\server0\apps\sap.com\irj\servlet_jsp\irj\root\portalapps\co
    m.sap.vc.mmcompiler\res\root\WEB-INF\flex\flex-config.xml location in UNIX machine.
    But irj is not there is Linux machine.
    Can anybody help me?
    Regards,
    Sonal Dubey

    Hi Sonal,
    As mentioned in the SAP note 886209, that is the route to find this file, what i recommend you is to check the Server in this path ... \cluster\*server0*\apps\sap...
    Kind Regards,
    Luis

  • Can you halt mxml UI construction until you have external UI config data loaded?

    If I have external (xml) config data that describes how the UI should be built, grabbing it from a file or a web service happens asynchronously. It loads late sometimes and sometimes not, as one would expect.
    I'm thinking I need to control how and when UI construction takes place.  Can I do this in mxml?  Or should I be building the UI completely in ActionScript which would let me begin the construction after firing an event indicating config data has been loaded?
    Thanks

    Thanks for answering.
    Let me restructure how I've asked this.
    Let's say I have four main components in my app.  And let's say I want to be able to configure in a database somewhere which users see which components.
    Like...
    User 1 sees all four.
    User 2 sees components 1 and 3
    User 3 sees components 2 and 4
    User 4 sees only component 2.
    etc.
    Problem is, if I create the components in mxml, they all get created and displayed before my web service gets back with the display options.
    What's the best practice for doing this?
    Thanks

  • Compiler.define in flex-config and compc

    I'm having an issue with compile time constants.  I'd like to define these constants in two places, but when I do the flex compiler forgets constants defined in my flex-config.xml (DEBUG::DEBUGGING and DEBUG::VERBOSE).  I am using flextasks.tasks in ant to build the project.
    In my build.xml:
    <target name="build-project" depends="init">
        <echo message="Building ${proj.swc.file}" />
        <compc output="${proj.target.dir.bin}/${proj.swc.file}"
            target-player="${proj.flashver}">
            <compiler.define name="INFO::VERSION_MAJOR" value="${proj.version.major}" />
            <compiler.define name="INFO::VERSION_MINOR" value="${proj.version.minor}" />
            <compiler.define name="INFO::VERSION_RELEASE" value="${proj.version.release}" />
            <compiler.define name="INFO::BUILD_TIMESTAMP" value="${proj.build.timestamp}" />
            <compiler.define name="INFO::BUILD_TIMEZONE" value="${proj.build.timezone}" />
            <load-config filename="${mx.sdk.dir}/frameworks/flex-config.xml"/>
            <load-config filename="${basedir}/flex-release-config.xml"/>
            <source-path path-element="${proj.build.dir.src}" />
            <include-sources dir="${proj.build.dir.src}" includes="**/*.as **/*.mxml"/>
            <!-- <compiler.external-library-path dir="${proj.build.dir.lib}" includes="*.swc" append="true" /> -->
            <compiler.external-library-path dir="${proj.target.dir.lib}" includes="*.swc" append="true" />
        </compc>
    </target>
    In flex-release-config.xml:
    <flex-config>
        <compiler>
            <debug>false</debug>
            <keep-generated-actionscript>false</keep-generated-actionscript>
            <verbose-stacktraces>false</verbose-stacktraces>
            <optimize>true</optimize>
            <define>
                <!-- Enables debugging mode -->
                <name>DEBUG::DEBUGGING</name>
                <value>false</value>
            </define>
            <define>
                <!-- Provides more information to the developer -->
                <name>DEBUG::VERBOSE</name>
                <value>false</value>
            </define>
        </compiler>
    </flex-config>
    If I compile using compc on the command line I can use -define+=NAME,value and it works.  Why is it not working using the compc task in ant?

    Try adding the append="true" attribute to the define elements. I'm not sure if this will work, but that's how it works (append="true" is the equivalent of +=) for other elements like external libraries.

Maybe you are looking for

  • I copied iPhoto library from old Mac to NAS. I cannot access the library from my new Mac

    I've a nice new MacBook Pro (OS X 10.9.5) with iPhoto version 9.5.1. I decided to move my iPhoto library from my old MBP (running iPhoto 7.1.5) to a Synology NAS and expected I'd be able to open it from the new Mac. I can see the library on the NAS f

  • Problem with "extends"

    hi, first : i m sorry i m not good in english. i have problem with add-ing extenteds java-class files, i m trying write "extends" and name of class file :-) is ok, is running..... but when i wannt add 2files, is not running, i was try: extends name,n

  • Warning for header po delivery cost but with only free of cost items

    Dear. Do you know If exist a chance to send a warning If I insert in a purchase order a header delivery cost condition type but the items of this po are only free of cost ? Thanks.

  • Allow users to delete Items/documents that thhey have posted

    Using SharePoint 2013. We would like users to be able to delete items and documents that they have posted, but not anything created by another user. It would appear that delete is not so fine grained. For a list, we can use "create items and edit ite

  • Soft Proofing slows LR5

    When making a soft proof copy it brings any additional adjustment almost to a halt in LR5.   Windows 7 64bit, Quad core processer, 12gig ram. Is this normal or do ii need to change a setting?   PS Same when working on a vitural raw copy.