1 Reply Latest reply on Nov 11, 2011 4:44 AM by JonnyReeves

    FlexUnit 4.1 Error #1009 on Running Test Suite.

    JonnyReeves Level 1

      Hi Mike,

       

      I've not seen this problem with FlexUnit 4.1 before and it's got me a bit stumped :S

       

      All my tests error with the following stacktrace in the generated TEST.xml file:

       

      <testsuite name="com.iwi.slots.controller.dashboard.TestDashboardTrackSpinCommand" tests="1" failures="0" errors="1" skipped="0" time="0.001" hostname="gl01078m.gamesys.corp" timestamp="2011-11-11T12:13:08">
        <testcase classname="com.iwi.slots.controller.dashboard::TestDashboardTrackSpinCommand" name="spinDataMarshalledCorrectly" time="0.001">
          <error message="Error #1009: Cannot access a property or method of a null object reference." type="com.iwi.slots.controller.dashboard::TestDashboardTrackSpinCommand.spinDataMarshalledCorrectly"><![CDATA[TypeError: Error #1009: Cannot access a property or method of a null object reference.
                at org.flexunit.runners::BlockFlexUnit4ClassRunner/withPotentialAsync()[E:\hudson\jobs\FlexUnit4-Flex4.1\workspace\FlexUnit4\src\org\flexunit\runners\BlockFlexUnit4ClassRunner.as:357]
                at org.flexunit.runners::BlockFlexUnit4ClassRunner/withDecoration()[E:\hudson\jobs\FlexUnit4-Flex4.1\workspace\FlexUnit4\src\org\flexunit\runners\BlockFlexUnit4ClassRunner.as:376]
                at org.flexunit.runners::BlockFlexUnit4ClassRunner/methodBlock()[E:\hudson\jobs\FlexUnit4-Flex4.1\workspace\FlexUnit4\src\org\flexunit\runners\BlockFlexUnit4ClassRunner.as:320]
                at org.flexunit.runners::BlockFlexUnit4ClassRunner/runChild()[E:\hudson\jobs\FlexUnit4-Flex4.1\workspace\FlexUnit4\src\org\flexunit\runners\BlockFlexUnit4ClassRunner.as:152]
                at org.flexunit.internals.runners::ChildRunnerSequencer/executeStep()[E:\hudson\jobs\FlexUnit4-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.internals.runners.statements::StatementSequencer/evaluate()[E:\hudson\jobs\FlexUnit4-Flex4.1\workspace\FlexUnit4\src\org\flexunit\internals\runners\statements\StatementSequencer.as:109]
                at org.flexunit.runners::ParentRunner/run()[E:\hudson\jobs\FlexUnit4-Flex4.1\workspace\FlexUnit4\src\org\flexunit\runners\ParentRunner.as:483]
                at org.flexunit.runners::Suite/runChild()[E:\hudson\jobs\FlexUnit4-Flex4.1\workspace\FlexUnit4\src\org\flexunit\runners\Suite.as:151]
                at org.flexunit.internals.runners::ChildRunnerSequencer/executeStep()[E:\hudson\jobs\FlexUnit4-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\workspace\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\workspace\FlexUnit4\src\org\flexunit\token\AsyncTestToken.as:107]
                at org.flexunit.internals.runners.statements::AsyncStatementBase/sendComplete()[E:\hudson\jobs\FlexUnit4-Flex4.1\workspace\FlexUnit4\src\org\flexunit\internals\runners\statements\AsyncStatementBase.as:76]
                at org.flexunit.internals.runners.statements::StatementSequencer/sendComplete()[E:\hudson\jobs\FlexUnit4-Flex4.1\workspace\FlexUnit4\src\org\flexunit\internals\runners\statements\StatementSequencer.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\workspace\FlexUnit4\src\org\flexunit\token\AsyncTestToken.as:107]
                at org.flexunit.runners::BlockFlexUnit4ClassRunner/runChild()[E:\hudson\jobs\FlexUnit4-Flex4.1\workspace\FlexUnit4\src\org\flexunit\runners\BlockFlexUnit4ClassRunner.as:164]
                at org.flexunit.internals.runners::ChildRunnerSequencer/executeStep()[E:\hudson\jobs\FlexUnit4-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\workspace\FlexUnit4\src\org\flexunit\token\AsyncTestToken.as:107]
                at org.flexunit.runners::BlockFlexUnit4ClassRunner/runChild()[E:\hudson\jobs\FlexUnit4-Flex4.1\workspace\FlexUnit4\src\org\flexunit\runners\BlockFlexUnit4ClassRunner.as:164]
                at org.flexunit.internals.runners::ChildRunnerSequencer/executeStep()[E:\hudson\jobs\FlexUnit4-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\workspace\FlexUnit4\src\org\flexunit\token\AsyncTestToken.as:107]
                at org.flexunit.runners::BlockFlexUnit4ClassRunner/runChild()[E:\hudson\jobs\FlexUnit4-Flex4.1\workspace\FlexUnit4\src\org\flexunit\runners\BlockFlexUnit4ClassRunner.as:164]
                at org.flexunit.internals.runners::ChildRunnerSequencer/executeStep()[E:\hudson\jobs\FlexUnit4-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.internals.runners.statements::StatementSequencer/evaluate()[E:\hudson\jobs\FlexUnit4-Flex4.1\workspace\FlexUnit4\src\org\flexunit\internals\runners\statements\StatementSequencer.as:109]
                at org.flexunit.runners::ParentRunner/run()[E:\hudson\jobs\FlexUnit4-Flex4.1\workspace\FlexUnit4\src\org\flexunit\runners\ParentRunner.as:483]
                at org.flexunit.runners::Suite/runChild()[E:\hudson\jobs\FlexUnit4-Flex4.1\workspace\FlexUnit4\src\org\flexunit\runners\Suite.as:151]
                at org.flexunit.internals.runners::ChildRunnerSequencer/executeStep()[E:\hudson\jobs\FlexUnit4-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\workspace\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\workspace\FlexUnit4\src\org\flexunit\token\AsyncTestToken.as:107]
                at org.flexunit.internals.runners.statements::AsyncStatementBase/sendComplete()[E:\hudson\jobs\FlexUnit4-Flex4.1\workspace\FlexUnit4\src\org\flexunit\internals\runners\statements\AsyncStatementBase.as:76]
                at org.flexunit.internals.runners.statements::StatementSequencer/sendComplete()[E:\hudson\jobs\FlexUnit4-Flex4.1\workspace\FlexUnit4\src\org\flexunit\internals\runners\statements\StatementSequencer.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\workspace\FlexUnit4\src\org\flexunit\token\AsyncTestToken.as:107]
                at org.flexunit.runners::BlockFlexUnit4ClassRunner/runChild()[E:\hudson\jobs\FlexUnit4-Flex4.1\workspace\FlexUnit4\src\org\flexunit\runners\BlockFlexUnit4ClassRunner.as:164]
                at org.flexunit.internals.runners::ChildRunnerSequencer/executeStep()[E:\hudson\jobs\FlexUnit4-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\workspace\FlexUnit4\src\org\flexunit\token\AsyncTestToken.as:107]
                at org.flexunit.runners::BlockFlexUnit4ClassRunner/runChild()[E:\hudson\jobs\FlexUnit4-Flex4.1\workspace\FlexUnit4\src\org\flexunit\runners\BlockFlexUnit4ClassRunner.as:164]
                at org.flexunit.internals.runners::ChildRunnerSequencer/executeStep()[E:\hudson\jobs\FlexUnit4-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\workspace\FlexUnit4\src\org\flexunit\token\AsyncTestToken.as:107]
                at org.flexunit.runners::BlockFlexUnit4ClassRunner/runChild()[E:\hudson\jobs\FlexUnit4-Flex4.1\workspace\FlexUnit4\src\org\flexunit\runners\BlockFlexUnit4ClassRunner.as:164]
                at org.flexunit.internals.runners::ChildRunnerSequencer/executeStep()[E:\hudson\jobs\FlexUnit4-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\workspace\FlexUnit4\src\org\flexunit\token\AsyncTestToken.as:107]
                at org.flexunit.runners::BlockFlexUnit4ClassRunner/runChild()[E:\hudson\jobs\FlexUnit4-Flex4.1\workspace\FlexUnit4\src\org\flexunit\runners\BlockFlexUnit4ClassRunner.as:164]
                at org.flexunit.internals.runners::ChildRunnerSequencer/executeStep()[E:\hudson\jobs\FlexUnit4-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\workspace\FlexUnit4\src\org\flexunit\token\AsyncTestToken.as:107]
                at org.flexunit.runners::BlockFlexUnit4ClassRunner/runChild()[E:\hudson\jobs\FlexUnit4-Flex4.1\workspace\FlexUnit4\src\org\flexunit\runners\BlockFlexUnit4ClassRunner.as:164]
                at org.flexunit.internals.runners::ChildRunnerSequencer/executeStep()[E:\hudson\jobs\FlexUnit4-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\workspace\FlexUnit4\src\org\flexunit\token\AsyncTestToken.as:107]
                at org.flexunit.runners::BlockFlexUnit4ClassRunner/runChild()[E:\hudson\jobs\FlexUnit4-Flex4.1\workspace\FlexUnit4\src\org\flexunit\runners\BlockFlexUnit4ClassRunner.as:164]
                at org.flexunit.internals.runners::ChildRunnerSequencer/executeStep()[E:\hudson\jobs\FlexUnit4-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]]]></error>
        </testcase>
      </testsuite>
      

       

      Here's the ANT that I'm using to invoke FlexUnit 4:

       

        <target name="test" depends="clean, compile" description="Execute the Flex Unit Tests for this module">
        <taskdef resource="flexUnitTasks.tasks" classpath="${FLEXUNIT_HOME}/flexUnitTasks-4.1.0-8.jar" />
        
        <mkdir dir="${report.dir}" />
        <flexunit 
        failureproperty="tests.failed"
        workingDir="${target.dir}" 
        toDir="${report.dir}" 
        verbose="true"
        headless="{flexunit.headless}"
        debug="true"
        haltonfailure="false">
        <testSource dir="${test-src.dir}">
        <include name="**/Test*.as" />
        </testSource>
        <library dir="${target.dir}" />
        <library dir="${lib.dir}" />
        <library dir="${FLEXUNIT_HOME}" />
        </flexunit>  
      
        <junitreport todir="${report.dir}">
        <fileset dir="${report.dir}">
        <include name="TEST-*.xml" />
        </fileset>
        <report format="frames" todir="${report.dir}/html" />
        </junitreport>
      
        <fail if="tests.failed" />
        </target>
      

       

      I'm compiling with FlexSDK 4.1.0 (the one that ships with Flash Builder 4.5).

       

      Hopefully you've seen this one before :S

      Jonny.