Java JUnit JVM_EnqueueOperation() stubbed

495 Views Asked by At

I get this error while trying to run a JUnit Test on eclipse Oxygen Using Ibm's jdk8.

Is there any known bug in this version of jdk? How can I fix/avoid it?


Assertion failed!

2

There are 2 best solutions below

2
apangin On BEST ANSWER

Seems like the unit test uses PowerMock, which does not currently support IBM JDK.

PowerMock tries to load an agent via HotSpot Attach Mechanism, but it should use J9 attach mechanism instead.

See the following issues for details:

0
Bakri Bitar On

Worked by adding the Mocking-Library path as VM Argument to the JRE as already stated by apangin.

To do that:

WindowPreferencesJavaInstalled JREs: select JDK, edit it and add the following to Default VM Arguments:

-javaagent:<YOUR_M2_REPO_PATH>/org/jmockit/jmockit/1.9/jmockit-1.9.jar

enter image description here