我正在使用PowerMock
测试运行器来运行一个junit
测试用例。
我使用以下命令行来执行它:
java -cp .:junit-4.9b2.jar:easymock-3.0.jar:powermock-easymock-1.4.8-full.jar org.junit.runner.JUnitCore SampleTest
在这样做时,我收到了这个错误:
initializationError(SampleTest)
java.lang.NoClassDefFoundError: org/junit/internal/runners/TestClassRunner
...
我该如何修复它?
powermock-module-junit4-legacy
用于 junit4.0-4.3 和powermock-module-junit
用于 junit4.4或更新版本。请检查 此pom配置 - emrekgn