From 0c4ec0502b2c836b54217b6afc9a49d9d447a6f6 Mon Sep 17 00:00:00 2001 From: Hello-zoka Date: Tue, 29 Oct 2024 20:05:36 +0100 Subject: [PATCH] Apply ktlint --- .../research/testspark/appstarter/TestSparkStarter.kt | 2 +- .../research/testspark/display/TestSparkDisplayManager.kt | 2 +- .../display/generatedTests/GeneratedTestsTabBuilder.kt | 4 ++-- .../display/generatedTests/TestCasePanelBuilder.kt | 6 +++--- .../jetbrains/research/testspark/tools/GenerationTool.kt | 3 ++- .../org/jetbrains/research/testspark/tools/TestProcessor.kt | 2 +- .../jetbrains/research/testspark/tools/evosuite/EvoSuite.kt | 2 +- .../org/jetbrains/research/testspark/tools/llm/Llm.kt | 2 +- 8 files changed, 12 insertions(+), 11 deletions(-) diff --git a/src/main/kotlin/org/jetbrains/research/testspark/appstarter/TestSparkStarter.kt b/src/main/kotlin/org/jetbrains/research/testspark/appstarter/TestSparkStarter.kt index 605e4255e..ff8580ade 100644 --- a/src/main/kotlin/org/jetbrains/research/testspark/appstarter/TestSparkStarter.kt +++ b/src/main/kotlin/org/jetbrains/research/testspark/appstarter/TestSparkStarter.kt @@ -274,7 +274,7 @@ class TestSparkStarter : ApplicationStarter { out, projectContext, testCompiler, - junitVersion + junitVersion, ) // Saving exception (if exists) thrown during the test execution saveException(testcaseName, targetDirectory, testExecutionError) diff --git a/src/main/kotlin/org/jetbrains/research/testspark/display/TestSparkDisplayManager.kt b/src/main/kotlin/org/jetbrains/research/testspark/display/TestSparkDisplayManager.kt index effe69441..56e368cea 100644 --- a/src/main/kotlin/org/jetbrains/research/testspark/display/TestSparkDisplayManager.kt +++ b/src/main/kotlin/org/jetbrains/research/testspark/display/TestSparkDisplayManager.kt @@ -64,7 +64,7 @@ class TestSparkDisplayManager { uiContext, coverageVisualisationTabBuilder!!, testsExecutionResultManager, - generationTool + generationTool, ) generatedTestsTabBuilder!!.show(contentManager!!, language) diff --git a/src/main/kotlin/org/jetbrains/research/testspark/display/generatedTests/GeneratedTestsTabBuilder.kt b/src/main/kotlin/org/jetbrains/research/testspark/display/generatedTests/GeneratedTestsTabBuilder.kt index fc40e0063..2f2e07a21 100644 --- a/src/main/kotlin/org/jetbrains/research/testspark/display/generatedTests/GeneratedTestsTabBuilder.kt +++ b/src/main/kotlin/org/jetbrains/research/testspark/display/generatedTests/GeneratedTestsTabBuilder.kt @@ -37,7 +37,7 @@ class GeneratedTestsTabBuilder( private val uiContext: UIContext, private val coverageVisualisationTabBuilder: CoverageVisualisationTabBuilder, private val testsExecutionResultManager: TestsExecutionResultManager, - private val generationTool: GenerationTool + private val generationTool: GenerationTool, ) { private val generatedTestsTabData: GeneratedTestsTabData = GeneratedTestsTabData() @@ -161,7 +161,7 @@ class GeneratedTestsTabBuilder( coverageVisualisationTabBuilder, generatedTestsTabData, testsExecutionResultManager, - generationTool + generationTool, ) testCasePanel.add(testCasePanelBuilder.getUpperPanel(), BorderLayout.NORTH) testCasePanel.add(testCasePanelBuilder.getMiddlePanel(), BorderLayout.CENTER) diff --git a/src/main/kotlin/org/jetbrains/research/testspark/display/generatedTests/TestCasePanelBuilder.kt b/src/main/kotlin/org/jetbrains/research/testspark/display/generatedTests/TestCasePanelBuilder.kt index 0e5d51315..99c5221c7 100644 --- a/src/main/kotlin/org/jetbrains/research/testspark/display/generatedTests/TestCasePanelBuilder.kt +++ b/src/main/kotlin/org/jetbrains/research/testspark/display/generatedTests/TestCasePanelBuilder.kt @@ -22,6 +22,7 @@ import com.intellij.util.ui.JBUI import org.jetbrains.research.testspark.bundles.llm.LLMMessagesBundle import org.jetbrains.research.testspark.bundles.plugin.PluginLabelsBundle import org.jetbrains.research.testspark.bundles.plugin.PluginMessagesBundle +import org.jetbrains.research.testspark.core.data.JUnitVersion import org.jetbrains.research.testspark.core.data.Report import org.jetbrains.research.testspark.core.data.TestCase import org.jetbrains.research.testspark.core.generation.llm.getClassWithTestCaseName @@ -42,6 +43,7 @@ import org.jetbrains.research.testspark.helpers.LLMHelper import org.jetbrains.research.testspark.services.LLMSettingsService import org.jetbrains.research.testspark.settings.llm.LLMSettingsState import org.jetbrains.research.testspark.testmanager.TestAnalyzerFactory +import org.jetbrains.research.testspark.tools.GenerationTool import org.jetbrains.research.testspark.tools.TestProcessor import org.jetbrains.research.testspark.tools.TestsExecutionResultManager import org.jetbrains.research.testspark.tools.ToolUtils @@ -64,8 +66,6 @@ import javax.swing.ScrollPaneConstants import javax.swing.SwingUtilities import javax.swing.border.Border import javax.swing.border.MatteBorder -import org.jetbrains.research.testspark.core.data.JUnitVersion -import org.jetbrains.research.testspark.tools.GenerationTool class TestCasePanelBuilder( private val project: Project, @@ -574,7 +574,7 @@ class TestCasePanelBuilder( uiContext.projectContext, testCompiler, testsExecutionResultManager, - junitVersion + junitVersion, ) testCase.coveredLines = newTestCase.coveredLines diff --git a/src/main/kotlin/org/jetbrains/research/testspark/tools/GenerationTool.kt b/src/main/kotlin/org/jetbrains/research/testspark/tools/GenerationTool.kt index 77bf4c244..38dcceb68 100644 --- a/src/main/kotlin/org/jetbrains/research/testspark/tools/GenerationTool.kt +++ b/src/main/kotlin/org/jetbrains/research/testspark/tools/GenerationTool.kt @@ -5,7 +5,8 @@ package org.jetbrains.research.testspark.tools */ enum class GenerationTool(val toolId: String) { EvoSuite("EvoSuite"), - LLM("LLM"); + LLM("LLM"), + ; companion object { fun from(findValue: String): GenerationTool = entries.first { it.toolId == findValue } diff --git a/src/main/kotlin/org/jetbrains/research/testspark/tools/TestProcessor.kt b/src/main/kotlin/org/jetbrains/research/testspark/tools/TestProcessor.kt index 64af36b7e..b2bdb3bbd 100644 --- a/src/main/kotlin/org/jetbrains/research/testspark/tools/TestProcessor.kt +++ b/src/main/kotlin/org/jetbrains/research/testspark/tools/TestProcessor.kt @@ -157,7 +157,7 @@ class TestProcessor( projectContext: ProjectContext, testCompiler: TestCompiler, testsExecutionResultManager: TestsExecutionResultManager, - junitVersion: JUnitVersion + junitVersion: JUnitVersion, ): TestCase { // get buildPath var buildPath: String = ProjectRootManager.getInstance(project).contentRoots.first().path diff --git a/src/main/kotlin/org/jetbrains/research/testspark/tools/evosuite/EvoSuite.kt b/src/main/kotlin/org/jetbrains/research/testspark/tools/evosuite/EvoSuite.kt index e344d5000..7539e4d8a 100644 --- a/src/main/kotlin/org/jetbrains/research/testspark/tools/evosuite/EvoSuite.kt +++ b/src/main/kotlin/org/jetbrains/research/testspark/tools/evosuite/EvoSuite.kt @@ -184,7 +184,7 @@ class EvoSuite(override val name: String = "EvoSuite") : Tool { testGenerationController, testSparkDisplayManager, testsExecutionResultManager, - name + name, ) } } diff --git a/src/main/kotlin/org/jetbrains/research/testspark/tools/llm/Llm.kt b/src/main/kotlin/org/jetbrains/research/testspark/tools/llm/Llm.kt index e312d99fa..068f433ef 100644 --- a/src/main/kotlin/org/jetbrains/research/testspark/tools/llm/Llm.kt +++ b/src/main/kotlin/org/jetbrains/research/testspark/tools/llm/Llm.kt @@ -218,7 +218,7 @@ class Llm(override val name: String = "LLM") : Tool { testGenerationController, testSparkDisplayManager, testsExecutionResultManager, - name + name, ) val manager = LLMProcessManager(