New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Class Mocking with OSGi does not work. #190
Comments
Jungster124
added a commit
to Jungster124/easymock
that referenced
this issue
Jan 4, 2017
The Callback of mocks has to be explicit if the mocked class is located in an other bundle. The callback, registered at the Enhancer seems to be useless in this case.
Jungster124
added a commit
to Jungster124/easymock
that referenced
this issue
Jan 25, 2017
The Callback of mocks has to be explicit if the mocked class is located in an other bundle. The callback, registered at the Enhancer seems to be useless in this case.
Jungster124
added a commit
to Jungster124/easymock
that referenced
this issue
Jan 25, 2017
The Callback of mocks has to be explicit if the mocked class is located in an other bundle. The callback, registered at the Enhancer seems to be useless in this case.
I still see the same exception though I am on version 3.5
? |
@vijayparashar12 This is not exactly the same error. In your case I would guess you passed |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Mocking a class (not interface) from another Bundle leads to errors
See stacktrace (NullPointerException occured after EasyMock.reset())and repro.zip for two eclipse bundles for reproduction:
java.lang.NullPointerException
at org.easymock.internal.ClassProxyFactory$MockMethodInterceptor.access$000(ClassProxyFactory.java:42)
at org.easymock.internal.ClassProxyFactory.getInvocationHandler(ClassProxyFactory.java:277)
at org.easymock.internal.MocksControl.getControl(MocksControl.java:156)
at org.easymock.EasyMock.getControl(EasyMock.java:2037)
at org.easymock.EasyMock.reset(EasyMock.java:1952)
at dummy.test.Class1.testBlubb(BockwurstTest.java:19)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at junit.framework.TestCase.runTest(TestCase.java:176)
at junit.framework.TestCase.runBare(TestCase.java:141)
at junit.framework.TestResult$1.protect(TestResult.java:122)
at junit.framework.TestResult.runProtected(TestResult.java:142)
at junit.framework.TestResult.run(TestResult.java:125)
at junit.framework.TestCase.run(TestCase.java:129)
at junit.framework.TestSuite.runTest(TestSuite.java:252)
at junit.framework.TestSuite.run(TestSuite.java:247)
at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:86)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:678)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
at org.eclipse.pde.internal.junit.runtime.RemotePluginTestRunner.main(RemotePluginTestRunner.java:66)
at org.eclipse.pde.internal.junit.runtime.CoreTestApplication.run(CoreTestApplication.java:24)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.eclipse.equinox.internal.app.EclipseAppContainer.callMethodWithException(EclipseAppContainer.java:587)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:198)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:388)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:243)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:673)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:610)
at org.eclipse.equinox.launcher.Main.run(Main.java:1519)
at org.eclipse.equinox.launcher.Main.main(Main.java:1492)
An EasyMock.expect() on a mocked Class from another Bundle leads to an IllegalStateException
java.lang.IllegalStateException: no last call on a mock available
at org.easymock.EasyMock.getControlForLastCall(EasyMock.java:466)
at org.easymock.EasyMock.expect(EasyMock.java:444)
repro.zip
The text was updated successfully, but these errors were encountered: