Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
112 commits
Select commit Hold shift + click to select a range
9fcf5c0
UTBotFamily
denis-fokin Oct 5, 2022
eee8f85
Add CodeGenLanguage.id
tamarinvs19 Oct 5, 2022
08ccb65
Update Renderers
tamarinvs19 Oct 5, 2022
301f2d5
Move codeGenLanguage to CgRenderContext
tamarinvs19 Oct 5, 2022
ddc57d9
Add init to CodeLanguage
tamarinvs19 Oct 5, 2022
8086a63
UTBotFamily
denis-fokin Oct 5, 2022
0708155
Fix after merge bugs
tamarinvs19 Oct 5, 2022
64ade72
Fix bug with variableConstructors and remove ExecutionStateAnalyzer from
tamarinvs19 Oct 6, 2022
50c9a57
Update generated_tests__dicts
tamarinvs19 Oct 6, 2022
6a6a337
Change targetCompatibility verstion
tamarinvs19 Oct 6, 2022
9e9725c
Refactor js
tamarinvs19 Oct 6, 2022
8a53d09
Fix PycharmUltimate code and uncomment js
tamarinvs19 Oct 6, 2022
8abe0b7
Fix Windows symbols problem
tamarinvs19 Oct 6, 2022
542aeae
Disable runIde tasks in modules where we need only Idea sdk dependencies
denis-fokin Oct 6, 2022
ee45191
Merge actual UTBot Go, set up and fix its CLI
GlebSolovev Oct 4, 2022
e44813d
Improve requirements description for UTBot Go
GlebSolovev Oct 4, 2022
a3ad833
Merge UTBot Go IntelliJ plugin support
tamarinvs19 Oct 7, 2022
a7b8d25
Fix Go
tamarinvs19 Oct 7, 2022
8def007
New file chooser in Python plugin
tochilinak Oct 7, 2022
0af38e8
Fixed bug in Python cli
tochilinak Oct 7, 2022
14ff580
Refactored Slava's CodegenLanguage
zishkaz Oct 7, 2022
d8328e2
disable go runIde
Markoutte Oct 10, 2022
8a91164
Change "\\" to File.separator
tamarinvs19 Oct 10, 2022
14ccaf6
Add relation sys.path support
tamarinvs19 Oct 10, 2022
894707b
Change cli result output
tamarinvs19 Oct 10, 2022
78e8f9d
[WIP] Linux cmd possible fix
rudolf101 Oct 11, 2022
99c5d8b
[WIP] universal JsCmdExec implementation
zishkaz Oct 14, 2022
e6b0168
Moved OsProvider for a wider access scope
zishkaz Oct 14, 2022
299452d
Getting node and npm from IDEA settings
zishkaz Oct 14, 2022
ba23868
JsDynamicSettings added
zishkaz Oct 14, 2022
4b3fb14
[WIP] Added nyc path field to dialog window
rudolf101 Oct 14, 2022
079e8d0
New js coverage algo implementation
zishkaz Oct 16, 2022
319bc54
Added nyc path field into dialog window
rudolf101 Oct 17, 2022
54f079c
Update samples
tamarinvs19 Oct 17, 2022
ff1b093
Added replace separator in Nyc validation
rudolf101 Oct 18, 2022
9ed03f0
Added new options to js CLI and fixed exports managers
zishkaz Oct 18, 2022
074d0d1
Fix after rebase problems
tamarinvs19 Oct 19, 2022
b11718f
Fixed js samples and help tips in js CLI
zishkaz Oct 19, 2022
18f514f
Fixed js exports managers regexes
zishkaz Oct 19, 2022
eae8efe
Move language-specific UtModels to utbo-<lang> and remove CodegenLang…
tamarinvs19 Oct 20, 2022
d99deb9
Fix cli bug
tamarinvs19 Oct 20, 2022
e74317f
Simle style fix
tamarinvs19 Oct 20, 2022
3887c93
Moved test directory chooser to ui-commons and fixed graal error
zishkaz Oct 20, 2022
1247455
Removing go from pr branch
zishkaz Oct 24, 2022
037098f
Added gitignore file for js samples
zishkaz Oct 24, 2022
97f4d6a
Fix changes
tamarinvs19 Oct 24, 2022
7688990
Fix testClassName bug
tamarinvs19 Oct 25, 2022
29180b9
Rebase FileUtil.kt onto main
tamarinvs19 Oct 26, 2022
3129d70
Rebase files onto main
tamarinvs19 Oct 26, 2022
0152df5
Remove internal UtilMethodProvider
tamarinvs19 Oct 26, 2022
84ec8fc
Rebase onto main
tamarinvs19 Oct 26, 2022
b24caf9
Update language settings
tamarinvs19 Oct 26, 2022
fc52711
Merge branch 'main' into tamarinvs19/UnitTestBot_Family_PR
tamarinvs19 Oct 26, 2022
52085ec
Update gradle files
tamarinvs19 Oct 26, 2022
eba7d57
Fix js npm path and nyc validator for linux
tamarinvs19 Oct 26, 2022
be1adc7
Add conditions for ideType
tamarinvs19 Oct 26, 2022
f997039
Merge branch 'main' into tamarinvs19/UnitTestBot_Family_PR
tamarinvs19 Oct 26, 2022
9e0b25a
Update ide settings
tamarinvs19 Oct 26, 2022
83a9dcd
Add docs page about IDE
tamarinvs19 Oct 26, 2022
fcca3bf
Add docs link
tamarinvs19 Oct 26, 2022
f21a1cb
Fix Coverage error
tamarinvs19 Oct 26, 2022
2d7d817
Merge branch 'main' into tamarinvs19/UnitTestBot_Family_PR
tamarinvs19 Oct 26, 2022
05af2c5
Rebase onto main
tamarinvs19 Oct 26, 2022
68c5d7d
Merge branch 'main' into tamarinvs19/UnitTestBot_Family_PR
tamarinvs19 Oct 26, 2022
92f6f72
Rebase onto main
tamarinvs19 Oct 26, 2022
55c278b
Merge branch 'main' into tamarinvs19/UnitTestBot_Family_PR
tamarinvs19 Oct 27, 2022
1f1b016
Rebase onto main
tamarinvs19 Oct 27, 2022
1d5b379
Make GgGetClass sealed
tamarinvs19 Oct 27, 2022
3d98f82
Fix deprecated showYesNoDialog and ProjectFileIndex.SERVICE
tamarinvs19 Oct 27, 2022
dc242fe
Change IU to IC
tamarinvs19 Oct 27, 2022
bdd4442
Remove open from ClassId.elementClassId
tamarinvs19 Oct 27, 2022
c7b69a1
Code style refactoring
tamarinvs19 Oct 27, 2022
4432359
Add file with changes description
tamarinvs19 Oct 27, 2022
284928b
Update gitignores
tamarinvs19 Oct 27, 2022
7ee92d1
Remove com.jetbrains.intellij.idea:ideaIC dependency
tamarinvs19 Oct 27, 2022
67b9fe0
Change IU to IC
tamarinvs19 Oct 27, 2022
6d9522a
Added coverage mode buttons | JS
rudolf101 Oct 27, 2022
54faab1
Update CLI docs
rudolf101 Oct 28, 2022
5a50a55
Fixed JS basic coverage service algo
zishkaz Oct 28, 2022
60e96e9
Fixes JsConstantsModelProvider after master merge
zishkaz Oct 28, 2022
972607e
Removed unnecessary check for Mocha framework that failed in built pl…
zishkaz Oct 28, 2022
05d7b4e
Removed lateinit modifier
zishkaz Oct 28, 2022
f578890
Removed export statements from js samples
zishkaz Oct 28, 2022
f8f064a
Merge branch 'tamarinvs19/UnitTestBot_Family_PR' of https://github.co…
zishkaz Oct 28, 2022
aa4c1a8
Fix in Python CLI
tochilinak Oct 28, 2022
3409678
JS cli naming fix
zishkaz Oct 31, 2022
289b6b9
Rename python cli class
tamarinvs19 Oct 31, 2022
5f205e3
Move comment line in CodeGeneratorResult
tamarinvs19 Oct 31, 2022
ec8f1dd
Remove jClass from python/js branch
tamarinvs19 Oct 31, 2022
d66c1ba
Merge branch 'main' into tamarinvs19/UnitTestBot_Family_PR
tamarinvs19 Oct 31, 2022
6295f85
Reworked text annotations in Mocha object
zishkaz Oct 31, 2022
1781fa8
Merge remote-tracking branch 'origin/tamarinvs19/UnitTestBot_Family_P…
zishkaz Oct 31, 2022
d53325b
Remove soot dependency from utbot-python and implement new CgRender m…
tamarinvs19 Oct 31, 2022
18acd32
Merge remote-tracking branch 'origin/tamarinvs19/UnitTestBot_Family_P…
tamarinvs19 Oct 31, 2022
2385dc6
Used withUtContext in JsTestGenerator and reworked Mocha TestFramewor…
zishkaz Oct 31, 2022
20e416a
Locally fixed explicit File.separator replacements
zishkaz Oct 31, 2022
6dff767
Removed unnecessary catch
rudolf101 Nov 1, 2022
766616c
Fix weak comments
rudolf101 Nov 1, 2022
58415b3
Removed unnecessary try catch
rudolf101 Nov 1, 2022
f73d3fd
Merge branch 'main' into tamarinvs19/UnitTestBot_Family_PR
tamarinvs19 Nov 2, 2022
5c9e7fb
Fix CgRenderer bugs after merge
tamarinvs19 Nov 2, 2022
a8d4d92
Merge branch 'main' into tamarinvs19/UnitTestBot_Family_PR
tamarinvs19 Nov 2, 2022
0b66cab
Add README.md to utbot-python-cli
tamarinvs19 Nov 2, 2022
7a8893c
Merge branch 'main' into tamarinvs19/UnitTestBot_Family_PR
tamarinvs19 Nov 3, 2022
98ac84a
JS code refactoring
zishkaz Nov 3, 2022
d0815c8
Merge remote-tracking branch 'origin/tamarinvs19/UnitTestBot_Family_P…
zishkaz Nov 3, 2022
7e16b66
Removed unnecessary JS file parsing
zishkaz Nov 7, 2022
dcfa7eb
Refactor utbot-intellij-python
tamarinvs19 Nov 7, 2022
a781aa9
Refactor utbot-python
tamarinvs19 Nov 7, 2022
9074ed2
Fix "Language <> is disabled" problem from Issue #1329
tamarinvs19 Nov 9, 2022
f9698b3
Merge branch 'main' into tamarinvs19/UnitTestBot_Family_PR
tamarinvs19 Nov 9, 2022
37c9564
Change GenerateTestsModel to BaseTestsModel
tamarinvs19 Nov 9, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix after rebase problems
  • Loading branch information
tamarinvs19 committed Oct 20, 2022
commit 074d0d18b904ea213c746ad1260bcd8cdc5889ce
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ allprojects {
tasks {
withType<JavaCompile> {
sourceCompatibility = "1.8"
targetCompatibility = "11"
targetCompatibility = "1.8"
options.encoding = "UTF-8"
options.compilerArgs = options.compilerArgs + "-Xlint:all"
}
Expand Down
8 changes: 5 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,19 @@ kotlin.code.style=official
# IU, IC, PC, PY, WS...
# IC for AndroidStudio
ideType=IU
Comment thread
tamarinvs19 marked this conversation as resolved.
Outdated
ideVersion=222.4167.29

# In order to run Android Studion instead of Intellij Community,
# specify the path to your Android Studio installation
//androidStudioPath=D:/AS2021

pythonCommunityPluginVersion=222.4167.37
#Version numbers: https://plugins.jetbrains.com/plugin/631-python/versions
pythonCommunityPluginVersion=222.4167.37
pythonUltimatePluginVersion=222.4167.37

# Version numbers: https://plugins.jetbrains.com/plugin/9568-go/versions
goPluginVersion=212.5712.14
goPluginVersion=222.4167.21

kotlinPluginVersion=222-1.7.20-release-201-IJ4167.29

junit5Version=5.8.0-RC1
junit4Version=4.13.2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ open class CodeGenerator(
val testClassFile = CgTestClassConstructor(context).construct(testClassModel)
CodeGeneratorResult(
generatedCode = renderClassFile(testClassFile),
testsGenerationReport = testClassFile.testsGenerationReport,
utilClassKind = UtilClassKind.fromCgContextOrNull(context)
utilClassKind = UtilClassKind.fromCgContextOrNull(context),
testsGenerationReport = testClassFile.testsGenerationReport
)
}
}
Expand Down Expand Up @@ -111,14 +111,14 @@ open class CodeGenerator(

/**
* @property generatedCode the source code of the test class
* @property utilClassKind the kind of util class if it is required, otherwise - null
* @property testsGenerationReport some info about test generation process
* @property utilClassKind the kind of util class if it is required, otherwise - null
*/
data class CodeGeneratorResult(
val generatedCode: String,
// null if no util class needed, e.g. when we are generating utils directly into test class
Comment thread
zishkaz marked this conversation as resolved.
Outdated
val utilClassKind: UtilClassKind?,
val testsGenerationReport: TestsGenerationReport
val testsGenerationReport: TestsGenerationReport,
val utilClassKind: UtilClassKind? = null,
)

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1072,7 +1072,7 @@ open class CgMethodConstructor(val context: CgContext) : CgContextOwner by conte
return ClassIdArrayInfo(classId, nestedElementClassId, dimensions)
}

protected fun assertEquality(expected: CgValue, actual: CgVariable) {
open fun assertEquality(expected: CgValue, actual: CgVariable) {
when {
expected.type.isArray -> {
// TODO: How to compare arrays of Float and Double wrappers?
Expand Down Expand Up @@ -1253,7 +1253,7 @@ open class CgMethodConstructor(val context: CgContext) : CgContextOwner by conte
}
}

protected fun createTestMethod(executableId: ExecutableId, execution: UtExecution): CgTestMethod =
open fun createTestMethod(executableId: ExecutableId, execution: UtExecution): CgTestMethod =
withTestMethodScope(execution) {
val testMethodName = nameGenerator.testMethodNameFor(executableId, execution.testMethodName)
// TODO: remove this line when SAT-1273 is completed
Expand Down Expand Up @@ -1655,7 +1655,6 @@ open class CgMethodConstructor(val context: CgContext) : CgContextOwner by conte
testSet.executions.any { it.result is UtExecutionFailure }


protected final fun testMethod(
/**
* Determines [CgTestMethodType] for current execution according to its success or failure.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ open class CgTestClassConstructor(val context: CgContext) :
}
}

open fun constructTestSet(testSet: CgMethodTestSet): List<CgRegion<CgMethod>>? {
fun constructTestSet(testSet: CgMethodTestSet): List<CgRegion<CgMethod>>? {
if (testSet.executions.isEmpty()) {
return null
}
Expand Down
6 changes: 4 additions & 2 deletions utbot-intellij-go/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ val kotlinLoggingVersion: String? by rootProject
val apacheCommonsTextVersion: String? by rootProject
val jacksonVersion: String? by rootProject
val ideType: String? by rootProject
val ideVersion: String? by rootProject
val kotlinPluginVersion: String? by rootProject
val pythonCommunityPluginVersion: String? by rootProject
val pythonUltimatePluginVersion: String? by rootProject
val goPluginVersion: String? by rootProject
Expand Down Expand Up @@ -46,7 +48,7 @@ intellij {

val jvmPlugins = listOf(
"java",
"org.jetbrains.kotlin:212-1.7.10-release-333-IJ5457.46"
"org.jetbrains.kotlin:$kotlinPluginVersion"
)

val pythonCommunityPlugins = listOf(
Expand Down Expand Up @@ -75,6 +77,6 @@ intellij {
}
)

version.set("212.5712.43")
version.set(ideVersion)
type.set(ideType)
}
6 changes: 4 additions & 2 deletions utbot-intellij-js/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ val kotlinLoggingVersion: String? by rootProject
val apacheCommonsTextVersion: String? by rootProject
val jacksonVersion: String? by rootProject
val ideType: String? by rootProject
val ideVersion: String? by rootProject
val kotlinPluginVersion: String? by rootProject
val pythonCommunityPluginVersion: String? by rootProject
val pythonUltimatePluginVersion: String? by rootProject
val goPluginVersion: String? by rootProject
Expand Down Expand Up @@ -46,7 +48,7 @@ intellij {

val jvmPlugins = listOf(
"java",
"org.jetbrains.kotlin:212-1.7.10-release-333-IJ5457.46"
"org.jetbrains.kotlin:$kotlinPluginVersion"
)

val pythonCommunityPlugins = listOf(
Expand Down Expand Up @@ -75,6 +77,6 @@ intellij {
}
)

version.set("212.5712.43")
version.set(ideVersion)
type.set(ideType)
}
6 changes: 4 additions & 2 deletions utbot-intellij-python/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ val kotlinLoggingVersion: String? by rootProject
val apacheCommonsTextVersion: String? by rootProject
val jacksonVersion: String? by rootProject
val ideType: String? by rootProject
val ideVersion: String by rootProject
val kotlinPluginVersion: String by rootProject
val pythonCommunityPluginVersion: String? by rootProject
val pythonUltimatePluginVersion: String? by rootProject
val goPluginVersion: String? by rootProject
Expand Down Expand Up @@ -46,7 +48,7 @@ intellij {

val jvmPlugins = listOf(
"java",
"org.jetbrains.kotlin:212-1.7.10-release-333-IJ5457.46"
"org.jetbrains.kotlin:222-1.7.20-release-201-IJ4167.29"
)

val pythonCommunityPlugins = listOf(
Expand Down Expand Up @@ -75,6 +77,6 @@ intellij {
}
)

version.set("212.5712.43")
version.set(ideVersion)
type.set(ideType)
}
6 changes: 4 additions & 2 deletions utbot-intellij/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ val kotlinLoggingVersion: String? by rootProject
val apacheCommonsTextVersion: String? by rootProject
val jacksonVersion: String? by rootProject
val ideType: String? by rootProject
val ideVersion: String? by rootProject
val kotlinPluginVersion: String? by rootProject
val pythonCommunityPluginVersion: String? by rootProject
val pythonUltimatePluginVersion: String? by rootProject
val sootCommitHash: String? by rootProject
Expand All @@ -24,7 +26,7 @@ intellij {

val jvmPlugins = mutableListOf(
"java",
"org.jetbrains.kotlin:222-1.7.20-release-201-IJ4167.29"
"org.jetbrains.kotlin:$kotlinPluginVersion"
)

androidStudioPath?.let { jvmPlugins += androidPlugins }
Expand Down Expand Up @@ -55,7 +57,7 @@ intellij {
}
)

version.set("222.4167.29")
version.set(ideVersion)
type.set(ideTypeOrAndroidStudio)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,22 +56,17 @@ import org.utbot.intellij.plugin.models.packageName
import org.utbot.intellij.plugin.process.EngineProcess
import org.utbot.intellij.plugin.process.RdTestGenerationResult
import org.utbot.intellij.plugin.sarif.SarifReportIdea
import org.utbot.intellij.plugin.sarif.SourceFindingStrategyIdea
import org.utbot.intellij.plugin.ui.*
import org.utbot.intellij.plugin.ui.utils.getOrCreateSarifReportsPath
import org.utbot.intellij.plugin.ui.utils.showErrorDialogLater
import org.utbot.intellij.plugin.ui.utils.suitableTestSourceRoots
import org.utbot.intellij.plugin.util.IntelliJApiHelper.Target.*
import org.utbot.intellij.plugin.util.IntelliJApiHelper.run
import org.utbot.intellij.plugin.util.RunConfigurationHelper
import org.utbot.intellij.plugin.util.extractClassMethodsIncludingNested
import org.utbot.sarif.SarifReport
import java.nio.file.Path
import java.util.concurrent.CancellationException
import java.util.concurrent.CountDownLatch
import java.util.concurrent.TimeUnit
import kotlin.reflect.KClass
import kotlin.reflect.full.functions
import org.utbot.intellij.plugin.util.IntelliJApiHelper.Target.*
import org.utbot.intellij.plugin.util.IntelliJApiHelper.run

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,6 @@ import org.utbot.intellij.plugin.process.EngineProcess
import org.utbot.intellij.plugin.process.RdTestGenerationResult
import org.utbot.intellij.plugin.settings.Settings
import org.utbot.intellij.plugin.ui.GenerateTestsDialogWindow
import org.utbot.intellij.plugin.ui.utils.isBuildWithGradle
import org.utbot.intellij.plugin.ui.utils.showErrorDialogLater
import org.utbot.intellij.plugin.ui.utils.suitableTestSourceRoots
import org.utbot.intellij.plugin.ui.utils.testModules
import org.utbot.intellij.plugin.util.*
import org.utbot.rd.terminateOnException
import java.io.File
Expand All @@ -49,6 +45,8 @@ import java.nio.file.Paths
import java.util.concurrent.TimeUnit
import kotlin.io.path.pathString
import org.utbot.framework.plugin.api.util.LockFile
import org.utbot.intellij.plugin.ui.utils.*
import org.utbot.intellij.plugin.util.IntelliJApiHelper

object UtTestsDialogProcessor {
private val logger = KotlinLogging.logger {}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package org.utbot.intellij.plugin.language

import com.intellij.lang.Language
import com.intellij.openapi.actionSystem.ActionPlaces
import com.intellij.openapi.actionSystem.AnActionEvent
import com.intellij.openapi.actionSystem.CommonDataKeys
Expand Down Expand Up @@ -33,11 +32,11 @@ object JvmLanguageAssistant : LanguageAssistant(){

override fun actionPerformed(e: AnActionEvent) {
val project = e.project ?: return
val (srcClasses, focusedMethod, extractMembersFromSrcClasses) = getPsiTargets(e) ?: return
UtTestsDialogProcessor.createDialogAndGenerateTests(project, srcClasses, extractMembersFromSrcClasses, focusedMethod)
val (srcClasses, setOfFocusedMethods, extractMembersFromSrcClasses) = getPsiTargets(e) ?: return
UtTestsDialogProcessor.createDialogAndGenerateTests(project, srcClasses, extractMembersFromSrcClasses, setOfFocusedMethods)
}

private fun getPsiTargets(e: AnActionEvent): Triple<Set<PsiClass>, MemberInfo?, Boolean>? {
private fun getPsiTargets(e: AnActionEvent): Triple<Set<PsiClass>, Set<MemberInfo>, Boolean>? {
val project = e.project ?: return null
val editor = e.getData(CommonDataKeys.EDITOR)
if (editor != null) {
Expand All @@ -62,7 +61,7 @@ object JvmLanguageAssistant : LanguageAssistant(){
return null
}

return Triple(setOf(srcClass), focusedMethod, true)
return Triple(setOf(srcClass), if (focusedMethod == null) emptySet() else setOf(focusedMethod), true)
}
} else {
// The action is being called from 'Project' tool window
Expand Down Expand Up @@ -106,7 +105,7 @@ object JvmLanguageAssistant : LanguageAssistant(){
.filter { folder -> !folder.rootType.isForTests && folder.file == commonSourceRoot}
.findAny().isPresent ) return null

return Triple(srcClasses.toSet(), selectedMethod, extractMembersFromSrcClasses)
return Triple(srcClasses.toSet(), if (selectedMethod == null) emptySet() else setOf(selectedMethod), extractMembersFromSrcClasses)
}
return null
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import org.jetbrains.kotlin.psi.KtFile
import org.utbot.framework.plugin.api.JavaDocCommentStyle
import org.utbot.framework.util.ConflictTriggers
import org.utbot.intellij.plugin.settings.Settings
import org.utbot.intellij.plugin.ui.utils.jdkVersion

class GenerateTestsModel(
project: Project,
Expand All @@ -38,24 +37,8 @@ class GenerateTestsModel(
srcClasses
) {

fun setSourceRootAndFindTestModule(newTestSourceRoot: VirtualFile?) {
requireNotNull(newTestSourceRoot)
testSourceRoot = newTestSourceRoot
var target = newTestSourceRoot
while(target != null && target is FakeVirtualFile) {
target = target.parent
}
if (target == null) {
error("Could not find module for $newTestSourceRoot")
}

testModule = ModuleUtil.findModuleForFile(target, project)
?: error("Could not find module for $newTestSourceRoot")
}
override var codegenLanguage = project.service<Settings>().codegenLanguage

// val codegenLanguage = project.service<Settings>().codegenLanguage

var testPackageName: String? = null
lateinit var testFramework: TestFramework
lateinit var mockStrategy: MockStrategyApi
lateinit var mockFramework: MockFramework
Expand All @@ -71,14 +54,6 @@ class GenerateTestsModel(

var runGeneratedTestsWithCoverage : Boolean = false
var enableSummariesGeneration : Boolean = true

val jdkVersion: JavaSdkVersion?
get() = try {
testModule.jdkVersion()
} catch (e: IllegalStateException) {
// Just ignore it here, notification will be shown in org.utbot.intellij.plugin.ui.utils.ModuleUtilsKt.jdkVersionBy
null
}
}

val PsiClass.packageName: String
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import com.intellij.psi.PsiClass
import com.intellij.openapi.progress.ProgressIndicator
import org.utbot.common.PathUtil.classFqnToPath
import org.utbot.intellij.plugin.ui.utils.getOrCreateSarifReportsPath
import com.intellij.openapi.vfs.VfsUtil
import java.util.concurrent.CountDownLatch
import mu.KotlinLogging
import org.utbot.framework.plugin.api.ClassId
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import com.intellij.openapi.roots.ProjectRootManager
import org.utbot.framework.plugin.services.JdkInfo
import org.utbot.framework.plugin.services.JdkInfoDefaultProvider
import org.utbot.framework.plugin.services.fetchJavaVersion
import org.utbot.intellij.plugin.util.IntelliJApiHelper

class PluginJdkInfoProvider(
private val project: Project
Expand Down
Loading