You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With one tests with generated nullable parameters, I get a NullPointerException in jqwik when the test fails.
This is the stack trace I get on the console:
java.lang.NullPointerException
at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1655)
at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)
at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:913)
at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:578)
at net.jqwik.engine.execution.reporting.ParameterChangesDetector.atLeastOneChangedParameterHasEqualsImplementation(ParameterChangesDetector.java:19)
at net.jqwik.engine.execution.reporting.ParameterChangesDetector.haveParametersChanged(ParameterChangesDetector.java:12)
at net.jqwik.engine.execution.reporting.ExecutionResultReport.reportParameterChanges(ExecutionResultReport.java:91)
at net.jqwik.engine.execution.reporting.ExecutionResultReport.lambda$appendSamples$0(ExecutionResultReport.java:65)
at java.base/java.util.Optional.ifPresent(Optional.java:183)
at net.jqwik.engine.execution.reporting.ExecutionResultReport.appendSamples(ExecutionResultReport.java:59)
at net.jqwik.engine.execution.reporting.ExecutionResultReport.buildJqwikReport(ExecutionResultReport.java:49)
at net.jqwik.engine.execution.reporting.ExecutionResultReport.from(ExecutionResultReport.java:33)
at net.jqwik.engine.execution.PropertyMethodExecutor.reportResult(PropertyMethodExecutor.java:134)
at net.jqwik.engine.execution.PropertyMethodExecutor.executePropertyMethod(PropertyMethodExecutor.java:99)
at net.jqwik.engine.execution.PropertyMethodExecutor.execute(PropertyMethodExecutor.java:42)
at net.jqwik.engine.execution.PropertyTaskCreator.executeTestMethod(PropertyTaskCreator.java:128)
at net.jqwik.engine.execution.PropertyTaskCreator.lambda$createTask$1(PropertyTaskCreator.java:55)
at net.jqwik.engine.execution.pipeline.ExecutionTask$1.lambda$execute$0(ExecutionTask.java:31)
at net.jqwik.engine.execution.lifecycle.CurrentTestDescriptor.runWithDescriptor(CurrentTestDescriptor.java:27)
at net.jqwik.engine.execution.pipeline.ExecutionTask$1.execute(ExecutionTask.java:31)
at net.jqwik.engine.execution.pipeline.ExecutionPipeline.runToTermination(ExecutionPipeline.java:82)
at net.jqwik.engine.execution.JqwikExecutor.execute(JqwikExecutor.java:46)
at net.jqwik.engine.JqwikTestEngine.executeTests(JqwikTestEngine.java:77)
at net.jqwik.engine.JqwikTestEngine.execute(JqwikTestEngine.java:61)
But when I stop the program when the NPE happens (via exception-breakpoint in IntelliJ), I find the following:
the NPE actually happens in net.jqwik.engine.execution.reporting.ArrayReportingFormat#appliesTo because the actual argument is null
some levels up in the call hierarchy, in net.jqwik.engine.execution.reporting.SampleReporter#reportParameters, the parameterName is set, while the parameterValue is null
This is the stack trace I get with the exception breakpoint:
Interestingly, adding a @Report(Reporting.FALSIFIED) annotation to the test produces the expected output and has no problem with the (test-) parameter in question being null.
All this happens with jqwik 1.3.8 and Java 11.
Suggested Solution
We should not get a NullPointerException.
Discussion
If you need more information (like a reproducer) please let me know.
The text was updated successfully, but these errors were encountered:
Testing Problem
With one tests with generated nullable parameters, I get a NullPointerException in jqwik when the test fails.
This is the stack trace I get on the console:
But when I stop the program when the NPE happens (via exception-breakpoint in IntelliJ), I find the following:
net.jqwik.engine.execution.reporting.ArrayReportingFormat#appliesTo
because the actual argument isnull
net.jqwik.engine.execution.reporting.SampleReporter#reportParameters
, theparameterName
is set, while theparameterValue
isnull
This is the stack trace I get with the exception breakpoint:
Interestingly, adding a
@Report(Reporting.FALSIFIED)
annotation to the test produces the expected output and has no problem with the (test-) parameter in question beingnull
.All this happens with jqwik 1.3.8 and Java 11.
Suggested Solution
We should not get a
NullPointerException
.Discussion
If you need more information (like a reproducer) please let me know.
The text was updated successfully, but these errors were encountered: