Flexmojos覆盖范例

时间:2011-05-28 12:08:58

标签: flex code-coverage flexmojos

当我尝试运行报道时,Flexmojos会冻结。

我已尝试按照this post中的规定构建项目。

我尝试使用flexmojos 4.0 beta的多个版本构建项目。使用提供的示例和我自己的尝试。

我当前的pom.xml文件如下所示。

<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>

取消注释覆盖行时,这不起作用。以下是控制台输出。

[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-touchstone\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)? 

它总是挂在最后一行。

使用覆盖率报告是否有任何已知的flexmojos工作示例?

注意的 存储库已移至github,因此文章中的直接链接无法正常工作。存储库名为flexmojos / flexmojos。

其他人拥有same problem

1 个答案:

答案 0 :(得分:2)

更新:Velo刚刚发布4.0-RC1 - 开箱即用。请参阅以下内容仅供参考 - 升级至4.0-RC1以避免任何黑客攻击。

在4.0-beta-7中,覆盖范围使用了设备v1.0.RC7并且覆盖范围被打破 - 永远悬挂。

Velo将依赖于Apparat的版本升级到版本1.0-RC9(从1.0.RC7开始),一切似乎都有效。要在您的版本中尝试此操作,您可以执行以下操作:

  
    

编辑flexmojos-parent.pom(来自.m2 repo中的org.sonatype.flexmojos.flexmojos-parent)并切换您在那里看到的Appart版本。

  

当然,这不是一个真正的解决方案 - 您只是在下一个版本的Flexmojos发布之前进行解决。 (https://groups.google.com/d/topic/flex-mojos/hYo91mjazv0/overview

与此同时,唯一的另一个选择是从GIT获取最新的FM源代码,并从源代码中自行发布Flexmojos版本(这需要相当多的工作)。我见过的最好的资源是:

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