我在TestNG上有一个问题。当我在Eclipse中运行测试时一切正常,但当我在ANT中运行测试时,我得到错误:
TEST-RUN:
[testng] [TestNG] [Error]
[testng] Error creating object factory: class SomeClassTest
[testng] The tests failed.
在测试中我使用:
@ObjectFactory
public IObjectFactory getObjectFactory() {
return new PowerMockObjectFactory();
}
您可能必须在测试任务中使用'objectFactory'属性,类似于objectFactory="org.powermock.modules.testng.PowerMockObjectFactory"
。见https://groups.google.com/forum/# !topic/testng-dev/h68SIRxbeNI获取更多信息。希望这对你有帮助?