Closed
Description
Description
If the test module has no Java SDK configured, the plugin fails when it tries to get JDK version in UtTestsDialogProcessor::createDialog
.
To Reproduce
In "Project Settings" dialogue set Project SDK as "No SDK", test module SDK as "No SDK". Try to generate tests for a class or a method.
Expected behavior
No tests are generated. Either a dialogue is open with an error message, or a stand-alone error message is displayed.
Actual behavior
A stand-alone error message is displayed (supposedly by Idea), the plugin fails with an IllegalStateException
.
Visual proofs (screenshots, logs, images)
2022-07-04 18:17:50,954 [ 25595] ERROR - llij.ide.plugins.PluginManager - Failed to obtain JDK version of the project
java.lang.IllegalStateException: Failed to obtain JDK version of the project
at org.utbot.intellij.plugin.ui.ErrorNotifier.notify(Notifications.kt:51)
at org.utbot.intellij.plugin.ui.Notifier.notify$default(Notifications.kt:29)
at org.utbot.intellij.plugin.ui.utils.ModuleUtilsKt.jdkVersionBy(ModuleUtils.kt:243)
at org.utbot.intellij.plugin.ui.utils.ModuleUtilsKt.jdkVersion(ModuleUtils.kt:43)
at org.utbot.intellij.plugin.ui.UtTestsDialogProcessor.createDialog(UtTestsDialogProcessor.kt:72)
at org.utbot.intellij.plugin.ui.UtTestsDialogProcessor.createDialogAndGenerateTests(UtTestsDialogProcessor.kt:55)
at org.utbot.intellij.plugin.ui.actions.GenerateTestsAction.actionPerformed(GenerateTestsAction.kt:29)
at com.intellij.openapi.actionSystem.ex.ActionUtil.performActionDumbAware(ActionUtil.java:282)
at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher$1.performAction(IdeKeyEventDispatcher.java:610)
at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.lambda$processAction$3(IdeKeyEventDispatcher.java:670)
at com.intellij.openapi.application.TransactionGuardImpl.performUserActivity(TransactionGuardImpl.java:94)
at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.processAction(IdeKeyEventDispatcher.java:669)
at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.processAction(IdeKeyEventDispatcher.java:620)
at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.processActionOrWaitSecondStroke(IdeKeyEventDispatcher.java:517)
at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.inInitState(IdeKeyEventDispatcher.java:471)
at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.dispatchKeyEvent(IdeKeyEventDispatcher.java:220)
at com.intellij.ide.IdeEventQueue.dispatchKeyEvent(IdeEventQueue.java:888)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:833)
at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$8(IdeEventQueue.java:450)
at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:744)
at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$9(IdeEventQueue.java:449)
at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:802)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:503)
at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
2022-07-04 18:17:50,955 [ 25596] ERROR - llij.ide.plugins.PluginManager - IntelliJ IDEA 2020.2 Build #IC-202.6397.94
2022-07-04 18:17:50,955 [ 25596] ERROR - llij.ide.plugins.PluginManager - JDK: 11.0.7; VM: OpenJDK 64-Bit Server VM; Vendor: JetBrains s.r.o.
2022-07-04 18:17:50,955 [ 25596] ERROR - llij.ide.plugins.PluginManager - OS: Windows 10
2022-07-04 18:17:50,955 [ 25596] ERROR - llij.ide.plugins.PluginManager - Plugin to blame: UnitTestBot version: 1.0-SNAPSHOT
2022-07-04 18:17:50,955 [ 25596] ERROR - llij.ide.plugins.PluginManager - Last Action: org.utbot.intellij.plugin.ui.actions.GenerateTestsAction
Environment
A Gradle project imported in Idea, configured to use no SDK.
Metadata
Metadata
Assignees
Type
Projects
Status
Done