5 Replies Latest reply on Aug 30, 2010 12:49 PM by mlabriola

    Problem with Flexunit 4.1 beta3: strange hamcrest errors

    coloradomidland

      I'm having a problem getting the recent beta3 release of flexunit to work. A test which runs fine on beta2 fails with the stack trace below on beta3.

       

      The line in the test on which the error occurs is:

       

                  var rid:Array = _csp.intervalRangeBeginEndData;

                  assertThat(rid, hasItems(_resourceManager.getString(...), _resourceManager.getString(...)));

       

      Other tests using hamcrest work, specifically, those using the re() matcher (regular expression). I have tried using both the stock hamcrest SWC version 1.0.2 from http://github.com/drewbourne/hamcrest-as3, as well as the hamcrest SWC that comes in the flexunit beta3 distribution (which interestingly also claims to be version 1.0.2, but is nearly twice the size). Both fail the same way.

       

      I am using the Flex SDK 4.0, and have downloaded the "Flex-based flexunit (for SDK 4)" version.

       

      Any suggestions?

       

      Jon

       

       

       

       

       

      Error #1053: Illegal override of NullDescription in org.hamcrest.NullDescription.

       

      VerifyError: Error #1053: Illegal override of NullDescription in org.hamcrest.NullDescription.

      at global$init()
      at org.hamcrest::DiagnosingMatcher/matches()
      at global/assertThatMatcher()
      at global/org.hamcrest::assertThat()
      at com.hp.vse.cp.presentationmodel.planning.csw::GeneralStepPresenterTest/testRangeIndicatorData()
      at Function/http://adobe.com/AS3/2006/builtin::apply()
      at flex.lang.reflect::Method/apply()
      at org.flexunit.runners.model::FrameworkMethod/invokeExplosively()
      at org.flexunit.internals.runners.statements::InvokeMethod/evaluate()
      at org.flexunit.internals.runners.statements::RunBeforesInline/handleSequenceExecuteComplete()
      at org.flexunit.token::AsyncTestToken/sendResult()
      at org.flexunit.internals.runners.statements::AsyncStatementBase/sendComplete()
      at org.flexunit.internals.runners.statements::StatementSequencer/sendComplete()
      at org.flexunit.internals.runners.statements::StatementSequencer/handleChildExecuteComplete()
      at org.flexunit.token::AsyncTestToken/sendResult()
      at org.flexunit.internals.runners.statements::InvokeMethod/evaluate()
      at org.flexunit.internals.runners.statements::SequencerWithDecoration/executeStep()
      at org.flexunit.internals.runners.statements::StatementSequencer/handleChildExecuteComplete()
      at org.flexunit.token::AsyncTestToken/sendResult()
      at org.flexunit.internals.runners.statements::InvokeMethod/evaluate()
      at org.flexunit.internals.runners.statements::SequencerWithDecoration/executeStep()
      at org.flexunit.internals.runners.statements::StatementSequencer/handleChildExecuteComplete()
      at org.flexunit.internals.runners.statements::StatementSequencer/evaluate()
      at org.flexunit.internals.runners.statements::RunBeforesInline/evaluate()
      at org.flexunit.internals.runners.statements::RunAftersInline/evaluate()
      at org.flexunit.internals.runners.statements::StackAndFrameManagement/evaluate()
      at org.flexunit.runners::BlockFlexUnit4ClassRunner/runChild()
      at org.flexunit.internals.runners::ChildRunnerSequencer/executeStep()
      at org.flexunit.internals.runners.statements::StatementSequencer/handleChildExecuteComplete()
      at org.flexunit.token::AsyncTestToken/sendResult()
      at org.flexunit.runners::BlockFlexUnit4ClassRunner/handleBlockComplete()
      at org.flexunit.token::AsyncTestToken/sendResult()
      at org.flexunit.internals.runners.statements::StackAndFrameManagement/handleNextExecuteComplete()
      at org.flexunit.token::AsyncTestToken/sendResult()
      at org.flexunit.internals.runners.statements::AsyncStatementBase/sendComplete()
      at org.flexunit.internals.runners.statements::RunAftersInline/handleSequenceExecuteComplete()
      at org.flexunit.token::AsyncTestToken/sendResult()
      at org.flexunit.internals.runners.statements::AsyncStatementBase/sendComplete()
      at org.flexunit.internals.runners.statements::StatementSequencer/sendComplete()
      at org.flexunit.internals.runners.statements::StatementSequencer/handleChildExecuteComplete()
      at org.flexunit.token::AsyncTestToken/sendResult()
      at org.flexunit.internals.runners.statements::InvokeMethod/evaluate()
      at org.flexunit.internals.runners.statements::SequencerWithDecoration/executeStep()
      at org.flexunit.internals.runners.statements::StatementSequencer/handleChildExecuteComplete()
      at org.flexunit.token::AsyncTestToken/sendResult()
      at org.flexunit.internals.runners.statements::InvokeMethod/evaluate()
      at org.flexunit.internals.runners.statements::SequencerWithDecoration/executeStep()
      at org.flexunit.internals.runners.statements::StatementSequencer/handleChildExecuteComplete()
      at org.flexunit.internals.runners.statements::StatementSequencer/evaluate()
      at org.flexunit.internals.runners.statements::RunAftersInline/handleNextStatementExecuteComplete()
      at org.flexunit.token::AsyncTestToken/sendResult()
      at org.flexunit.internals.runners.statements::AsyncStatementBase/sendComplete()
      at org.flexunit.internals.runners.statements::RunBeforesInline/handleNextStatementExecuteComplete()
      at org.flexunit.token::AsyncTestToken/sendResult()
      at org.flexunit.internals.runners.statements::ExpectAsync/sendComplete()
      at org.flexunit.internals.runners.statements::ExpectAsync/handleNextExecuteComplete()
      at org.flexunit.token::AsyncTestToken/sendResult()
      at org.flexunit.internals.runners.statements::InvokeMethod/evaluate()
      at org.flexunit.internals.runners.statements::ExpectAsync/evaluate()
      at org.flexunit.internals.runners.statements::RunBeforesInline/handleSequenceExecuteComplete()
      at org.flexunit.token::AsyncTestToken/sendResult()
      at org.flexunit.internals.runners.statements::AsyncStatementBase/sendComplete()
      at org.flexunit.internals.runners.statements::StatementSequencer/sendComplete()

        • 1. Re: Problem with Flexunit 4.1 beta3: strange hamcrest errors
          coloradomidland Level 1

          Probably related: I also get the following stack trace in another one of my tests under beta3, but not beta2. The line in the test looks very similar to the previous example (assertThat with an array and a hasItems() matcher).

           

           

          Error #1009: Cannot access a property or method of a null object reference.

           

          TypeError: Error #1009: Cannot access a property or method of a null object reference.
          at org.hamcrest::DiagnosingMatcher/matches()
          at global/assertThatMatcher()
          at global/org.hamcrest::assertThat()
          at com.hp.vse.cp.presentationmodel.planning.csw::GeneralStepPresenterTest/testRangeSelectorData()
          at Function/http://adobe.com/AS3/2006/builtin::apply()
          at flex.lang.reflect::Method/apply()
          at org.flexunit.runners.model::FrameworkMethod/invokeExplosively()
          at org.flexunit.internals.runners.statements::InvokeMethod/evaluate()
          at org.flexunit.internals.runners.statements::RunBeforesInline/handleSequenceExecuteComplete()
          at org.flexunit.token::AsyncTestToken/sendResult()
          at org.flexunit.internals.runners.statements::AsyncStatementBase/sendComplete()
          at org.flexunit.internals.runners.statements::StatementSequencer/sendComplete()
          at org.flexunit.internals.runners.statements::StatementSequencer/handleChildExecuteComplete()
          at org.flexunit.token::AsyncTestToken/sendResult()
          at org.flexunit.internals.runners.statements::InvokeMethod/evaluate()
          at org.flexunit.internals.runners.statements::SequencerWithDecoration/executeStep()
          at org.flexunit.internals.runners.statements::StatementSequencer/handleChildExecuteComplete()
          at org.flexunit.token::AsyncTestToken/sendResult()
          at org.flexunit.internals.runners.statements::InvokeMethod/evaluate()
          at org.flexunit.internals.runners.statements::SequencerWithDecoration/executeStep()
          at org.flexunit.internals.runners.statements::StatementSequencer/handleChildExecuteComplete()
          at org.flexunit.internals.runners.statements::StatementSequencer/evaluate()
          at org.flexunit.internals.runners.statements::RunBeforesInline/evaluate()
          at org.flexunit.internals.runners.statements::RunAftersInline/evaluate()
          at org.flexunit.internals.runners.statements::StackAndFrameManagement/handleTimerComplete()
          at flash.events::EventDispatcher/dispatchEventFunction()
          at flash.events::EventDispatcher/dispatchEvent()
          at flash.utils::Timer/tick()

          • 2. Re: Problem with Flexunit 4.1 beta3: strange hamcrest errors
            mlabriola Level 4

            Jon,

             

            First question where are you finding a hamcrest.swc in the beta 3 distribution? Are you grabbing something from the turnkey project?

             

            Let me know that so I can help.

             

            The version of hamcrest that Beta 3 links against is the current master build, not released. However, other than in the samples project, I don't think we distribute a copy anywhere.

             

            If you want the version we link against in beta3, you can grab those assets here if you want to give those a test.

             

            http://flexunit.digitalprimates.net:8080/view/Supplemental/

             

             

            Mike

            • 3. Re: Problem with Flexunit 4.1 beta3: strange hamcrest errors
              coloradomidland Level 1

              Mike,

               

              Yes, I believe it was in the turnkey project, in the libs directory. I was desperate. :-)

               

              I'll try the version of hamcrest at the link you mentioned.

               

              We're moving to beta3 because we're having problems with a NumberFormatException when dealing with a test time of NaN, which appears to be fixed according to the commit comments.

               

              Thanks for your help!

               

              Jon

              • 4. Re: Problem with Flexunit 4.1 beta3: strange hamcrest errors
                coloradomidland Level 1

                OK, that was the problem. Thanks for the pointer.

                 

                When flexunit 4.1 releases, will it include a captive copy of hamcrest-as3, or will it depend on a hamcrest release from some other site?

                 

                Jon

                • 5. Re: Problem with Flexunit 4.1 beta3: strange hamcrest errors
                  mlabriola Level 4

                  We don't distribute hamcrest, so it will always depend on an external version.... however... it will be tested, approved and link against a specific version. So, basically, the next version of hamcrest will be tagged shortly. That version will be linked against for our 4.1 release and it will be well known and clearly labeled.

                   

                  Mike