Cheesy Title

May 29th, 2008 by justin

Generating FlexUnit Test Reports with Flex Mojos

The flex-mojos project supports unit testing of Flex code, but it doesn’t use Maven’s default surefire plugin for running tests. As a result, you need to make a slight tweak to your pom.xml file:

<reporting>
  <plugins>
    <plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-surefire-report-plugin</artifactId>
      <configuration>
        <reportsDirectory>${project.build.directory}/test-reports</reportsDirectory>
      </configuration>
  </plugin>
  </plugins>
</reporting>

Here’s some sample output:

UPDATE – With the Flex Mojos 1.0 release, the output directory for FlexUnit tests has changed. It’s now surefire-reports, so you can simply include the surefire-report plugin in your pom.xml file without any configuration:

<reporting>
  <plugins>
    <plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-surefire-report-plugin</artifactId>
  </plugin>
  </plugins>
</reporting>
  • dialloma

    Hello Justin,
    I always have a problem with the test-report. I have added the section of your blog to my pom, but there are anythink about test-report in my generated site. Can you help me please. I think I sended you my project in a zip file. Please can you help me.

    Thank you
    dialloma

  • justinedelson

    Dialloma-
    Sorry I haven't had a chance to look at your project - it's been a crazy week or so. I'll try to take a look by the end of the week.

    Justin

blog comments powered by Disqus