我在java6上运行powermock + easymock + testng。 它工作得很好,但现在我必须升级到java7。 一切都在崩溃。我该怎么做才能纠正它。
我遇到配置问题,这是由于调用EasyMock.reset(myObject)
java.lang.NullPointerException
org.easymock.internal.ClassExtensionHelper.getControl(ClassExtensionHelper.java:57)
org.easymock.EasyMock.getControl(EasyMock.java:2068)
org.easymock.EasyMock.reset(EasyMock.java:1983)
旧罐子:
bsh-2.0b4.jar easymockclassextension-2.4.jar jcommander-1.5.jar rmissl.jar
aopalliance-1.0.jar cglib-nodep-2.2.jar guice-2.0.jar objenesis-1.2.jar testng-5.14.1.jar
asm-3.0.jar cobertura.jar jakarta-oro-2.0.8.jar powermock-easymock-1.4.6-full.jar velocity-dep-1.4.jar
asm-tree-3.0.jar easymock-3.0.jar javassist-3.13.0-GA.jar reportng-1.1.2.jar
新的罐子集:
asm-3.0.jar bsh-2.0b4.jar cobertura.jar easymock-3.1.jar javassist-3.18.0-GA.jar objenesis-1.2.jar reportng-1.1.2.jar snakeyaml-1.6.jar velocity-dep-1.4.jar
asm-tree-3.0.jar cglib-nodep-2.2.2.jar CVS jakarta-oro-2.0.8.jar jcommander-1.27.jar powermock-easymock-1.5.1-full.jar rmissl.jar testng-6.8.5.jar
答案 0 :(得分:0)
您可以尝试将此代码添加到您的班级
@ObjectFactory
public IObjectFactory getObjectFactory(){
return new org.powermock.modules.testng.PowerMockObjectFactory();
}