File tree Expand file tree Collapse file tree 4 files changed +23
-26
lines changed
utbot-intellij/src/main/kotlin/org/utbot/intellij/plugin/generator
utbot-ui-commons/src/main/kotlin/org/utbot/intellij/plugin Expand file tree Collapse file tree 4 files changed +23
-26
lines changed Original file line number Diff line number Diff line change @@ -241,7 +241,7 @@ object UtTestsDialogProcessor {
241241 val totalClasses = model.srcClasses.size
242242 val classNameToPath = runReadAction {
243243 model.srcClasses.associate { psiClass ->
244- psiClass.binaryName() to psiClass.containingFile.virtualFile.canonicalPath
244+ psiClass.binaryName to psiClass.containingFile.virtualFile.canonicalPath
245245 }
246246 }
247247
@@ -320,7 +320,7 @@ object UtTestsDialogProcessor {
320320 var srcNameForLog: String? = null
321321 DumbService .getInstance(project)
322322 .runReadActionInSmartMode(Computable {
323- binaryName = srcClass.binaryName()
323+ binaryName = srcClass.binaryName
324324 srcNameForLog = srcClass.name
325325 srcMethods = if (model.extractMembersFromSrcClasses) {
326326 val chosenMethods =
Original file line number Diff line number Diff line change @@ -134,7 +134,7 @@ open class BaseTestsModel(
134134 .searchPsiClasses(annotationClass, searchScope)
135135 .findAll()
136136 .sortedBy { testRootToIndex[it.containingFile.sourceRoot] ? : Int .MAX_VALUE }
137- .mapNotNullTo(mutableSetOf ()) { it.binaryName() }
137+ .mapNotNullTo(mutableSetOf ()) { it.binaryName }
138138 }
139139
140140 fun getSpringXMLConfigurationFiles (): Set <String > {
Original file line number Diff line number Diff line change @@ -17,6 +17,26 @@ import org.jetbrains.kotlin.asJava.elements.isSetter
1717import org.jetbrains.kotlin.psi.KtClass
1818import org.utbot.common.filterWhen
1919import org.utbot.framework.UtSettings
20+ import org.utbot.intellij.plugin.models.packageName
21+
22+ /* *
23+ * Used to build binary name from canonical name
24+ * in a similar form which could be obtained by [java.lang.Class.getName] method.
25+ *
26+ * E.g. ```org.example.OuterClass.InnerClass.InnerInnerClass``` -> ```org.example.OuterClass$InnerClass$InnerInnerClass```
27+ */
28+ val PsiClass .binaryName: String
29+ get() =
30+ if (packageName.isEmpty()) {
31+ qualifiedName?.replace(" ." , " $" ) ? : " "
32+ } else {
33+ val name =
34+ qualifiedName
35+ ?.substringAfter(" $packageName ." )
36+ ?.replace(" ." , " $" )
37+ ? : error(" Binary name construction failed: unable to get qualified name of $this " )
38+ " $packageName .$name "
39+ }
2040
2141val PsiMember .isAbstract: Boolean
2242 get() = modifierList?.hasModifierProperty(PsiModifier .ABSTRACT )? : false
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments