【问题标题】:How to config Flex Mojos Unit test by maven如何通过 maven 配置 Flex Mojos 单元测试
【发布时间】:2012-12-13 22:33:33
【问题描述】:

像 java 我想在 maven flex mojo 中执行单元测试。但无法执行单元测试。这是供您观察的 pom 文件。

<?xml version="1.0" encoding="UTF-8"?>
<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>com.formativesoft.flex</groupId>
  <artifactId>rdpair</artifactId>
  <version>1.0.1</version>
  <packaging>swf</packaging>

  <name>rdpair Flex</name>  
  <dependencies>
    <dependency>
      <groupId>com.adobe.flex.framework</groupId>
      <artifactId>flex-framework</artifactId>
      <version>4.5.1.21328</version>
      <type>pom</type>
    </dependency>

    <dependency>
      <groupId>com.adobe.flexunit</groupId>
      <artifactId>flexunit</artifactId>
      <version>0.85</version>
      <type>swc</type>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <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-RC2</version>
        <extensions>true</extensions>
      </plugin>
    </plugins>
  </build>
</project>

执行 maven 单元测试时缺少哪些属性/插件/依赖项?

【问题讨论】:

    标签: maven maven-2 flex4.5 maven-plugin pom.xml


    【解决方案1】:

    您应该声明哪些文件包含测试:

    <includeTestFiles>
        <includeTestFile>*Test.as</includeTestFile>
    </includeTestFiles>
    

    同时指定 Flash 播放器的路径(在你的 settings.xml 中移动)

    <properties>
        <flex.flashplayer.url>C:\Program Files (x86)\Adobe\Adobe Flash Builder 4.6\player\win\11.1\FlashPlayerDebugger.exe</flex.flashplayer.url>
    </properties>
    

    【讨论】:

      猜你喜欢
      • 2010-11-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-09-14
      • 1970-01-01
      • 2012-05-05
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多