我嘗試使用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版本? –