I use JMockit 1.27 for code coverage
Java 1.8.92
TestNG 6.9.12
Guava 19.0.
private static final String URL_TO_LOGO_IMAGE = "http://test.example.com/logo.jpg";
@Test
public void testInitialization() {
List<Pair<Image.DimensionType, String>> dimensions = Lists.newArrayList();
Pair<Image.DimensionType, String> pairL = new ImmutablePair<>(DimensionType.LARGE,
URL_TO_LOGO_IMAGE);
dimensions.add(pairL);
Image image = new Image.ImageBuilder().withDimensions(dimensions).build();
assertSame(URL_TO_LOGO_IMAGE, image.getDimensionsMap().get(DimensionType.LARGE));
}
In console prints following error
Gradle suite > Gradle test > com.example.ImageTest.testInitialization FAILED
java.lang.NullPointerException
at java.util.EnumMap.(EnumMap.java:139)
at com.example.Image$ImageBuilder.withDimensions(Image.java:76)
at com.example.ImageTest.testInitialization(ImageTest.java:23)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.gradle.api.internal.tasks.testing.testng.TestNGTestClassProcessor.runTests(TestNGTestClassProcessor.java:133)
at org.gradle.api.internal.tasks.testing.testng.TestNGTestClassProcessor.stop(TestNGTestClassProcessor.java:83)
at org.gradle.api.internal.tasks.testing.SuiteTestClassProcessor.stop(SuiteTestClassProcessor.java:61)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35)
at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
at org.gradle.internal.dispatch.ContextClassLoaderDispatch.dispatch(ContextClassLoaderDispatch.java:32)
at org.gradle.internal.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:93)
at org.gradle.api.internal.tasks.testing.worker.TestWorker.stop(TestWorker.java:120)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35)
at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
at org.gradle.internal.remote.internal.hub.MessageHub$Handler.run(MessageHub.java:377)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:54)
at org.gradle.internal.concurrent.StoppableExecutorImpl$1.run(StoppableExecutorImpl.java:40)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
JMockit: Coverage report written to D:\work\Idea\myproject\build\reports\coverage
Issue is reproduced with this example project myproject.zip
Test successfully runs if extract enum as normal (not inner) java class.
Also test success when code coverage tool is off.
Thank you,
Alex
The text was updated successfully, but these errors were encountered:
I use JMockit 1.27 for code coverage
Java 1.8.92
TestNG 6.9.12
Guava 19.0.
In console prints following error
Issue is reproduced with this example project myproject.zip
Test successfully runs if extract enum as normal (not inner) java class.
Also test success when code coverage tool is off.
Thank you,
Alex
The text was updated successfully, but these errors were encountered: