5 Replies Latest reply on Nov 2, 2011 11:05 AM by mlabriola

    Async metadata appears to be ignored

    Elias Holman

      Hi all,

      I'm trying to get a very basic flexunit test running under the following configuration:

       

      - Code is run and compiled via FDT/Eclipse on Linux

      - Tried both flexunit 4.0 and 4.1

      - Using the standard TestRunnerBase

       

      I have a simple test that loads an image asynchronously:

       

      [Test (async)]

             public function doSimpleImageLoad() : void {

                  var l:Loader = new Loader();

                  l.load(new URLRequest("patt001-big.jpg"));

                  Async.failOnEvent(SimpleTest, l, IOErrorEvent.IO_ERROR);

                  Async.handleEvent(SimpleTest, l, Event.COMPLETE, onImageLoaded);

              }

       

      public function onImageLoaded(evt: Event) : void {

                  var loader:LoaderInfo = evt.target as LoaderInfo;

                Assert.assertNotNull(loader);         

        }

       

      I am compiling this using the following flags:

       

      -target-player=11.0

      -library-path+="{flexSDK}/frameworks/locale/en_US"

      -default-size=550,400

      -keep-as3-metadata+=Test

      -swf-version=13

       

      as I am trying to get it work under  Flash 11. I invariably get the following error:

       

      "Cannot add asynchronous functionality to methods defined by Test,Before or After that are not marked async"

       

      It is picking up the metadata because if I remove it, it says "No Tests Found", and I've tried many other combinations of metadata to try to get it to be picked up. It just simply seems to not see the async identifier. Any idea what might be causing such a problem? I've been banging my head against this for a while and nothing seems to make a difference. Any assistance would be greatly appreciated. Thanks!