Skip to main content
October 19, 2010
Answered

flexunit failed on "command not unterstood"

  • October 19, 2010
  • 1 reply
  • 1980 views

I use Ant to compile tests and generate reports, and the compile phase succeeded, but the <flexunit> failed, the error log following:

java.util.concurrent.ExecutionException: command [<testcase classname="XXX", name="XXX",  time='0.000'   status='success'/>] not understood,

I don't konw where is the problem

This topic has been closed for replies.
Correct answer legrosb

@jasonzhuang - Have you ever mixed the versions of the CIListener and the Ant task that you are using?  The error message you are seeing seems like a mismatch between the two.  It may also be the xml output:

<testcase classname='packageName'::BatchActionTypePmTest' name='testSetAvailableActionTypes' time='0.000'  status='success'/>

Did you add packageName into the output to obfuscate anything?  The single quote at the end of packageName is what's causing the parsing error if this is the raw output from your build.  Are you using the default package your tests?  An upgrade to 4.1.0 would definitely solve the issue as we use double quotes instead of single quotes.

Let me know.

-Brian

1 reply

Inspiring
October 19, 2010

@jasonzhuang - We need more details about what has caused the problem to offer help.  Please provide your build script, the output from the execution of your build script, and the contents of any TEST-*.xml files that have been generated (if not too numerous).  Make sure verbose="true" is set on the flexunit Ant task.  Additionally, make sure you have a minimum JRE compatible with Java 5, you're using Ant 1.7.1 at the min, and Flash Player 9 at the min.

-Brian

October 20, 2010

thanks for your help. I use jdk1.5 and ant 1.7.1, and flashplayer 9. Following is the build file and output, but there is  no TEST-*.xml files.

1. build file:

   <target name="compile"  description="compile bmc unit tests">
         <echo message="compile tests"/>
         <mxmlc file="${test.bmc.flex.project.src}/BmcTestRunner.mxml" output="${subsystem.build.dir}/bmcAppTests.swf">
             <compiler.source-path path-element="${FLEX_HOME}/frameworks"/>
             <compiler.source-path path-element="${bmc.flex.project.tempsrc}"/>
             <compiler.source-path path-element="${bmc.flex.project.tempsrc}/locale/{locale}"/>
             <compiler.library-path dir="${basedir}/flex" append="true">
                 <include name="lib"/>
             </compiler.library-path>
         </mxmlc>
     </target> 

    <target name="tests" depends="compile" description="run the bmc tests">
         <echo message="Run the bmc tests"/>
         <mkdir dir="${reports.dir}"/>
        
         <flexunit
             swf="${subsystem.build.dir}/bmcAppTests.swf"
             toDir="${reports.dir}"   
             localTrusted="true"
             verbose="true"
             haltonfailure="false">
             <library dir="${basedir}/flex/lib"/>
         </flexunit>
        
             <!-- Generate readable JUnit-style reports -->
         <junitreport todir="${reports.dir}">
             <fileset dir="${reports.dir}">
                 <include name="TEST-*.xml" />
             </fileset>
             <report format="frames" todir="${reports.dir}/html" />
         </junitreport>
        
     </target>

2. output:


[flexunit] Using the following settings for the test run:
[flexunit]     FLEX_HOME:
[flexunit]     haltonfailure: [false]
[flexunit]     headless: [false]
[flexunit]     display: [99]
[flexunit]     localTrusted: [true]
[flexunit]     player: [flash]
[flexunit]     port: [1024]
[flexunit]     swf:
[flexunit]     timeout: [60000ms]
[flexunit]     toDir:
[flexunit] Setting up server process ...
[flexunit] Starting server ...
[flexunit] Entry already available in local trust fi
le at .
[flexunit] Executing 'rundll32' with arguments:
[flexunit] 'url.dll,FileProtocolHandler'
[flexunit] 'C:\project\ant_build\imc\bmcAppTests.swf'
[flexunit]
[flexunit] The ' characters around the executable and arguments are
[flexunit] not part of the command.
[flexunit]
[flexunit] Opening server socket on port [1024].
[flexunit] Waiting for client connection ...
[flexunit] Client connected.
[flexunit] Setting inbound buffer size to [262144] bytes.
[flexunit] Receiving data ...
[flexunit] Sending acknowledgement to player to start sending test data ...
[flexunit]
[flexunit]
[flexunit] Stopping server ...
[flexunit] End of test data reached, sending acknowledgement to player ...
[flexunit] Closing client connection ...
[flexunit] Closing server on port [1024] ...

BUILD FAILED
java.util.concurrent.ExecutionException: command [<testcase classname='packageName'::BatchActionTypePmTest' name='testSetAvailable
ActionTypes' time='0.000'  status='success'/>] not understood
        at java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:205)
        at java.util.concurrent.FutureTask.get(FutureTask.java:80)
        at org.flexunit.ant.tasks.TestRun.run(Unknown Source)
        at org.flexunit.ant.tasks.FlexUnitTask.execute(Unknown Source)
        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.jav
a:106)
        at org.apache.tools.ant.Task.perform(Task.java:348)
        at org.apache.tools.ant.Target.execute(Target.java:357)
        at org.apache.tools.ant.Target.performTasks(Target.java:385)
        at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1337)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1306)
        at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExe
cutor.java:41)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1189)
        at org.apache.tools.ant.Main.runBuild(Main.java:758)
        at org.apache.tools.ant.Main.startAnt(Main.java:217)
        at org.apache.tools.ant.launch.Launcher.run(Launcher.java:257)
        at org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)
Caused by: command [<testcase classname='packageName'::BatchActionTypePmTest' name='testSetAvailableActionTypes' time='0.000'  sta
tus='success'/>] not understood
        at org.flexunit.ant.FlexUnitSocketThread.parseInboundMessages(Unknown So
urce)
        at org.flexunit.ant.FlexUnitSocketThread.call(Unknown Source)
        at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:269)
        at java.util.concurrent.FutureTask.run(FutureTask.java:123)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExec
utor.java:650)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor
.java:675)
        at java.lang.Thread.run(Thread.java:595)

legrosbCorrect answer
Inspiring
October 20, 2010

@jasonzhuang - Have you ever mixed the versions of the CIListener and the Ant task that you are using?  The error message you are seeing seems like a mismatch between the two.  It may also be the xml output:

<testcase classname='packageName'::BatchActionTypePmTest' name='testSetAvailableActionTypes' time='0.000'  status='success'/>

Did you add packageName into the output to obfuscate anything?  The single quote at the end of packageName is what's causing the parsing error if this is the raw output from your build.  Are you using the default package your tests?  An upgrade to 4.1.0 would definitely solve the issue as we use double quotes instead of single quotes.

Let me know.

-Brian