我的 pom.xml 如下所示:
<?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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.demo.DemoTestSteps</groupId>
<artifactId>DemoTestSteps</artifactId>
<version>1.0-SNAPSHOT</version>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.0</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.11</version>
<configuration>
<includes>
<include>**/*.java</include>
</includes>
<systemPropertyVariables>
<propertyName>concordion.output.dir</propertyName>
<buildDirectory>target/concordion</buildDirectory>
</systemPropertyVariables>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.concordion</groupId>
<artifactId>concordion</artifactId>
<version>1.4.3</version>
<scope>test</scope>
</dependency>
</dependencies>
这是我的测试课:
package application;
import org.concordion.integration.junit3.ConcordionTestCase;
public class Application extends ConcordionTestCase {
public void runTest() {
}
}
因此,当我使用 运行测试时mvn clean test
,将执行测试。但是,如果我稍微修改一下测试类,使其使用juni4,则运行前面的命令不会执行任何操作。
package application;
import org.concordion.integration.junit4.ConcordionRunner;
@RunWith(ConcordionRunner.class)
public class Application {
public void runTest() {
}
}
-------------------------------------------------------
T E S T S
-------------------------------------------------------
Running TestSuite
Tests run: 0, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.412 sec
Results :
Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5 seconds
[INFO] Finished at: Fri Feb 01 16:58:18 EET 2013
[INFO] Final Memory: 26M/62M
[INFO] ------------------------------------------------------------------------
有谁知道如何克服这个问题?