Closed as not planned
Closed as not planned
Description
Description
IllegalArgumentException is thrown by Concrete Executor.
BaseStreamExample$CustomCollection is being tried to instantiate by call of constructor with null argument.
Though constructor's argument is annotated as NotNull.
To Reproduce
- Run the 'UTBotJava' project in IntelliJ Idea 2022.1.4
- Install one of the latest from main branch
- Set logConcreteExecutionErrors=true
- Open test generation dialog for utbot-sample/src/main/java/org/utbot/examples/stream/BaseStreamExample.java
- Select CustomCollection class
- click Generate and Run
- wait tests to be generated
- open Concrete execution logs
Expected behavior
There should be no exceptions in Concrete executions.
Actual behavior
There is the following exception in log:
ERROR| java.lang.reflect.InvocationTargetException
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
at org.utbot.framework.concrete.MockValueConstructor$call$2.invoke(MockValueConstructor.kt:483)
at org.utbot.framework.concrete.MockValueConstructor$call$2.invoke(MockValueConstructor.kt:482)
at org.utbot.instrumentation.process.SecurityKt$runSandbox$1$1.invoke(Security.kt:38)
at org.utbot.instrumentation.process.SecurityKt$sandbox$1.invoke(Security.kt:61)
at org.utbot.instrumentation.process.SecurityKt$sandbox$2.invoke(Security.kt:77)
at org.utbot.instrumentation.process.SecurityKt$sandbox$3.invoke(Security.kt:82)
at org.utbot.instrumentation.process.SecurityKt$sandbox$4.run(Security.kt:88)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at org.utbot.instrumentation.process.SecurityKt.sandbox(Security.kt:88)
at org.utbot.instrumentation.process.SecurityKt.sandbox(Security.kt:82)
at org.utbot.instrumentation.process.SecurityKt.sandbox(Security.kt:77)
at org.utbot.instrumentation.process.SecurityKt.sandbox(Security.kt:61)
at org.utbot.instrumentation.process.SecurityKt.runSandbox(Security.kt:38)
at org.utbot.framework.concrete.MockValueConstructor.call(MockValueConstructor.kt:482)
at org.utbot.framework.concrete.MockValueConstructor.updateWithExecutableCallModel(MockValueConstructor.kt:421)
at org.utbot.framework.concrete.MockValueConstructor.constructFromAssembleModel(MockValueConstructor.kt:362)
at org.utbot.framework.concrete.MockValueConstructor.construct(MockValueConstructor.kt:132)
at org.utbot.framework.concrete.MockValueConstructor.constructMethodParameters(MockValueConstructor.kt:107)
at org.utbot.framework.concrete.UtExecutionInstrumentation.invoke(UtExecutionInstrumentation.kt:156)
at org.utbot.framework.concrete.UtExecutionInstrumentation.invoke(UtExecutionInstrumentation.kt:118)
at org.utbot.instrumentation.process.ChildProcessKt$setup$2.invoke(ChildProcess.kt:211)
at org.utbot.instrumentation.process.ChildProcessKt$setup$2.invoke(ChildProcess.kt:208)
at org.utbot.instrumentation.process.ChildProcessKt$measureExecutionForTermination$2$1$1.invoke(ChildProcess.kt:190)
at org.utbot.instrumentation.process.ChildProcessKt$measureExecutionForTermination$1.invokeSuspend(ChildProcess.kt:174)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
at kotlinx.coroutines.EventLoopImplBase.processNextEvent(EventLoop.common.kt:284)
at kotlinx.coroutines.BlockingCoroutine.joinBlocking(Builders.kt:85)
at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking(Builders.kt:59)
at kotlinx.coroutines.BuildersKt.runBlocking(Unknown Source)
at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking$default(Builders.kt:38)
at kotlinx.coroutines.BuildersKt.runBlocking$default(Unknown Source)
at org.utbot.instrumentation.process.ChildProcessKt.measureExecutionForTermination(ChildProcess.kt:171)
at org.utbot.instrumentation.process.ChildProcessKt.access$measureExecutionForTermination(ChildProcess.kt:1)
at org.utbot.instrumentation.process.ChildProcessKt$measureExecutionForTermination$2$1.invokeSuspend(ChildProcess.kt:188)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
at kotlinx.coroutines.EventLoopImplBase.processNextEvent(EventLoop.common.kt:284)
at kotlinx.coroutines.BlockingCoroutine.joinBlocking(Builders.kt:85)
at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking(Builders.kt:59)
at kotlinx.coroutines.BuildersKt.runBlocking(Unknown Source)
at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking$default(Builders.kt:38)
at kotlinx.coroutines.BuildersKt.runBlocking$default(Unknown Source)
at org.utbot.instrumentation.process.ChildProcessKt$measureExecutionForTermination$2.invoke(ChildProcess.kt:187)
at com.jetbrains.rd.framework.IRdEndpoint$set$1.invoke(TaskInterfaces.kt:182)
at com.jetbrains.rd.framework.IRdEndpoint$set$1.invoke(TaskInterfaces.kt:182)
at com.jetbrains.rd.framework.impl.RdCall.onWireReceived(RdTask.kt:360)
at com.jetbrains.rd.framework.MessageBroker$invoke$2$2.invoke(MessageBroker.kt:57)
at com.jetbrains.rd.framework.MessageBroker$invoke$2$2.invoke(MessageBroker.kt:56)
at com.jetbrains.rd.framework.impl.ProtocolContexts.readMessageContextAndInvoke(ProtocolContexts.kt:148)
at com.jetbrains.rd.framework.MessageBroker$invoke$2.invoke(MessageBroker.kt:56)
at com.jetbrains.rd.framework.MessageBroker$invoke$2.invoke(MessageBroker.kt:54)
at com.jetbrains.rd.util.threading.SingleThreadSchedulerBase.queue$lambda-3(SingleThreadScheduler.kt:41)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: java.lang.IllegalArgumentException: Argument for @NotNull parameter 'data' of org/utbot/examples/stream/BaseStreamExample$CustomCollection.<init> must not be null
at org.utbot.examples.stream.BaseStreamExample$CustomCollection.$$$reportNull$$$0(BaseStreamExample.java)
at org.utbot.examples.stream.BaseStreamExample$CustomCollection.<init>(BaseStreamExample.java)
... 60 more
Visual proofs (screenshots, logs, images)
Example:
public void testFail_errors() {
// Couldn't generate some tests. List of errors:
//
// 684 occurrences of:
// Concrete execution failed
}
Environment
Windows 10 Pro
Gradle
JDK 11
Additional context
Besides there is the following test in generated class: it gets finalCustomCollectionData but doesn't check it.
public void testClear() throws ClassNotFoundException, IllegalAccessException, NoSuchFieldException {
Object[] objectArray = {null};
CustomCollection customCollection = new CustomCollection(objectArray);
customCollection.clear();
Object finalCustomCollectionData = getFieldValue(customCollection, "org.utbot.examples.stream.BaseStreamExample$CustomCollection", "data");
}
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Done