我尝试使用maven或Junit从命令行运行单个测试方法。我的项目使用Maven构建在Junit Framework中。使用Maven和Jnunit从命令行运行单一方法
我并行执行并行运行方法。当我尝试从命令行运行它时,它仍然并行运行所有testmenthds。
mvn -Dtest=<Classname>#<testmethodname> test
有没有人会帮助,如何达到从命令行运行单个测试方法或特定的测试方法。
版本: 的JUnit - 4.9 Maven的编译器插件 - 2.5.1 Maven的万无一失,插件 - 2.8
这是日志做参考
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building <ProjectName> 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO]
[INFO] --- maven-compiler-plugin:2.5.1:compile (default-compile) @ ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory
[INFO]
[INFO] --- maven-compiler-plugin:2.5.1:testCompile (default-testCompile) @ ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-surefire-plugin:2.8:test (default-test) @ ---
[INFO] Surefire report directory: C:\Automation\......\target\surefire-reports
-------------------------------------------------------
T E S T S
-------------------------------------------------------
Concurrency config is parallel='methods', perCoreThreadCount=false, threadCount=6, useUnlimitedThreads=false
Destroying 1 processes
Destroying process..
Destroyed 1 processes
Terminate batch job (Y/N)?
你使用哪种JUnit版本? –