@@ -15,7 +15,6 @@ import org.jetbrains.kotlin.idea.core.getPackage
1515import org.jetbrains.kotlin.idea.util.projectStructure.allModules
1616import org.jetbrains.kotlin.idea.util.rootManager
1717import org.jetbrains.kotlin.idea.util.sourceRoot
18- import org.jetbrains.kotlin.utils.addToStdlib.flatMapToNullable
1918import org.utbot.common.PathUtil.fileExtension
2019import org.utbot.framework.codegen.domain.ProjectType
2120import org.utbot.framework.plugin.api.CodegenLanguage
@@ -25,10 +24,8 @@ import org.utbot.intellij.plugin.ui.utils.getSortedTestRoots
2524import org.utbot.intellij.plugin.ui.utils.isBuildWithGradle
2625import org.utbot.intellij.plugin.ui.utils.suitableTestSourceRoots
2726import java.nio.file.Files
28- import java.nio.file.Path
2927import javax.xml.parsers.DocumentBuilderFactory
3028import kotlin.streams.asSequence
31- import kotlin.streams.toList
3229
3330val PsiClass .packageName: String get() = this .containingFile.containingDirectory.getPackage()?.qualifiedName ? : " "
3431const val HISTORY_LIMIT = 10
@@ -123,7 +120,7 @@ open class BaseTestsModel(
123120 val resourcesPaths =
124121 setOf (testModule, srcModule).flatMapTo(mutableSetOf ()) { it.getResourcesPaths() }
125122 val xmlFilePaths = resourcesPaths.flatMapTo(mutableListOf ()) { path ->
126- Files .list (path)
123+ Files .walk (path)
127124 .asSequence()
128125 .filter { it.fileExtension == " .xml" }
129126 }
@@ -132,10 +129,10 @@ open class BaseTestsModel(
132129 return xmlFilePaths.mapNotNullTo(mutableSetOf ()) { path ->
133130 val doc = builder.parse(path.toFile())
134131
135- val isBeanTagName = doc.documentElement.tagName == " beans"
132+ val hasBeanTagName = doc.documentElement.tagName == " beans"
136133 val hasAttribute = doc.documentElement.getAttribute(" xmlns" ) == " http://www.springframework.org/schema/beans"
137134 when {
138- isBeanTagName && hasAttribute -> path.toString()
135+ hasBeanTagName && hasAttribute -> path.toString()
139136 else -> null
140137 }
141138 }
0 commit comments