Skip to main content
asafdsadfasddfsas
Participant
June 19, 2010
Answered

FlexUnit4 with Flex Application compiled using Flex SDK 3.0?

  • June 19, 2010
  • 1 reply
  • 1233 views

The Flex application that I am working on is compiled using Flex SDK 3.0.

Now I want to unit test this application using FlexUnit4.

I am not able to find FlexUnit4 for Flex SDK 3.0 in downloads page(http://www.flexunit.org/?page_id=14).

So I decided to download the FlexUnit 4 source code and compile it using Flex SDK 3.0.

I have downloaded the source code from downloads page(http://github.com/flexunit/flexunit/).

I need help in compiling the projects. I want to know what are the configuration changes that I need to do run the ant task build.xml in my local machine.

Please help me here.

This topic has been closed for replies.
Correct answer legrosb

Thanks Brian. I have another question. I found FlexUnit1Lib.swc in FlexUnit4Turnkey project. Where can I find the source for FlexUnit1Lib.swc?


@crazyghost81 - http://opensource.adobe.com/wiki/display/flexunit/Get+Source+Code

1 reply

Participating Frequently
June 19, 2010

To answer your question about building via ant here is some initial prep:

http://docs.flexunit.org/index.php?title=Ant_Task

You need ant and java setup on your machine with appropriate ANT_HOME and JAVA_HOME vars. After that, you need to specify your FLEX_HOME as your Flex 3 SDK.

Our ant tasks also uses Flex PMD and some code coverage pieces. If you want to ignore that for now, I would recommend commenting out lines 125-152 of the build.xml in the FlexUnit4 directory.

Also, you should be able to just run

ant -v clean package

within the FlexUnit 4 directory if you only need to the FlexUnit4 library, which is what it sounds like.

Cheers,

Mike

asafdsadfasddfsas
Participant
June 21, 2010

Hi Mike,

Thank you so much for your detailed reply.

"Our ant tasks also uses Flex PMD and some code coverage pieces. If you want to ignore that for now, I would recommend commenting out lines 125-152 of the build.xml in the FlexUnit4 directory."

I don't want to ignore it. Can you please help me configure this portion?

Inspiring
June 21, 2010

@crazyghost81 - If you would like to see the PMD results for FlexUnit4, the build requires that the JARs from the FlexPMD project be on the claspath for Ant.  You will need to copy the JAR contents of the FlexPMD, FlexCPD, and FlexMetrics projects into your lib directory under the path in which Ant is installed.  If all required JARs are copied correctly, then the build should work w/o error.

I'd suggest pulling down the latest source code for 4.1-beta2.  There is a new build with the code base that you can use to test stages of the build for success.  Try running each of the following calls to Ant in the root of the repo you clone from GitHub:

ant -v clean package -- Runs tests and bundles artifacts w/o reporting

ant -v -Dbuild.report=true clean package -- Runs tests and bundles artifacts with asdocs

ant -v -Dbuild.report=true -Dbuild.pmd=true clean package -- Runs tests and bundles artifacts with asdocs and PMD reporting

Good luck and let us know if you run into any barriers.

-Brian