Skip to content

Commit

Permalink
fix org.jetbrains.research.testspark package
Browse files Browse the repository at this point in the history
  • Loading branch information
arksap2002 committed Aug 14, 2023
1 parent aa2dff4 commit 4c3edb0
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import com.intellij.openapi.actionSystem.AnAction
import com.intellij.openapi.actionSystem.AnActionEvent
import com.intellij.openapi.components.service
import com.intellij.openapi.project.Project
import org.jetbrains.research.testspark.TestSparkBundle

/**
* Service used for the sole purpose to limit TestSpark to generate tests only once at a time.
Expand All @@ -26,8 +27,8 @@ class RunnerService(private val project: Project) {
val notification = NotificationGroupManager.getInstance()
.getNotificationGroup("Execution Error")
.createNotification(
org.jetbrains.research.testspark.TestSparkBundle.message("alreadyRunningNotificationTitle"),
org.jetbrains.research.testspark.TestSparkBundle.message("alreadyRunningTextNotificationText"),
TestSparkBundle.message("alreadyRunningNotificationTitle"),
TestSparkBundle.message("alreadyRunningTextNotificationText"),
NotificationType.WARNING,
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,27 +34,27 @@ data class SettingsApplicationState(
* Default values of SettingsApplicationState.
*/
object DefaultSettingsApplicationState {
val sandbox: Boolean = org.jetbrains.research.testspark.TestSparkDefaultsBundle.defaultValue("sandbox").toBoolean()
val assertions: Boolean = org.jetbrains.research.testspark.TestSparkDefaultsBundle.defaultValue("assertions").toBoolean()
val seed: String = org.jetbrains.research.testspark.TestSparkDefaultsBundle.defaultValue("seed")
val junitCheck: Boolean = org.jetbrains.research.testspark.TestSparkDefaultsBundle.defaultValue("junitCheck").toBoolean()
val minimize: Boolean = org.jetbrains.research.testspark.TestSparkDefaultsBundle.defaultValue("minimize").toBoolean()
val sandbox: Boolean = TestSparkDefaultsBundle.defaultValue("sandbox").toBoolean()
val assertions: Boolean = TestSparkDefaultsBundle.defaultValue("assertions").toBoolean()
val seed: String = TestSparkDefaultsBundle.defaultValue("seed")
val junitCheck: Boolean = TestSparkDefaultsBundle.defaultValue("junitCheck").toBoolean()
val minimize: Boolean = TestSparkDefaultsBundle.defaultValue("minimize").toBoolean()
val algorithm: ContentDigestAlgorithm = ContentDigestAlgorithm.DYNAMOSA
val configurationId: String = org.jetbrains.research.testspark.TestSparkDefaultsBundle.defaultValue("configurationId")
val clientOnThread: Boolean = org.jetbrains.research.testspark.TestSparkDefaultsBundle.defaultValue("clientOnThread").toBoolean()
val criterionLine: Boolean = org.jetbrains.research.testspark.TestSparkDefaultsBundle.defaultValue("criterionLine").toBoolean()
val criterionBranch: Boolean = org.jetbrains.research.testspark.TestSparkDefaultsBundle.defaultValue("criterionBranch").toBoolean()
val criterionException: Boolean = org.jetbrains.research.testspark.TestSparkDefaultsBundle.defaultValue("criterionException").toBoolean()
val criterionWeakMutation: Boolean = org.jetbrains.research.testspark.TestSparkDefaultsBundle.defaultValue("criterionWeakMutation").toBoolean()
val criterionOutput: Boolean = org.jetbrains.research.testspark.TestSparkDefaultsBundle.defaultValue("criterionOutput").toBoolean()
val criterionMethod: Boolean = org.jetbrains.research.testspark.TestSparkDefaultsBundle.defaultValue("criterionMethod").toBoolean()
val criterionMethodNoException: Boolean = org.jetbrains.research.testspark.TestSparkDefaultsBundle.defaultValue("criterionMethodNoException").toBoolean()
val criterionCBranch: Boolean = org.jetbrains.research.testspark.TestSparkDefaultsBundle.defaultValue("criterionCBranch").toBoolean()
val llmUserToken: String = org.jetbrains.research.testspark.TestSparkDefaultsBundle.defaultValue("llmToken")
var model: String = org.jetbrains.research.testspark.TestSparkDefaultsBundle.defaultValue("model")
val maxLLMRequest: Int = org.jetbrains.research.testspark.TestSparkDefaultsBundle.defaultValue("maxLLMRequest").toInt()
val maxInputParamsDepth: Int = org.jetbrains.research.testspark.TestSparkDefaultsBundle.defaultValue("maxInputParamsDepth").toInt()
val maxPolyDepth: Int = org.jetbrains.research.testspark.TestSparkDefaultsBundle.defaultValue("maxPolyDepth").toInt()
val configurationId: String = TestSparkDefaultsBundle.defaultValue("configurationId")
val clientOnThread: Boolean = TestSparkDefaultsBundle.defaultValue("clientOnThread").toBoolean()
val criterionLine: Boolean = TestSparkDefaultsBundle.defaultValue("criterionLine").toBoolean()
val criterionBranch: Boolean = TestSparkDefaultsBundle.defaultValue("criterionBranch").toBoolean()
val criterionException: Boolean = TestSparkDefaultsBundle.defaultValue("criterionException").toBoolean()
val criterionWeakMutation: Boolean = TestSparkDefaultsBundle.defaultValue("criterionWeakMutation").toBoolean()
val criterionOutput: Boolean = TestSparkDefaultsBundle.defaultValue("criterionOutput").toBoolean()
val criterionMethod: Boolean = TestSparkDefaultsBundle.defaultValue("criterionMethod").toBoolean()
val criterionMethodNoException: Boolean = TestSparkDefaultsBundle.defaultValue("criterionMethodNoException").toBoolean()
val criterionCBranch: Boolean = TestSparkDefaultsBundle.defaultValue("criterionCBranch").toBoolean()
val llmUserToken: String = TestSparkDefaultsBundle.defaultValue("llmToken")
var model: String = TestSparkDefaultsBundle.defaultValue("model")
val maxLLMRequest: Int = TestSparkDefaultsBundle.defaultValue("maxLLMRequest").toInt()
val maxInputParamsDepth: Int = TestSparkDefaultsBundle.defaultValue("maxInputParamsDepth").toInt()
val maxPolyDepth: Int = TestSparkDefaultsBundle.defaultValue("maxPolyDepth").toInt()
}

