我在项目中使用Arquillian进行测试。我创建了一个maven配置文件,其中包含所有Arquillian依赖项:
<profile>
<id>arquillian-jbossas-managed</id>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.jboss.arquillian</groupId>
<artifactId>arquillian-bom</artifactId>
<version>1.1.5.Final</version>
<scope>import</scope>
<type>pom</type>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.10</version>
</dependency>
<dependency>
<groupId>org.jboss.arquillian.junit</groupId>
<artifactId>arquillian-junit-container</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.spec</groupId>
<artifactId>jboss-javaee-6.0</artifactId>
<version>1.0.0.Final</version>
<type>pom</type>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.wildfly.arquillian</groupId>
<artifactId>wildfly-arquillian-container-managed</artifactId>
<version>1.0.0.Alpha2</version>
<scope>test</scope>
</dependency>
</dependencies>
</profile>
现在,我面临的问题是,当此配置文件被停用时,构建服务器仍会尝试执行通过Arquillian运行的测试,并且当然构建失败。那么,如何确保在停用Arquillian的配置文件时,测试不会被执行。
答案 0 :(得分:0)
那是因为测试是用@RunWith(arquillian.class)注释的,因此用arquillian运行,在pom文件中你可以在build部分中指定跳过阻止这个的测试:)