我遇到了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();
}
答案 0 :(得分:0)
您可能必须在testng ant任务中使用'objectFactory'属性,例如objectFactory="org.powermock.modules.testng.PowerMockObjectFactory"
。有关详细信息,请参阅https://groups.google.com/forum/#!topic/testng-dev/h68SIRxbeNI。希望有帮助吗?