开发者

Flexmojos coverage example

Flexmojos currently freezes when I try to run a coverage report.

I've tried building the project as given in this post.

I've tried building the project with multiple versions of the flexmojos 4.0 beta. Using both the provided examples and my own attempts.

My current pom.xml file looks like this.

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>info.rvin.itest</groupId>
    <artifactId>flexunit4</artifactId>
    <version>1.0-SNAPSHOT</version>

    <packaging>swc</packaging>

    <build>
        <sourceDirectory>src/main/flex</sourceDirectory>
        <testSourceDirectory>src/test/flex</testSourceDirectory>
        <plugins>
            <plugin>
                <groupId>org.sonatype.flexmojos</groupId>
                <artifactId>flexmojos-maven-plugin</artifactId>
                <version>4.0-beta-7</version>
                <extensions>true</extensions>
                <configuration>
<!--                    <coverage>true</coverage>-->
                    <locales>
                        <locale>en_US</locale>
                    </locales>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <dependencies>
        <dependency>
            <groupId>com.adobe.flex.framework</groupId>
            <artifactId>flex-framework</artifactId>
            <version>4.5.0.19786</version>
            <type>pom</type>
        </dependency>

        <dependency>
            <groupId>com.adobe.flexunit</groupId>
            <artifactId>flexunit</artifactId>
            <version>4.0.0</version>
            <type>swc</type>
        </dependency>
        <dependency>
            <groupId>com.adobe.flexunit</groupId>
            <artifactId>flexunit-uilistener</artifactId>
            <version>4.0.0</version>
            <type>swc</type>
        </dependency>
    </dependencies>

</project>

This just doesn't work when the coverage line is uncommented. The following is the console output.

[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building calculator-api 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-clean-plugin:2.4.1:clean (default-clean) @ calculator-api ---
[INFO] Deleting C:\dev\workspace\flexmojos\Flexmojos-flexmojos-e78b1b1\flexmojos-touchstone\coverage\target
[INFO] 
[INFO] --- maven-resources-plugin:2.5:resources (default-resources) @ calculator-api ---
[debug] execute contextualize
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory C:\dev\workspace\flexmojos\Flexmojos-flexmojos-e78b1b1\flexmojos-touchstone\coverage\src\main\resources
[INFO] 
[INFO] --- flexmojos-maven-plugin:4.0-beta-7:compile-swc (default-compile-swc) @ calculator-api ---
[INFO] Flexmojos 4.0-beta-7
[INFO]   Apache License - Version 2.0 (NO WARRANTY) - See COPYRIGHT file
[WARNING] No themes are explicitly defined in the <theme> section or in any scope="theme" dependencies. Flexmojos is now attempting to figure out which themes to include. (to avoid this warning you should explicitly state your theme dependencies)
[WARNING] Added the spark.css theme because spark.swc was included as a dependency
[WARNING] Added the halo.swc theme because mx.swc was included as a dependency
[INFO] Writing configuration dump to C:\dev\workspace\flexmojos\Flexmojos-flexmojos-e78b1b1\flexmojos-touchstone\coverage\target\calculator-api-1.0-SNAPSHOT-configs.xml
[INFO] C:\dev\workspace\flexmojos\Flexmojos-flexmojos-e78b1b1\flexmojos-touchstone\coverage\target\calculator-api-1.0-SNAPSHOT.swc (1891 bytes)
[INFO] 
[INFO] --- maven-resources-plugin:2.5:testResources (default-testResources) @ calculator-api ---
[debug] execute contextualize
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory C:\dev\workspace\flexmojos\Flexmojos-flexmojos-e78b1b1\flexmojos-touchstone\coverage\src\test\resources
[INFO] 
[INFO] --- flexmojos-maven-plugin:4.0-beta-7:test-compile (default-test-compile) @ calculator-api ---
[INFO] Flexmojos 4.0-beta-7
[INFO]   Apache License - Version 2.0 (NO WARRANTY) - See COPYRIGHT file
[INFO] Compiling test class: [com.adobe.example.TestCalculator, com.adobe.example.TestCalculator2]
[WARNING] No themes are explicitly defined in the <theme> section or in any scope="theme" dependencies. Flexmojos is now attempting to figure out which themes to include. (to avoid this warning you should explicitly state your theme dependencies)
[WARNING] Added the spark.css theme because spark.swc was included as a dependency
[WARNING] Added the halo.swc theme because mx.swc was included as a dependency
[INFO] Writing configuration dump to C:\dev\workspace\flexmojos\Flexmojos-flexmojos-e78b1b1\flexmojos-touc开发者_C百科hstone\coverage\target\test-classes\TestRunner-configs.xml
[INFO] C:\dev\workspace\flexmojos\Flexmojos-flexmojos-e78b1b1\flexmojos-touchstone\coverage\target\test-classes\TestRunner.swf (810352 bytes)
[INFO] 
[INFO] --- flexmojos-maven-plugin:4.0-beta-7:test-run (default-test-run) @ calculator-api ---
[INFO] Flexmojos 4.0-beta-7
[INFO]   Apache License - Version 2.0 (NO WARRANTY) - See COPYRIGHT file
[INFO] Instrumenting: C:\dev\workspace\flexmojos\Flexmojos-flexmojos-e78b1b1\flexmojos-touchstone\coverage\target\test-classes\TestRunner.swf
Terminate batch job (Y/N)? 

It always hangs on the last line.

Is there any known working examples of flexmojos using a coverage report?

Note The repository has moved to github so the direct link in the article don't work correctly. The repository is named flexmojos/flexmojos.

Other people have the same problem.


UPDATE: Velo just released 4.0-RC1 - coverage works out of the box. See the below for reference only - upgrade to 4.0-RC1 to avoid any hacks.

In 4.0-beta-7, coverage used apparat v1.0.RC7 and coverage was broken - hanging forever.

Velo upped the dependency on Apparat to version 1.0-RC9 (from 1.0.RC7) and everything seems to work. To try this in your version you can do the following:

Edit the flexmojos-parent.pom (from org.sonatype.flexmojos.flexmojos-parent in your .m2 repo) and switch the version of Appart you see in there.

Of course, this isn't a real solution - you're just doing a workaround until the next version of Flexmojos is released. ( https://groups.google.com/d/topic/flex-mojos/hYo91mjazv0/overview )

The only other option in the meantime is to grab the latest FM source from GIT and do your own release build of Flexmojos from source (which takes a fair bit of work). Best resource I've seen on this is:

http://dev.c-ware.de/confluence/display/PUBLIC/Building+Flexmojos+4+from+Source+%28GIT%29

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