1

像 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 单元测试缺少哪些属性/插件/依赖项?

4

1 回答 1

2

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

<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>
于 2012-12-28T17:51:06.230 回答