4 Replies Latest reply on Dec 17, 2010 12:36 PM by michaelthefrustrateddev

    Illegal override of ExpectAsync in org.flexunit.internals.runners.statements.ExpectAsync

    R>M>L

      Hi,

      Run into a painful bug that blocks our testing.  Will continue investigating but wanted to post for advice / answers / etc.

      Problem description: Previously testing-working FlashBuilder library project now fails with "VerifyError: Error #1053: Illegal override of ExpectAsync in org.flexunit.internals.runners.statements.ExpectAsync."

      I'll go into the details below but here are the FB-unit-testing stack and console output...

       

      Console output:

      [SWF] C:\Users\PATH_TO_PROJECT\bin\FlexUnitApplication.swf - 2,036,321 bytes after decompression
      
      method not implemented org.flexunit.internals.runners.statements::IAsyncHandlingStatement/org.flexunit.internals.runners.statements:IAsyncHandlingStatement::handleBindableNextSequence()
         over-binding 0 in org.flexunit.internals.runners.statements::ExpectAsync
      
      method not implemented org.flexunit.internals.runners.statements::IAsyncHandlingStatement/org.flexunit.internals.runners.statements:IAsyncHandlingStatement::asyncResponder()
         over-binding 0 in org.flexunit.internals.runners.statements::ExpectAsync
      

       

      FB stack 1:

      VerifyError: Error #1053: Illegal override of ExpectAsync in org.flexunit.internals.runners.statements.ExpectAsync.
      at global$init
      at org.flexunit.runners::BlockFlexUnit4ClassRunner/withPotentialAsync(BlockFlexUnit4ClassRunner.as:336)
      at org.flexunit.runners::BlockFlexUnit4ClassRunner/withDecoration(BlockFlexUnit4ClassRunner.as:345)
      at org.flexunit.runners::BlockFlexUnit4ClassRunner/methodBlock(BlockFlexUnit4ClassRunner.as:297)
      at org.flexunit.runners::BlockFlexUnit4ClassRunner/runChild(BlockFlexUnit4ClassRunner.as:129)
      at org.flexunit.internals.runners::ChildRunnerSequencer/executeStep(ChildRunnerSequencer.as:82)
      at org.flexunit.internals.runners.statements::StatementSequencer/handleChildExecuteComplete(StatementSequencer.as:134)
      at org.flexunit.internals.runners.statements::StatementSequencer/evaluate(StatementSequencer.as:108)
      at org.flexunit.internals.runners.statements::StatementSequencer/executeStep(StatementSequencer.as:97)
      at org.flexunit.internals.runners.statements::StatementSequencer/handleChildExecuteComplete(StatementSequencer.as:134)
      at org.flexunit.token::AsyncTestToken/sendResult(AsyncTestToken.as:118)
      at org.flexunit.internals.runners.statements::AsyncStatementBase/sendComplete(AsyncStatementBase.as:76)
      at org.flexunit.internals.runners.statements::StatementSequencer/sendComplete(StatementSequencer.as:165)
      at org.flexunit.internals.runners.statements::StatementSequencer/handleChildExecuteComplete(StatementSequencer.as:138)
      at org.flexunit.internals.runners.statements::StatementSequencer/evaluate(StatementSequencer.as:108)
      at org.flexunit.internals.runners.statements::StatementSequencer/executeStep(StatementSequencer.as:97)
      at org.flexunit.internals.runners.statements::StatementSequencer/handleChildExecuteComplete(StatementSequencer.as:134)
      at org.flexunit.internals.runners.statements::StatementSequencer/evaluate(StatementSequencer.as:108)
      at org.flexunit.runners::ParentRunner/run(ParentRunner.as:416)
      at org.flexunit.runner::FlexUnitCore/beginRunnerExecution(FlexUnitCore.as:245)
      at org.flexunit.token::AsyncListenersToken/sendReady(AsyncListenersToken.as:96)
      at org.flexunit.runner.notification.async::AsyncListenerWatcher/sendReadyNotification(AsyncListenerWatcher.as:148)
      at org.flexunit.runner.notification.async::AsyncListenerWatcher/handleListenerReady(AsyncListenerWatcher.as:163)
      at flash.events::EventDispatcher/dispatchEventFunction
      at flash.events::EventDispatcher/dispatchEvent
      at flexunit.flexui::FlexUnit4TestRunner/handleConnect(FlexUnit4TestRunner.as:315)
      at flash.events::EventDispatcher/dispatchEventFunction
      at flash.events::EventDispatcher/dispatchEvent
      at flash.net::XMLSocket/reflectEvent

       

      FB stack 2:

      TypeError: Error #1009: Cannot access a property or method of a null object reference.
      at org.flexunit.runners::BlockFlexUnit4ClassRunner/withPotentialAsync(BlockFlexUnit4ClassRunner.as:336)
      at org.flexunit.runners::BlockFlexUnit4ClassRunner/withDecoration(BlockFlexUnit4ClassRunner.as:345)
      at org.flexunit.runners::BlockFlexUnit4ClassRunner/methodBlock(BlockFlexUnit4ClassRunner.as:297)
      at org.flexunit.runners::BlockFlexUnit4ClassRunner/runChild(BlockFlexUnit4ClassRunner.as:129)
      at org.flexunit.internals.runners::ChildRunnerSequencer/executeStep(ChildRunnerSequencer.as:82)
      at org.flexunit.internals.runners.statements::StatementSequencer/handleChildExecuteComplete(StatementSequencer.as:134)
      at org.flexunit.token::AsyncTestToken/sendResult(AsyncTestToken.as:118)
      at org.flexunit.runners::BlockFlexUnit4ClassRunner/runChild(BlockFlexUnit4ClassRunner.as:141)
      at org.flexunit.internals.runners::ChildRunnerSequencer/executeStep(ChildRunnerSequencer.as:82)
      at org.flexunit.internals.runners.statements::StatementSequencer/handleChildExecuteComplete(StatementSequencer.as:134)
      at org.flexunit.internals.runners.statements::StatementSequencer/evaluate(StatementSequencer.as:108)
      at org.flexunit.internals.runners.statements::StatementSequencer/executeStep(StatementSequencer.as:97)
      at org.flexunit.internals.runners.statements::StatementSequencer/handleChildExecuteComplete(StatementSequencer.as:134)
      at org.flexunit.token::AsyncTestToken/sendResult(AsyncTestToken.as:118)
      at org.flexunit.internals.runners.statements::AsyncStatementBase/sendComplete(AsyncStatementBase.as:76)
      at org.flexunit.internals.runners.statements::StatementSequencer/sendComplete(StatementSequencer.as:165)
      at org.flexunit.internals.runners.statements::StatementSequencer/handleChildExecuteComplete(StatementSequencer.as:138)
      at org.flexunit.internals.runners.statements::StatementSequencer/evaluate(StatementSequencer.as:108)
      at org.flexunit.internals.runners.statements::StatementSequencer/executeStep(StatementSequencer.as:97)
      at org.flexunit.internals.runners.statements::StatementSequencer/handleChildExecuteComplete(StatementSequencer.as:134)
      at org.flexunit.internals.runners.statements::StatementSequencer/evaluate(StatementSequencer.as:108)
      at org.flexunit.runners::ParentRunner/run(ParentRunner.as:416)
      at org.flexunit.runners::Suite/runChild(Suite.as:93)
      at org.flexunit.internals.runners::ChildRunnerSequencer/executeStep(ChildRunnerSequencer.as:82)
      at org.flexunit.internals.runners.statements::StatementSequencer/handleChildExecuteComplete(StatementSequencer.as:134)
      at org.flexunit.internals.runners.statements::StatementSequencer/evaluate(StatementSequencer.as:108)
      at org.flexunit.internals.runners.statements::StatementSequencer/executeStep(StatementSequencer.as:97)
      at org.flexunit.internals.runners.statements::StatementSequencer/handleChildExecuteComplete(StatementSequencer.as:134)
      at org.flexunit.token::AsyncTestToken/sendResult(AsyncTestToken.as:118)
      at org.flexunit.internals.runners.statements::AsyncStatementBase/sendComplete(AsyncStatementBase.as:76)
      at org.flexunit.internals.runners.statements::StatementSequencer/sendComplete(StatementSequencer.as:165)
      at org.flexunit.internals.runners.statements::StatementSequencer/handleChildExecuteComplete(StatementSequencer.as:138)
      at org.flexunit.internals.runners.statements::StatementSequencer/evaluate(StatementSequencer.as:108)
      at org.flexunit.internals.runners.statements::StatementSequencer/executeStep(StatementSequencer.as:97)
      at org.flexunit.internals.runners.statements::StatementSequencer/handleChildExecuteComplete(StatementSequencer.as:134)
      at org.flexunit.internals.runners.statements::StatementSequencer/evaluate(StatementSequencer.as:108)
      at org.flexunit.runners::ParentRunner/run(ParentRunner.as:416)
      at org.flexunit.runner::FlexUnitCore/beginRunnerExecution(FlexUnitCore.as:245)
      at org.flexunit.token::AsyncListenersToken/sendReady(AsyncListenersToken.as:96)
      at org.flexunit.runner.notification.async::AsyncListenerWatcher/sendReadyNotification(AsyncListenerWatcher.as:148)
      at org.flexunit.runner.notification.async::AsyncListenerWatcher/handleListenerReady(AsyncListenerWatcher.as:163)
      at flash.events::EventDispatcher/dispatchEventFunction
      at flash.events::EventDispatcher/dispatchEvent
      at flexunit.flexui::FlexUnit4TestRunner/handleConnect(FlexUnit4TestRunner.as:315)
      at flash.events::EventDispatcher/dispatchEventFunction
      at flash.events::EventDispatcher/dispatchEvent
      at flash.net::XMLSocket/reflectEvent

       

      All tests fail, the first with stack 1, all others with stack 2.

      Projects that include this library also fail with the same error.

       

      We have other projects that don't fail in this way.  (suggesting something odd about this one -- our 'key' library! )

      The failing project links with our other projects and builds an executable that works fine.  (suggesting something testing-specific)

       

      The same project fails in the same way on multiple users machines (some of which have different OSes, different SDK configurations, etc).

       

      We first observed the problem roughly 1-2 weeks ago.  It fails all the time now.

      We probably hadn't run the tests on this project for a while since we  hadn't had any changes.  When last run, it worked fine.

      Roughly 2 weeks back, we switched from a previous AIR2 build to a later one.  (by duplicating and overlaying the FB4-supplied SDK.)

      We may have had other changes (e.g. switch from beta1 FB to final and may have also updated our Parsley libraries to 2.2.0.)

       

      Tried switching back to previous AIR2 build SDK, same problem.

      Tried creating another library project linked with the same Parsley libraries, no problem.

       

      Haven't moved to FB4.1, nor final AIR2.  Could try these.

      Haven't yet tried creating a not-using-FlashBuilder test runner.  Might do this first.

       

      All thoughts / redirections / questions welcome!

      Rupert.

        • 1. Re: Illegal override of ExpectAsync in org.flexunit.internals.runners.statements.ExpectAsync
          mlabriola Level 4

          Rupert:

           

          I think all of the AIR/SDK changes, etc. are red herrings. I think you have a relatively simple problem. The key is in the first error you posted.

           

          "method not implemented org.flexunit.internals.runners.statements::IAsyncHandlingStatement/org.flexunit.internals .runners.statements:IAsyncHandlingStatement::handleBindableNextSequence()

             over-binding 0 in org.flexunit.internals.runners.statements::ExpectAsyn"

           

          This is telling you that something you claim implements IAsyncHandlingStatement doesn't have a required method, named handleBindableNextSequence. This is a big clue. handleBindableNextSequence is a required method of this interface if you are building the library with the Flex extensions. This method is not required if you build the library without these extensions (ActionScript only)

           

          So, I would wager you have one of two things happening.

           

          Scenario A, you have two copies of FlexUnit4 in different projects or libraries. One of them is a Flex4 ActionScript Only version, and one is a Flex version and the linker is confused as well causing these errors to occur at runtime.

           

          Scenario B, one your libraries is referencing and/or building FlexUnit 4 classes into it. Then in your test project you are using a different copy of FlexUnit 4 during test and again, you have a mistmatch of AS-only versions and Flex versions.

           

          Unless you are using a beta version of FlexUnit, which you didn't mention, the core libraries have not changed since last december and this particular class hasn't changes since nearly a year before that.

           

          I can replicate that error if I setup two projects on my machine and mix the versions of the FlexUnit4.swc as I mention above.

           

          Mike

          • 2. Re: Illegal override of ExpectAsync in org.flexunit.internals.runners.statements.ExpectAsync
            mlabriola Level 4

            p.s. other possible source for this issue:

             

            If this is a Flex project in Flash Builder, they are including the Flex version of the FlexUnit swc

             

            It could be, however, that one of the other libraries you mention is accidentally (or intentionally) linking resources from an AS-Only version of FlexUnit as well. However, if everyone externalizes external libraries in their project, even this would be okay.

             

            Mike

            1 person found this helpful
            • 3. Re: Illegal override of ExpectAsync in org.flexunit.internals.runners.statements.ExpectAsync
              R>M>L Level 1

              Brilliant, thanks Mike!

               

              Checking the project, I found the following in our testing libs paths:

              ${FLEXUNIT_LIB_LOCATION}/version4libs/ASProject

               

              Removing this allows the tests to run fine!

               

              Version control says it's been in there a while so I suspect it was only 'armed' when we switched from beta1 FB  (which we delayed for an age due to some migration issues) and only revealed when we ran the tests after some of its code was changed.  Doh!

               

              Thank you again -- especially for such a prompt reply on a Sunday night!

              Rupert.

               

              p.s.  I can only guess how widely is felt the influence of this forum upon the  quality of Flash/Flex code all over the world.

              • 4. Re: Illegal override of ExpectAsync in org.flexunit.internals.runners.statements.ExpectAsync
                michaelthefrustrateddev

                Thank  you!  Tests were running for me in FlashBuilder but failing in ant build after upgra

                ding from Flex3 to Flex4.  I copied and pasted all the flexunit libraries

                to our deploy area including AS only ones.  You just cured my migraine.