View unanswered posts | View active topics



Reply to topic  [ 4 posts ] 
FlexUnit on FlashDevelop 
Author Message
Member

Joined: Fri Feb 18, 2011 10:19 am
Posts: 6
Hi,

I am part of a team who use flex unit to test the code and it works very well on Flash Builder.

But I prefer FlashDevelop and I would like to know how to make flex unit work on FlashDevelop.

I have read some doc and found that there are several Japanese website mentioning tools to work with flex unit on FlashDevelop:

http://d.hatena.ne.jp/ActionScript/2009 ... nit_4_test


It seems even better than Flash Builder graphical output.

Is someone aware of these works?
Can someone translate since google does a very bad job :)


Thank you.


Tue Mar 01, 2011 6:44 pm
Profile
Member

Joined: Fri Feb 18, 2011 10:19 am
Posts: 6
bump


Fri Jun 10, 2011 3:59 pm
Profile
Admin

Joined: Wed Aug 31, 2005 7:27 am
Posts: 12172
Location: London
We don't use Flex Unit ourselves but if you provide a minimal sample project with code & tests (that would work in FlashBuilder with Flex Unit) then we'll look into it.


Fri Jun 10, 2011 7:17 pm
Profile WWW
Member

Joined: Sun May 11, 2008 3:01 pm
Posts: 895
Hi, I believe that Ant plugin is still functional. It doesn't require that much of a setup to run FlexUnit with Ant + you will have some extended flexibility in builds + you will be able to automate tasks, which is what Ant is known for.
Here, I picked at random a target I use for running unit tests. Should be no problem to set it up by pattern:

Code:
   <taskdef resource="flexUnitTasks.tasks"
      classpath="${FLEXUNIT_PATH}/flexUnitTasks-4.1.0_RC2-28.jar"/>
. . .

   <target name="fut-net" description="Run FlexUnit tests on net.* package">
      <mxmlc file="${SRC_NET_DIR}/tests/RunnerNet.as"
         output="${TEST_DIR}/RunnerNet.swf"
         static-link-runtime-shared-libraries="true"
         debug="true"
         dump-config="${basedir}/config.xml"
         link-report="linkReport.xml"
         compiler.warn-unlikely-function-value="false"
         use-network="true">
         <define name="CONFIG::debug" value="${DEBUGGING}"/>
         <load-config filename="${FLEX_HOME}/frameworks/flex-config.xml"/>
         <source-path path-element="${LIB_DIR}"/>
         <source-path path-element="${SRC_NET_DIR}"/>
         <library-path dir="${FLEX_HOME}/frameworks/libs">
            <include name="framework.swc"/>
         </library-path>
         <library-path dir="${FLEXUNIT_PATH}">
            <include name="flexunit-4.1.0_RC2-28-as3_3.5.0.12683.swc"/>
            <include name="flexunit-uilistener-4.1.0_RC2-28-3.5.0.12683.swc"/>
            <include name="flexunit-cilistener-4.1.0_RC2-28-3.5.0.12683.swc"/>
         </library-path>
         <library-path dir="${LIB_NET_DIR}">
            <include name="blooddy_crypto.swc"/>
         </library-path>
      </mxmlc>
      <mkdir dir="${FLEX_UNIT_DIR}"/>
 
      <!--
         Note: By specifying haltonfailure, the ant script will use a return
         code of 1 instead of 0, which you can use to script validation of
         the test results.
         Note: we may try to experiment later with "half-headless" test runner
         for now it's false.

         <flexunit
            player="flash|air"
            command="<path to the executable for the Flash Player or ADL>"
            swf="<path to your SWF file>"
            toDir="<path where XML reports should be written>"
            workingDir="<path to which compilation resource may be copied>"
            haltonfailure="true|false"
            verbose="true|false"
            localTrusted="true|false"
            port="<port number on which to run the XMLSocket>"
            buffer="<size in bytes of buffer for incoming data from flash movie>"
            timeout="<timeout for the runner in milliseconds>"
            failureproperty="<property name to set to 'true' if any tests fail>"
            headless="true|false"
            display="<X-Windows display # to use in headless mode">
            <source dir="..." />
            <testSource dir="...">
               <include name="**/*Test.as" />
               <include name="**/*Test.mxml" />
            </testSource>
            <library dir="..." />
         </flexunit>
      -->
      <flexunit swf="${TEST_DIR}/RunnerNet.swf"
         toDir="${FLEX_UNIT_DIR}"
         haltonfailure="false"
         headless="false"
         verbose="true"
         localTrusted="true"
         timeout="60000"/>
 
      <junitreport todir="${FLEX_UNIT_DIR}">
         <fileset dir="${FLEX_UNIT_DIR}">
            <include name="TEST-*.xml"/>
         </fileset>
         <report format="frames" todir="${FLEX_UNIT_DIR}/html"/>
      </junitreport>
   </target>

Strange... I think I've read on their wiki they had some integration with FD, but maybe I've dreamed it... in any case, this shouldn't be difficult. Maybe I'll try to make an example project some time :)

_________________
http://www.couchsurfing.com/people/wvxvw


Wed Jun 15, 2011 3:19 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 4 posts ] 

Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.