fun serializeChangesFromDefault(): List<String> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import com.intellij.openapi.progress.ProgressIndicator
import com.intellij.openapi.project.Project
import com.intellij.openapi.util.Key
import com.intellij.util.concurrency.AppExecutorUtil
import org.jetbrains.research.testspark.TestSparkBundle
import org.jetbrains.research.testspark.data.CodeType
import org.jetbrains.research.testspark.data.FragmentToTestDada
import org.jetbrains.research.testspark.editor.Workspace
Expand Down Expand Up @@ -107,7 +108,7 @@ class EvoSuiteProcessManager(
log.info("Starting EvoSuite with arguments: $cmdString")

indicator.isIndeterminate = false
indicator.text = org.jetbrains.research.testspark.TestSparkBundle.message("searchMessage")
indicator.text = TestSparkBundle.message("searchMessage")
val evoSuiteProcess = GeneralCommandLine(cmd)
evoSuiteProcess.charset = Charset.forName("UTF-8")
evoSuiteProcess.setWorkDirectory(projectPath)
Expand Down Expand Up @@ -152,8 +153,8 @@ class EvoSuiteProcessManager(
indicator.fraction = coverage
}

if (indicator.fraction == 1.0 && indicator.text != org.jetbrains.research.testspark.TestSparkBundle.message("testCasesSaving")) {
indicator.text = org.jetbrains.research.testspark.TestSparkBundle.message("testCasesSaving")
if (indicator.fraction == 1.0 && indicator.text != TestSparkBundle.message("testCasesSaving")) {
indicator.text = TestSparkBundle.message("testCasesSaving")
}
}
})
Expand All @@ -169,7 +170,7 @@ class EvoSuiteProcessManager(
AppExecutorUtil.getAppScheduledExecutorService()
.execute(ResultWatcher(project, testResultName, fileUrl, classFQN))
} catch (e: Exception) {
evoSuiteErrorManager.errorProcess(org.jetbrains.research.testspark.TestSparkBundle.message("evosuiteErrorMessage").format(e.message), project)
evoSuiteErrorManager.errorProcess(TestSparkBundle.message("evosuiteErrorMessage").format(e.message), project)
e.printStackTrace()
}
}
Expand Down

0 comments on commit 4c3edb0

Please sign in to comment.