5 Replies Latest reply on Mar 6, 2011 3:28 PM by darylducharme

    Errors in FlexUnit4.1 RC2 in a specific test

    darylducharme

      I've been moving from FlashBuilder4 to FDT4.2 and have had to change how I was using the FlexUnit4 framework because they aren't integrated in the same way.  A specific test seems to run but can't display the results as I get the following error:

       

      Exception fault: TypeError: Error #1034: Type Coercion failed: cannot convert Function to mx.controls.listClasses.ListBaseSelectionData.

      at mx.controls.listClasses::ListBase/adjustAfterAdd()[E:\dev\4.0.0\frameworks\projects\frame work\src\mx\controls\listClasses\ListBase.as:9721]

      at mx.controls.listClasses::ListBase/collectionChangeHandler()[E:\dev\4.0.0\frameworks\proje cts\framework\src\mx\controls\listClasses\ListBase.as:9267]

      at mx.controls::List/collectionChangeHandler()[E:\dev\4.0.0\frameworks\projects\framework\sr c\mx\controls\List.as:2985]

      at mx.controls::Tree/collectionChangeHandler()[E:\dev\4.0.0\frameworks\projects\framework\sr c\mx\controls\Tree.as:3584]

      at flash.events::EventDispatcher/dispatchEventFunction()

      at flash.events::EventDispatcher/dispatchEvent()

      at mx.controls::Tree/expandItem()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\controls \Tree.as:1796]

      at org.flexunit.flexui.controls.left::TestCasesTree/refreshTree()[E:\hudson\jobs\FlexUnit4-F lex4.1\workspace\FlexUnit4UIListener\src\org\flexunit\flexui\controls\left\TestCasesTree.m xml:81]

      at org.flexunit.flexui.controls::LeftHandSide/refreshTree()[E:\hudson\jobs\FlexUnit4-Flex4.1 \workspace\FlexUnit4UIListener\src\org\flexunit\flexui\controls\LeftHandSide.mxml:74]

      at org.flexunit.flexui::TestRunnerBase/__model_filterChanged()[E:\hudson\jobs\FlexUnit4-Flex 4.1\workspace\FlexUnit4UIListener\src\org\flexunit\flexui\TestRunnerBase.mxml:534]

      at flash.events::EventDispatcher/dispatchEventFunction()

      at flash.events::EventDispatcher/dispatchEvent()

      at org.flexunit.flexui.data::TestRunnerBasePresentationModel/handleFilterChanged()[E:\hudson \jobs\FlexUnit4-Flex4.1\workspace\FlexUnit4UIListener\src\org\flexunit\flexui\data\TestRun nerBasePresentationModel.as:368]

      at flash.events::EventDispatcher/dispatchEventFunction()

      at flash.events::EventDispatcher/dispatchEvent()

      at org.flexunit.flexui.data::FilterTestsModel/set selectedTestFunctionStatus()[E:\hudson\jobs\FlexUnit4-Flex4.1\workspace\FlexUnit4UIListen er\src\org\flexunit\flexui\data\FilterTestsModel.as:76]

      at org.flexunit.flexui.controls.left::FilterArea/onAllTestsEnd()[E:\hudson\jobs\FlexUnit4-Fl ex4.1\workspace\FlexUnit4UIListener\src\org\flexunit\flexui\controls\left\FilterArea.mxml: 79]

      at org.flexunit.flexui.controls::LeftHandSide/onAllTestsEnd()[E:\hudson\jobs\FlexUnit4-Flex4 .1\workspace\FlexUnit4UIListener\src\org\flexunit\flexui\controls\LeftHandSide.mxml:60]

      at org.flexunit.flexui::TestRunnerBase/testRunFinished()[E:\hudson\jobs\FlexUnit4-Flex4.1\wo rkspace\FlexUnit4UIListener\src\org\flexunit\flexui\TestRunnerBase.mxml:432]

      at org.flexunit.listeners::UIListener/testRunFinished()[E:\hudson\jobs\FlexUnit4-Flex4.1\wor kspace\FlexUnit4UIListener\src\org\flexunit\listeners\UIListener.as:25]

      at Function/<anonymous>()[E:\hudson\jobs\FlexUnit4-Flex4.1\workspace\FlexUnit4\src\org\flexu nit\runner\notification\RunNotifier.as:88]

      at SafeNotifier/run()[E:\hudson\jobs\FlexUnit4-Flex4.1\workspace\FlexUnit4\src\org\flexunit\ runner\notification\RunNotifier.as:272]

      at org.flexunit.runner.notification::RunNotifier/fireTestRunFinished()[E:\hudson\jobs\FlexUn it4-Flex4.1\workspace\FlexUnit4\src\org\flexunit\runner\notification\RunNotifier.as:91]

      at org.flexunit.runner::FlexUnitCore/finishRun()[E:\hudson\jobs\FlexUnit4-Flex4.1\workspace\ FlexUnit4\src\org\flexunit\runner\FlexUnitCore.as:363]

      at org.flexunit.runner::FlexUnitCore/handleRunnerComplete()[E:\hudson\jobs\FlexUnit4-Flex4.1 \workspace\FlexUnit4\src\org\flexunit\runner\FlexUnitCore.as:354]

      at org.flexunit.token::AsyncTestToken/sendResult()[E:\hudson\jobs\FlexUnit4-Flex4.1\workspac e\FlexUnit4\src\org\flexunit\token\AsyncTestToken.as:107]

      at org.flexunit.runners::ParentRunner/handleRunnerComplete()[E:\hudson\jobs\FlexUnit4-Flex4. 1\workspace\FlexUnit4\src\org\flexunit\runners\ParentRunner.as:520]

      at org.flexunit.token::AsyncTestToken/sendResult()[E:\hudson\jobs\FlexUnit4-Flex4.1\workspac e\FlexUnit4\src\org\flexunit\token\AsyncTestToken.as:107]

      at org.flexunit.internals.runners.statements::AsyncStatementBase/sendComplete()[E:\hudson\jo bs\FlexUnit4-Flex4.1\workspace\FlexUnit4\src\org\flexunit\internals\runners\statements\Asy ncStatementBase.as:76]

      at org.flexunit.internals.runners.statements::StatementSequencer/sendComplete()[E:\hudson\jo bs\FlexUnit4-Flex4.1\workspace\FlexUnit4\src\org\flexunit\internals\runners\statements\Sta tementSequencer.as:172]

      at org.flexunit.internals.runners.statements::StatementSequencer/handleChildExecuteComplete( )[E:\hudson\jobs\FlexUnit4-Flex4.1\workspace\FlexUnit4\src\org\flexunit\internals\runners\ statements\StatementSequencer.as:145]

      at org.flexunit.token::AsyncTestToken/sendResult()[E:\hudson\jobs\FlexUnit4-Flex4.1\workspac e\FlexUnit4\src\org\flexunit\token\AsyncTestToken.as:107]

      at org.flexunit.runners::ParentRunner/handleRunnerComplete()[E:\hudson\jobs\FlexUnit4-Flex4. 1\workspace\FlexUnit4\src\org\flexunit\runners\ParentRunner.as:520]

      at org.flexunit.token::AsyncTestToken/sendResult()[E:\hudson\jobs\FlexUnit4-Flex4.1\workspac e\FlexUnit4\src\org\flexunit\token\AsyncTestToken.as:107]

      at org.flexunit.internals.runners.statements::AsyncStatementBase/sendComplete()[E:\hudson\jo bs\FlexUnit4-Flex4.1\workspace\FlexUnit4\src\org\flexunit\internals\runners\statements\Asy ncStatementBase.as:76]

      at org.flexunit.internals.runners.statements::StatementSequencer/sendComplete()[E:\hudson\jo bs\FlexUnit4-Flex4.1\workspace\FlexUnit4\src\org\flexunit\internals\runners\statements\Sta tementSequencer.as:172]

      at org.flexunit.internals.runners.statements::StatementSequencer/handleChildExecuteComplete( )[E:\hudson\jobs\FlexUnit4-Flex4.1\workspace\FlexUnit4\src\org\flexunit\internals\runners\ statements\StatementSequencer.as:145]

      at org.flexunit.token::AsyncTestToken/sendResult()[E:\hudson\jobs\FlexUnit4-Flex4.1\workspac e\FlexUnit4\src\org\flexunit\token\AsyncTestToken.as:107]

      at org.flexunit.runners::BlockFlexUnit4ClassRunner/handleBlockComplete()[E:\hudson\jobs\Flex Unit4-Flex4.1\workspace\FlexUnit4\src\org\flexunit\runners\BlockFlexUnit4ClassRunner.as:19 0]

      at org.flexunit.token::AsyncTestToken/sendResult()[E:\hudson\jobs\FlexUnit4-Flex4.1\workspac e\FlexUnit4\src\org\flexunit\token\AsyncTestToken.as:107]

      at org.flexunit.internals.runners.statements::StackAndFrameManagement/handleNextExecuteCompl ete()[E:\hudson\jobs\FlexUnit4-Flex4.1\workspace\FlexUnit4\src\org\flexunit\internals\runn ers\statements\StackAndFrameManagement.as:148]

      at org.flexunit.token::AsyncTestToken/sendResult()[E:\hudson\jobs\FlexUnit4-Flex4.1\workspac e\FlexUnit4\src\org\flexunit\token\AsyncTestToken.as:107]

      at org.flexunit.internals.runners.statements::InvokeMethod/evaluate()[E:\hudson\jobs\FlexUni t4-Flex4.1\workspace\FlexUnit4\src\org\flexunit\internals\runners\statements\InvokeMethod. as:73]

      at org.flexunit.internals.runners.statements::StackAndFrameManagement/evaluate()[E:\hudson\j obs\FlexUnit4-Flex4.1\workspace\FlexUnit4\src\org\flexunit\internals\runners\statements\St ackAndFrameManagement.as:126]

      at org.flexunit.runners::BlockFlexUnit4ClassRunner/runChild()[E:\hudson\jobs\FlexUnit4-Flex4 .1\workspace\FlexUnit4\src\org\flexunit\runners\BlockFlexUnit4ClassRunner.as:153]

      at org.flexunit.internals.runners::ChildRunnerSequencer/executeStep()[E:\hudson\jobs\FlexUni t4-Flex4.1\workspace\FlexUnit4\src\org\flexunit\internals\runners\ChildRunnerSequencer.as: 82]

      at org.flexunit.internals.runners.statements::StatementSequencer/handleChildExecuteComplete( )[E:\hudson\jobs\FlexUnit4-Flex4.1\workspace\FlexUnit4\src\org\flexunit\internals\runners\ statements\StatementSequencer.as:141]

      at org.flexunit.token::AsyncTestToken/sendResult()[E:\hudson\jobs\FlexUnit4-Flex4.1\workspac e\FlexUnit4\src\org\flexunit\token\AsyncTestToken.as:107]

      at org.flexunit.runners::BlockFlexUnit4ClassRunner/handleBlockComplete()[E:\hudson\jobs\Flex Unit4-Flex4.1\workspace\FlexUnit4\src\org\flexunit\runners\BlockFlexUnit4ClassRunner.as:19 0]

      at org.flexunit.token::AsyncTestToken/sendResult()[E:\hudson\jobs\FlexUnit4-Flex4.1\workspac e\FlexUnit4\src\org\flexunit\token\AsyncTestToken.as:107]

      at org.flexunit.internals.runners.statements::StackAndFrameManagement/handleNextExecuteCompl ete()[E:\hudson\jobs\FlexUnit4-Flex4.1\workspace\FlexUnit4\src\org\flexunit\internals\runn ers\statements\StackAndFrameManagement.as:148]

      at org.flexunit.token::AsyncTestToken/sendResult()[E:\hudson\jobs\FlexUnit4-Flex4.1\workspac e\FlexUnit4\src\org\flexunit\token\AsyncTestToken.as:107]

      at org.flexunit.internals.runners.statements::InvokeMethod/evaluate()[E:\hudson\jobs\FlexUni t4-Flex4.1\workspace\FlexUnit4\src\org\flexunit\internals\runners\statements\InvokeMethod. as:73]

      at org.flexunit.internals.runners.statements::StackAndFrameManagement/evaluate()[E:\hudson\j obs\FlexUnit4-Flex4.1\workspace\FlexUnit4\src\org\flexunit\internals\runners\statements\St ackAndFrameManagement.as:126]

      at org.flexunit.runners::BlockFlexUnit4ClassRunner/runChild()[E:\hudson\jobs\FlexUnit4-Flex4 .1\workspace\FlexUnit4\src\org\flexunit\runners\BlockFlexUnit4ClassRunner.as:153]

      at org.flexunit.internals.runners::ChildRunnerSequencer/executeStep()[E:\hudson\jobs\FlexUni t4-Flex4.1\workspace\FlexUnit4\src\org\flexunit\internals\runners\ChildRunnerSequencer.as: 82]

      at org.flexunit.internals.runners.statements::StatementSequencer/handleChildExecuteComplete( )[E:\hudson\jobs\FlexUnit4-Flex4.1\workspace\FlexUnit4\src\org\flexunit\internals\runners\ statements\StatementSequencer.as:141]

      at org.flexunit.token::AsyncTestToken/sendResult()[E:\hudson\jobs\FlexUnit4-Flex4.1\workspac e\FlexUnit4\src\org\flexunit\token\AsyncTestToken.as:107]

      at org.flexunit.runners::BlockFlexUnit4ClassRunner/handleBlockComplete()[E:\hudson\jobs\Flex Unit4-Flex4.1\workspace\FlexUnit4\src\org\flexunit\runners\BlockFlexUnit4ClassRunner.as:19 0]

      at org.flexunit.token::AsyncTestToken/sendResult()[E:\hudson\jobs\FlexUnit4-Flex4.1\workspac e\FlexUnit4\src\org\flexunit\token\AsyncTestToken.as:107]

      at org.flexunit.internals.runners.statements::StackAndFrameManagement/handleNextExecuteCompl ete()[E:\hudson\jobs\FlexUnit4-Flex4.1\workspace\FlexUnit4\src\org\flexunit\internals\runn ers\statements\StackAndFrameManagement.as:148]

      at org.flexunit.token::AsyncTestToken/sendResult()[E:\hudson\jobs\FlexUnit4-Flex4.1\workspac e\FlexUnit4\src\org\flexunit\token\AsyncTestToken.as:107]

      at org.flexunit.internals.runners.statements::InvokeMethod/evaluate()[E:\hudson\jobs\FlexUni t4-Flex4.1\workspace\FlexUnit4\src\org\flexunit\internals\runners\statements\InvokeMethod. as:73]

      at org.flexunit.internals.runners.statements::StackAndFrameManagement/evaluate()[E:\hudson\j obs\FlexUnit4-Flex4.1\workspace\FlexUnit4\src\org\flexunit\internals\runners\statements\St ackAndFrameManagement.as:126]

       

      The test runner class is:

      <?xml version="1.0" encoding="utf-8"?>

      <s:Application

      xmlns:fx="http://ns.adobe.com/mxml/2009

      xmlns:s="library://ns.adobe.com/flex/spark"

      xmlns:mx="library://ns.adobe.com/flex/mx"

      xmlns:adobe="http://www.adobe.com/2009/flexUnitUIRunner"

      creationComplete="runMe()">

       

       

      <fx:Script>

      <![CDATA[

      import tests.utils.IsInTests;

       

      import org.flexunit.listeners.UIListener;

      import org.flexunit.runner.FlexUnitCore;

       

      private var core:FlexUnitCore;

       

      public function runMe():void {

      core = new FlexUnitCore();

      core.addListener(new UIListener(uiListener));

      core.runClasses(IsInTests);

      }

      ]]>

      </fx:Script>

       

      <adobe:TestRunnerBase id="uiListener" width="100%" height="100%"  />

      </s:Application>

      The test class is available at: https://github.com/darylducharme/Ducharme-Media-Code/blob/master/src/flexUnitTests/utils/I sInTests.as

      The file it is testing is available at: https://github.com/darylducharme/Ducharme-Media-Code/blob/master/src/cc/ducharme/utils/IS_ IN.as