【发布时间】:2018-09-10 18:22:38
【问题描述】:
我在 Eclipse 中创建了一个新的 Maven 项目。当我尝试运行使用 Test 注释的任何方法时,其中的内容不会被执行。我检查了所有构建路径等,但没有发现任何问题。我删除并重新创建了项目。关闭并重新打开 Eclipse。下面是代码和控制台日志。控制台日志中也没有错误。如果需要任何其他信息,请告诉我
不知道我做错了什么,但几个小时前它工作正常
注意:我正在使用 TestNG 运行测试
代码:
package testPackage;
import org.testng.annotations.Test;
public class testClass {
@Test
public void testMethod() {
System.out.println("test");
}
}
控制台日志:
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building framework 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ framework ---
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ framework ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ framework ---
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ framework ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ framework ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.218 s
[INFO] Finished at: 2018-04-01T13:01:26+05:30
[INFO] Final Memory: 7M/19M
[INFO] ------------------------------------------------------------------------
【问题讨论】: