Skip to main content
Participating Frequently
October 19, 2010
Question

flexunit running swf from ant in browser error

  • October 19, 2010
  • 1 reply
  • 2681 views

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 has been closed for replies.

1 reply

Inspiring
October 19, 2010

@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

delaliDAuthor
Participating Frequently
October 19, 2010

Brian,

DOH!

Please keep me posted, we really need this feature.

Thanks!

delaliDAuthor
Participating Frequently
October 20, 2010

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?