Issue:
I have a mock class that extends MockUp. When running tests in JMockIt 1.9, the tests fail with java.lang.VerifyError. This is through Maven on OSX.
JacksonDBCollectionMock<User, ObjectId> collection = new JacksonDBCollectionMock<>();
collection.setDBObjectItems(userList);
new DBCursorMock<>(userList);
(Note: JacksonDBCollectionMock is another mock that does not have an $init method.)
Stack trace:
testGetPasscode(net.foodjudge.apiserver.db.DeviceAtomicsTest) Time elapsed: 0.02 sec <<< ERROR!
java.lang.VerifyError
at sun.instrument.InstrumentationImpl.redefineClasses0(Native Method)
at net.foodjudge.mock.DBCursorMock.<init>(DBCursorMock.java:20)
at net.foodjudge.apiserver.db.DeviceAtomicsTest.testGetPasscode(DeviceAtomicsTest.java:127)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)
at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)
Issue: I have a mock class that extends
MockUp
. When running tests in JMockIt 1.9, the tests fail withjava.lang.VerifyError
. This is through Maven on OSX.OS name: "mac os x", version: "10.9.4", arch: "x86_64", family: "mac"
I rolled back JMockIt to 1.8 and the tests passed again. Also, tests seem to work in IntelliJ on 1.9 with standard configuration run. Code is below.
Created a mock class that mocks org.mongojack.DBCursor
Class is called in test like so:
(Note: JacksonDBCollectionMock is another mock that does not have an $init method.)
Stack trace: