Skip to main content
Participating Frequently
Oct 19, 2010 6:42 PM UTC
Question

flexunit running swf from ant in browser error

I am folloing this post: http://forums.adobe.com/thread/633277?decorator=print&displayFullThread=true

and have the same need.  I would like to have ant pull up a browser and run the unit tests.

I am running

-flex 3.5

-flexunit: 4.1.0-RC1.27

<target name="run-flex-unit">

  <flexunit

      player="flash"

      workingDir=${dist.dir}

      toDir="${dist.dir}/reports"

      haltonfailure="false"

      verbose="true"

      localTrusted="true"

      swf="https://localhost:port/path/FlexUnitApplication.swf"

      command="C:\Program Files\Mozilla Firefox\firefox.exe">

   </flexunit>

</target>

When I run flexunit in ant during the "Validating task attributes..." phase it I get the following error:

"The provided 'swf' property value could not be found.

Based on the write up here: http://docs.flexunit.org/index.php?title=Ant_Task#Setup_your_environment  I think I have things set up correctly, but flexunit still doesn't seem to like the swf url vs a file location.  This thread seemed to suggest it was fixed in flexunit 4.1?

http://forums.adobe.com/thread/633277?decorator=print&displayFullThread=true

Any insight on this?

This topic is closed to new replies. Start a new post to keep the conversation going.

9 replies

Inspiring
Oct 19, 2010 7:20 PM UTC

@delaliD - Doh, no JIRA issue was ever created for this feature request, so it didn't make it into 4.1.  I'll have to look into how difficult this would be to support and talk to the team about putting it into RC2.  I'll let you know what I can find out.

-Brian

Translate
delaliDAuthor
Participating Frequently
Oct 19, 2010 7:26 PM UTC

Brian,

DOH!

Please keep me posted, we really need this feature.

Thanks!

Translate
delaliDAuthor
Participating Frequently
Oct 20, 2010 2:26 PM UTC

Brian,

In org.flexunit.ant.tasks.configuration.TaskConfiguration

Lines 123-126:

public void setSwf(String swf)
{
   testRunConfiguration.setSwf(project.resolveFile(swf));
}

Perhaps a check to see if the swf is a URL before calling project.resolveFile on it?

Since I have the command property set, the browser should try to open the url when loaded. No?

Translate