From 7106cb98571fc1e9cc8d5b69d0195b3b84f9c185 Mon Sep 17 00:00:00 2001 From: Nikita Stroganov Date: Mon, 20 Jun 2022 11:40:43 +0300 Subject: [PATCH] #242 Rename SARIF report file --- .../utbot/gradle/plugin/wrappers/GradleProjectWrapper.kt | 2 +- .../org/utbot/gradle/plugin/wrappers/SourceSetWrapper.kt | 4 ++-- .../org/utbot/intellij/plugin/generator/TestGenerator.kt | 2 +- .../org/utbot/intellij/plugin/sarif/SarifReportIdea.kt | 2 +- .../org/utbot/intellij/plugin/ui/utils/ModuleUtils.kt | 2 +- .../org/utbot/maven/plugin/wrappers/MavenProjectWrapper.kt | 6 +++--- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/utbot-gradle/src/main/kotlin/org/utbot/gradle/plugin/wrappers/GradleProjectWrapper.kt b/utbot-gradle/src/main/kotlin/org/utbot/gradle/plugin/wrappers/GradleProjectWrapper.kt index 6f8b099a8a..2a7c7748f1 100644 --- a/utbot-gradle/src/main/kotlin/org/utbot/gradle/plugin/wrappers/GradleProjectWrapper.kt +++ b/utbot-gradle/src/main/kotlin/org/utbot/gradle/plugin/wrappers/GradleProjectWrapper.kt @@ -59,7 +59,7 @@ class GradleProjectWrapper( val sarifReportFile: File by lazy { Paths.get( generatedSarifDirectory.path, - "${project.name}-utbot.sarif" + "${project.name}Report.sarif" ).toFile().apply { createNewFileWithParentDirectories() } diff --git a/utbot-gradle/src/main/kotlin/org/utbot/gradle/plugin/wrappers/SourceSetWrapper.kt b/utbot-gradle/src/main/kotlin/org/utbot/gradle/plugin/wrappers/SourceSetWrapper.kt index dabb070c05..82ccf59bac 100644 --- a/utbot-gradle/src/main/kotlin/org/utbot/gradle/plugin/wrappers/SourceSetWrapper.kt +++ b/utbot-gradle/src/main/kotlin/org/utbot/gradle/plugin/wrappers/SourceSetWrapper.kt @@ -97,10 +97,10 @@ class SourceSetWrapper( /** * Creates and returns a file for a future SARIF report. - * For example, ".../main/com/qwerty/Main-utbot.sarif". + * For example, ".../main/com/qwerty/MainReport.sarif". */ private fun createSarifReportFile(classFqn: String): File { - val relativePath = "${sourceSet.name}/${classFqnToPath(classFqn)}-utbot.sarif" + val relativePath = "${sourceSet.name}/${classFqnToPath(classFqn)}Report.sarif" val absolutePath = Paths.get(parentProject.generatedSarifDirectory.path, relativePath) return absolutePath.toFile().apply { createNewFileWithParentDirectories() } } diff --git a/utbot-intellij/src/main/kotlin/org/utbot/intellij/plugin/generator/TestGenerator.kt b/utbot-intellij/src/main/kotlin/org/utbot/intellij/plugin/generator/TestGenerator.kt index 78f0f2a793..ebab833a4a 100644 --- a/utbot-intellij/src/main/kotlin/org/utbot/intellij/plugin/generator/TestGenerator.kt +++ b/utbot-intellij/src/main/kotlin/org/utbot/intellij/plugin/generator/TestGenerator.kt @@ -103,7 +103,7 @@ object TestGenerator { .toList() val mergedReport = SarifReport.mergeReports(sarifReports) - val mergedReportPath = sarifReportsPath.resolve("${model.project.name}-utbot-merged.sarif") + val mergedReportPath = sarifReportsPath.resolve("${model.project.name}Report.sarif") mergedReportPath.toFile().writeText(mergedReport) // notifying the user diff --git a/utbot-intellij/src/main/kotlin/org/utbot/intellij/plugin/sarif/SarifReportIdea.kt b/utbot-intellij/src/main/kotlin/org/utbot/intellij/plugin/sarif/SarifReportIdea.kt index 3b26f89bff..19e757a190 100644 --- a/utbot-intellij/src/main/kotlin/org/utbot/intellij/plugin/sarif/SarifReportIdea.kt +++ b/utbot-intellij/src/main/kotlin/org/utbot/intellij/plugin/sarif/SarifReportIdea.kt @@ -22,7 +22,7 @@ object SarifReportIdea { // building the path to the report file val classFqn = testCases.firstOrNull()?.method?.clazz?.qualifiedName ?: return val sarifReportsPath = model.testModule.getOrCreateSarifReportsPath(model.testSourceRoot) - val reportFilePath = sarifReportsPath.resolve("${classFqnToPath(classFqn)}-utbot.sarif") + val reportFilePath = sarifReportsPath.resolve("${classFqnToPath(classFqn)}Report.sarif") // creating report related directory VfsUtil.createDirectoryIfMissing(reportFilePath.parent.toString()) diff --git a/utbot-intellij/src/main/kotlin/org/utbot/intellij/plugin/ui/utils/ModuleUtils.kt b/utbot-intellij/src/main/kotlin/org/utbot/intellij/plugin/ui/utils/ModuleUtils.kt index 40b335e747..18600f8eaf 100644 --- a/utbot-intellij/src/main/kotlin/org/utbot/intellij/plugin/ui/utils/ModuleUtils.kt +++ b/utbot-intellij/src/main/kotlin/org/utbot/intellij/plugin/ui/utils/ModuleUtils.kt @@ -74,7 +74,7 @@ fun Module.getOrCreateTestResourcesPath(testSourceRoot: VirtualFile?): Path { */ fun Module.getOrCreateSarifReportsPath(testSourceRoot: VirtualFile?): Path { val testResourcesPath = this.getOrCreateTestResourcesPath(testSourceRoot) - return "$testResourcesPath/sarif/".toPath() + return "$testResourcesPath/utbot-sarif-report/".toPath() } /** diff --git a/utbot-maven/src/main/kotlin/org/utbot/maven/plugin/wrappers/MavenProjectWrapper.kt b/utbot-maven/src/main/kotlin/org/utbot/maven/plugin/wrappers/MavenProjectWrapper.kt index 6c1ee2d6e3..a8b3394b04 100644 --- a/utbot-maven/src/main/kotlin/org/utbot/maven/plugin/wrappers/MavenProjectWrapper.kt +++ b/utbot-maven/src/main/kotlin/org/utbot/maven/plugin/wrappers/MavenProjectWrapper.kt @@ -51,7 +51,7 @@ class MavenProjectWrapper( val sarifReportFile: File by lazy { Paths.get( generatedSarifDirectory.path, - "${mavenProject.name}-utbot.sarif" + "${mavenProject.name}Report.sarif" ).toFile().apply { createNewFileWithParentDirectories() } @@ -131,10 +131,10 @@ class MavenProjectWrapper( /** * Creates and returns a file for a future SARIF report. - * For example, ".../main/com/qwerty/Main-utbot.sarif". + * For example, ".../main/com/qwerty/MainReport.sarif". */ private fun createSarifReportFile(classFqn: String): File { - val relativePath = "${PathUtil.classFqnToPath(classFqn)}-utbot.sarif" + val relativePath = "${PathUtil.classFqnToPath(classFqn)}Report.sarif" val absolutePath = Paths.get(generatedSarifDirectory.path, relativePath) return absolutePath.toFile().apply { createNewFileWithParentDirectories() } }