@@ -6,7 +6,6 @@ import org.utbot.common.FileUtil.findAllFilesOnly
66import org.utbot.common.PathUtil.classFqnToPath
77import org.utbot.common.PathUtil.replaceSeparator
88import org.utbot.common.tryLoadClass
9- import org.utbot.framework.plugin.api.CodegenLanguage
109import org.utbot.framework.plugin.sarif.util.ClassUtil
1110import org.utbot.framework.plugin.sarif.TargetClassWrapper
1211import java.io.File
@@ -97,33 +96,22 @@ class SourceSetWrapper(
9796
9897 /* *
9998 * Creates and returns a file for a future SARIF report.
100- * For example, ".../main/ com/qwerty/MainReport.sarif".
99+ * For example, ".../com/qwerty/MainReport.sarif".
101100 */
102101 private fun createSarifReportFile (classFqn : String ): File {
103- val relativePath = " ${sourceSet.name} / ${ classFqnToPath(classFqn)} Report.sarif"
102+ val relativePath = " ${classFqnToPath(classFqn)} Report.sarif"
104103 val absolutePath = Paths .get(parentProject.generatedSarifDirectory.path, relativePath)
105104 return absolutePath.toFile().apply { createNewFileWithParentDirectories() }
106105 }
107106
108107 /* *
109108 * Creates and returns a file for future generated tests.
110- * For example, ".../java/main/ com/qwerty/MainTest.java".
109+ * For example, ".../com/qwerty/MainTest.java".
111110 */
112111 private fun createTestsCodeFile (classFqn : String ): File {
113112 val fileExtension = parentProject.sarifProperties.codegenLanguage.extension
114- val sourceRoot = parentProject.sarifProperties.codegenLanguage.toSourceRootName()
115- val relativePath = " $sourceRoot /${sourceSet.name} /${classFqnToPath(classFqn)} Test$fileExtension "
113+ val relativePath = " ${classFqnToPath(classFqn)} Test$fileExtension "
116114 val absolutePath = Paths .get(parentProject.generatedTestsDirectory.path, relativePath)
117115 return absolutePath.toFile().apply { createNewFileWithParentDirectories() }
118116 }
119-
120- /* *
121- * Returns the source root name by [CodegenLanguage].
122- */
123- private fun CodegenLanguage.toSourceRootName (): String =
124- when (this ) {
125- CodegenLanguage .JAVA -> " java"
126- CodegenLanguage .KOTLIN -> " kotlin"
127- else -> " unknown"
128- }
129117}
0 commit comments