@@ -15,7 +15,6 @@ import org.jetbrains.kotlin.idea.core.getPackage
15
15
import org.jetbrains.kotlin.idea.util.projectStructure.allModules
16
16
import org.jetbrains.kotlin.idea.util.rootManager
17
17
import org.jetbrains.kotlin.idea.util.sourceRoot
18
- import org.jetbrains.kotlin.utils.addToStdlib.flatMapToNullable
19
18
import org.utbot.common.PathUtil.fileExtension
20
19
import org.utbot.framework.codegen.domain.ProjectType
21
20
import org.utbot.framework.plugin.api.CodegenLanguage
@@ -25,10 +24,8 @@ import org.utbot.intellij.plugin.ui.utils.getSortedTestRoots
25
24
import org.utbot.intellij.plugin.ui.utils.isBuildWithGradle
26
25
import org.utbot.intellij.plugin.ui.utils.suitableTestSourceRoots
27
26
import java.nio.file.Files
28
- import java.nio.file.Path
29
27
import javax.xml.parsers.DocumentBuilderFactory
30
28
import kotlin.streams.asSequence
31
- import kotlin.streams.toList
32
29
33
30
val PsiClass .packageName: String get() = this .containingFile.containingDirectory.getPackage()?.qualifiedName ? : " "
34
31
const val HISTORY_LIMIT = 10
@@ -123,7 +120,7 @@ open class BaseTestsModel(
123
120
val resourcesPaths =
124
121
setOf (testModule, srcModule).flatMapTo(mutableSetOf ()) { it.getResourcesPaths() }
125
122
val xmlFilePaths = resourcesPaths.flatMapTo(mutableListOf ()) { path ->
126
- Files .list (path)
123
+ Files .walk (path)
127
124
.asSequence()
128
125
.filter { it.fileExtension == " .xml" }
129
126
}
@@ -132,10 +129,10 @@ open class BaseTestsModel(
132
129
return xmlFilePaths.mapNotNullTo(mutableSetOf ()) { path ->
133
130
val doc = builder.parse(path.toFile())
134
131
135
- val isBeanTagName = doc.documentElement.tagName == " beans"
132
+ val hasBeanTagName = doc.documentElement.tagName == " beans"
136
133
val hasAttribute = doc.documentElement.getAttribute(" xmlns" ) == " http://www.springframework.org/schema/beans"
137
134
when {
138
- isBeanTagName && hasAttribute -> path.toString()
135
+ hasBeanTagName && hasAttribute -> path.toString()
139
136
else -> null
140
137
}
141
138
}
0 commit comments