Reputation: 31
Have created a unit test using EvoSuite and want to use maven build to do code coverage analysis on this unit test. When I run maven build I get ...
JMockit Coverage got reloaded through custom class loader org.evosuite.runtime.instrumentation.EvoClassLoader;
and
Class org.xyz.MyClass$1 was not instrumented by EvoSuite. This could happen if you are running JUnit tests in a way that is not handled by EvoSuite, in which some classes are loaded be reflection before the tests are run. Consult the EvoSuite documentation for possible workarounds for this issue.
So seems like code that is breaking is... if (!InstrumentedClass.class.isAssignableFrom(clazz)) { String msg = "Class " + clazz.getName() + " was not instrumented by EvoSuite. " + "This could happen if you are running JUnit tests in a way that is not handled by EvoSuite, in " + "which some classes are loaded be reflection before the tests are run. Consult the EvoSuite documentation " + "for possible workarounds for this issue."; logger.error(msg); problem = true; //throw new IllegalStateException(msg); // throwing an exception might be a bit too extreme }
Is it possible to run the EvoSuite unit test through JMockit? Any suggestions?
Upvotes: 1
Views: 446
Reputation: 970
before reading this question, I had never heard of JMockit, so it is not something that was under the radar in EvoSuite... :(
anyway, I just added now some documentation about it at:
http://www.evosuite.org/documentation/measuring-code-coverage/
you can read there why you get 0% coverage, and possible workarounds for it.
Upvotes: 0