From 889082d7e66916fb179044d1f7522eeee2e52257 Mon Sep 17 00:00:00 2001 From: Egor Kulikov Date: Fri, 11 Nov 2022 12:40:51 +0300 Subject: [PATCH 1/7] Fix missing documentation in UtUtils class --- .../org/utbot/framework/codegen/renderer/CgJavaRenderer.kt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/utbot-framework/src/main/kotlin/org/utbot/framework/codegen/renderer/CgJavaRenderer.kt b/utbot-framework/src/main/kotlin/org/utbot/framework/codegen/renderer/CgJavaRenderer.kt index 6e1ecefb7b..5a85de76d1 100644 --- a/utbot-framework/src/main/kotlin/org/utbot/framework/codegen/renderer/CgJavaRenderer.kt +++ b/utbot-framework/src/main/kotlin/org/utbot/framework/codegen/renderer/CgJavaRenderer.kt @@ -87,6 +87,8 @@ internal class CgJavaRenderer(context: CgRendererContext, printer: CgPrinter = C } override fun visit(element: CgClassBody) { + element.documentation?.accept(this) + // render regions for test methods and utils val allRegions = element.methodRegions + element.nestedClassRegions + element.staticDeclarationRegions for ((i, region) in allRegions.withIndex()) { From a996fe2b9923b7ac6430bfb4789f34cf243be80e Mon Sep 17 00:00:00 2001 From: Egor Kulikov Date: Mon, 14 Nov 2022 11:15:41 +0300 Subject: [PATCH 2/7] Improve rendering of UtUtils documentation --- .../org/utbot/framework/codegen/domain/models/CgElement.kt | 2 +- .../org/utbot/framework/codegen/renderer/CgJavaRenderer.kt | 4 ++-- .../utbot/framework/codegen/renderer/CgKotlinRenderer.kt | 4 ++-- .../kotlin/org/utbot/framework/codegen/tree/Builders.kt | 6 +++--- .../codegen/tree/ututils/CgUtilClassConstructor.kt | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/utbot-framework/src/main/kotlin/org/utbot/framework/codegen/domain/models/CgElement.kt b/utbot-framework/src/main/kotlin/org/utbot/framework/codegen/domain/models/CgElement.kt index 0c32541cbd..a37ea56bbb 100644 --- a/utbot-framework/src/main/kotlin/org/utbot/framework/codegen/domain/models/CgElement.kt +++ b/utbot-framework/src/main/kotlin/org/utbot/framework/codegen/domain/models/CgElement.kt @@ -124,6 +124,7 @@ open class CgClassFile( class CgClass( val id: ClassId, + val documentation: CgDocumentationComment?, val annotations: List, val superclass: ClassId?, val interfaces: List, @@ -149,7 +150,6 @@ class CgClass( */ class CgClassBody( val classId: ClassId, - val documentation: CgDocumentationComment?, val methodRegions: List, val staticDeclarationRegions: List, val nestedClassRegions: List> diff --git a/utbot-framework/src/main/kotlin/org/utbot/framework/codegen/renderer/CgJavaRenderer.kt b/utbot-framework/src/main/kotlin/org/utbot/framework/codegen/renderer/CgJavaRenderer.kt index 5a85de76d1..80a6630243 100644 --- a/utbot-framework/src/main/kotlin/org/utbot/framework/codegen/renderer/CgJavaRenderer.kt +++ b/utbot-framework/src/main/kotlin/org/utbot/framework/codegen/renderer/CgJavaRenderer.kt @@ -61,6 +61,8 @@ internal class CgJavaRenderer(context: CgRendererContext, printer: CgPrinter = C get() = this == context.generatedClass override fun visit(element: CgClass) { + element.documentation?.accept(this) + for (annotation in element.annotations) { annotation.accept(this) } @@ -87,8 +89,6 @@ internal class CgJavaRenderer(context: CgRendererContext, printer: CgPrinter = C } override fun visit(element: CgClassBody) { - element.documentation?.accept(this) - // render regions for test methods and utils val allRegions = element.methodRegions + element.nestedClassRegions + element.staticDeclarationRegions for ((i, region) in allRegions.withIndex()) { diff --git a/utbot-framework/src/main/kotlin/org/utbot/framework/codegen/renderer/CgKotlinRenderer.kt b/utbot-framework/src/main/kotlin/org/utbot/framework/codegen/renderer/CgKotlinRenderer.kt index 229c33d697..70531d610e 100644 --- a/utbot-framework/src/main/kotlin/org/utbot/framework/codegen/renderer/CgKotlinRenderer.kt +++ b/utbot-framework/src/main/kotlin/org/utbot/framework/codegen/renderer/CgKotlinRenderer.kt @@ -75,6 +75,8 @@ internal class CgKotlinRenderer(context: CgRendererContext, printer: CgPrinter = get() = (this == context.generatedClass) || isKotlinFile override fun visit(element: CgClass) { + element.documentation?.accept(this) + for (annotation in element.annotations) { annotation.accept(this) } @@ -115,8 +117,6 @@ internal class CgKotlinRenderer(context: CgRendererContext, printer: CgPrinter = } override fun visit(element: CgClassBody) { - element.documentation?.accept(this) - // render regions for test methods for ((i, region) in (element.methodRegions + element.nestedClassRegions).withIndex()) { if (i != 0) println() diff --git a/utbot-framework/src/main/kotlin/org/utbot/framework/codegen/tree/Builders.kt b/utbot-framework/src/main/kotlin/org/utbot/framework/codegen/tree/Builders.kt index 70b7344bf8..90b5d0b54e 100644 --- a/utbot-framework/src/main/kotlin/org/utbot/framework/codegen/tree/Builders.kt +++ b/utbot-framework/src/main/kotlin/org/utbot/framework/codegen/tree/Builders.kt @@ -49,6 +49,7 @@ fun buildClassFile(init: CgClassFileBuilder.() -> Unit) = CgClassFileBuilder().a class CgClassBuilder : CgBuilder { lateinit var id: ClassId + var documentation: CgDocumentationComment? = null val annotations: MutableList = mutableListOf() var superclass: ClassId? = null val interfaces: MutableList = mutableListOf() @@ -56,18 +57,17 @@ class CgClassBuilder : CgBuilder { var isNested: Boolean = false lateinit var body: CgClassBody - override fun build() = CgClass(id, annotations, superclass, interfaces, body, isStatic, isNested) + override fun build() = CgClass(id, documentation, annotations, superclass, interfaces, body, isStatic, isNested) } fun buildClass(init: CgClassBuilder.() -> Unit) = CgClassBuilder().apply(init).build() class CgClassBodyBuilder(val classId: ClassId) : CgBuilder { - var documentation: CgDocumentationComment? = null val methodRegions: MutableList = mutableListOf() val staticDeclarationRegions: MutableList = mutableListOf() val nestedClassRegions: MutableList> = mutableListOf() - override fun build() = CgClassBody(classId, documentation, methodRegions, staticDeclarationRegions, nestedClassRegions) + override fun build() = CgClassBody(classId, methodRegions, staticDeclarationRegions, nestedClassRegions) } fun buildClassBody(classId: ClassId, init: CgClassBodyBuilder.() -> Unit) = CgClassBodyBuilder(classId).apply(init).build() diff --git a/utbot-framework/src/main/kotlin/org/utbot/framework/codegen/tree/ututils/CgUtilClassConstructor.kt b/utbot-framework/src/main/kotlin/org/utbot/framework/codegen/tree/ututils/CgUtilClassConstructor.kt index c0aee58cd8..d267d062a2 100644 --- a/utbot-framework/src/main/kotlin/org/utbot/framework/codegen/tree/ututils/CgUtilClassConstructor.kt +++ b/utbot-framework/src/main/kotlin/org/utbot/framework/codegen/tree/ututils/CgUtilClassConstructor.kt @@ -27,8 +27,8 @@ internal object CgUtilClassConstructor { // so they will be imported once IDEA reformatting action has worked declaredClass = buildClass { id = utilsClassId + documentation = utilClassKind.utilClassDocumentation(codegenLanguage) body = buildClassBody(utilsClassId) { - documentation = utilClassKind.utilClassDocumentation(codegenLanguage) staticDeclarationRegions += CgStaticsRegion("Util methods", utilMethodProvider.utilMethodIds.map { CgUtilMethod(it) }) nestedClassRegions += CgAuxiliaryNestedClassesRegion( nestedClasses = listOf( From 00c2dee4d5668e86307ffd7e65067bb8c69115a3 Mon Sep 17 00:00:00 2001 From: Egor Kulikov Date: Mon, 14 Nov 2022 11:32:43 +0300 Subject: [PATCH 3/7] Improve design doc --- docs/UtUtilsClass.md | 8 +++++--- docs/images/utbot_ututils_2.0.png | Bin 0 -> 15286 bytes 2 files changed, 5 insertions(+), 3 deletions(-) create mode 100644 docs/images/utbot_ututils_2.0.png diff --git a/docs/UtUtilsClass.md b/docs/UtUtilsClass.md index 63279678a2..65b8fa3029 100644 --- a/docs/UtUtilsClass.md +++ b/docs/UtUtilsClass.md @@ -12,11 +12,13 @@ Previously UnitTestBot generated _utility methods_ for each test class when they For now UnitTestBot provides a special `UtUtils` class containing all _utility methods_ if at least one test class needs some of them. This class is generated once and the specific methods are imported from it if necessary. No need for _utility methods_ — no `UtUtils` class is generated. +We create a separate `UtUtils` class for each supported codegen language (is this class is required). + ## What does it look like -Here is an example of a comment inherent to every `UtUtils` class: +Here is the documentation inherent to every `UtUtils` class: -ututils +![Documentation](../images/utbot_ututils_2.0.png) As one can see, the comment mentions two characteristics of the `UtUtils` class: @@ -39,7 +41,7 @@ rely on the proper methods from `UtUtils` class. ## Where to find it -`UtUtils` class is usually located in the chosen **Test sources root** near the generated test classes. +`UtUtils` class is usually located in the chosen **Test sources root** near the generated test classes, it's package is named after the selected codegen language. ## How to test diff --git a/docs/images/utbot_ututils_2.0.png b/docs/images/utbot_ututils_2.0.png new file mode 100644 index 0000000000000000000000000000000000000000..c1146646c38118fc4ca03c7267a1d4198fcbe64d GIT binary patch literal 15286 zcmch;byOU0vo1=6B!m!x2T#!8?ry;$2>}9w1smKYgH00LEyy5)y9IX(&HxkKCD;JN z;DgJZ{J!t5z0clzt$Xet=dczu4c$G}RrS_ePt{YQ?=%$go>Dx;!otE+R+9gKg>_#T z^ZVSB`ha&uY}!Bby?_b>Eho%?DHSk?_CW9qLg_ zM$PWt%k!;uEeWll+SFEen9BIj5Q&2H!Y6DQ9T{x%;Cq&zEk9X)1;KkIfhG^#2bYDU zKv0A@^f(QXCUSQyju@gU*C<%S$db&;x9NyE#s^4aL}SAH_Vlf6YPIbmeFbfqMV#j% zbzyXoJ#R-V@)Wx`%F$T-cFP$rzDY6nx`$&Wot;UhWVSY@`B3R`JjH7XSR?(X=@NTR z7@VWZbV`IS{tzANX#4M^vU5%3&xfr@s;d=qL?Mm-~ z#zy-lFI0btV%>)Uf#4$zvFf}{6NS;3!;t*$CVc66@S7tMX)^FagJ zN?3QEBUMT68QGOr=*BqtLUKCE$LB?+xD~Ed zoC(nT8~g;1HiOmyOuh*9LYi?noxN&!Qkop$XKtNQp1Q|YRYiC{GIwqf6*gcgGgXi@ z8D5ZVC#yO#4Q`N{QGa!sQFq$PH{=XJZ(KX$-@eMq7fIVYX}`Q|gDj~to+K8q5E|nW zcvmd=#w$Pg`ufuQBZ9MLXqJ~AU41x0cC;is`F6uS<8C_djATTtJvqLO<2TFUQQ{ZT z-7S}Pm=7o10XZUKo$)Y)kn`@36h6|H z7h&^J8T)viO|ZKWpX!nAa7R;4UkVd2FA_Z-r05}9EoFGsw@?_Zk#Br{Ixt0DvMl-< zxcQPuA+?pbw@Oy8#7hg$D&B+R` z#u8XuMeRkKK8NY1GiUcEe2z5f5}ASB?r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o3o0FCcJ$^g-u~UU?J&qdf^jPO4 Date: Mon, 14 Nov 2022 11:40:04 +0300 Subject: [PATCH 4/7] Fix bug --- docs/UtUtilsClass.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/UtUtilsClass.md b/docs/UtUtilsClass.md index 65b8fa3029..ef6de255f2 100644 --- a/docs/UtUtilsClass.md +++ b/docs/UtUtilsClass.md @@ -18,7 +18,7 @@ We create a separate `UtUtils` class for each supported codegen language (is thi Here is the documentation inherent to every `UtUtils` class: -![Documentation](../images/utbot_ututils_2.0.png) +![Documentation](images/utbot_ututils_2.0.png) As one can see, the comment mentions two characteristics of the `UtUtils` class: From dd06bac67c573f9a0d29cb0f7a49417e0409f33e Mon Sep 17 00:00:00 2001 From: Egor Kulikov Date: Mon, 14 Nov 2022 11:55:46 +0300 Subject: [PATCH 5/7] Correct a phrase in documentation --- docs/UtUtilsClass.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/UtUtilsClass.md b/docs/UtUtilsClass.md index ef6de255f2..609f5a28b9 100644 --- a/docs/UtUtilsClass.md +++ b/docs/UtUtilsClass.md @@ -16,7 +16,7 @@ We create a separate `UtUtils` class for each supported codegen language (is thi ## What does it look like -Here is the documentation inherent to every `UtUtils` class: +Here is as example of documentation comment inherent to every `UtUtils` class: ![Documentation](images/utbot_ututils_2.0.png) From 1f96ba67d83bb1a86415d394eb92ec6c75d054e5 Mon Sep 17 00:00:00 2001 From: Egor Kulikov Date: Tue, 15 Nov 2022 13:16:26 +0300 Subject: [PATCH 6/7] Improve md file in accordance with review comments --- docs/UtUtilsClass.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/UtUtilsClass.md b/docs/UtUtilsClass.md index 609f5a28b9..ed1cfeab51 100644 --- a/docs/UtUtilsClass.md +++ b/docs/UtUtilsClass.md @@ -12,11 +12,11 @@ Previously UnitTestBot generated _utility methods_ for each test class when they For now UnitTestBot provides a special `UtUtils` class containing all _utility methods_ if at least one test class needs some of them. This class is generated once and the specific methods are imported from it if necessary. No need for _utility methods_ — no `UtUtils` class is generated. -We create a separate `UtUtils` class for each supported codegen language (is this class is required). +We create a separate `UtUtils` class for each supported codegen language (if this class is required). ## What does it look like -Here is as example of documentation comment inherent to every `UtUtils` class: +Here is an example of documentation comment inherent to every `UtUtils` class: ![Documentation](images/utbot_ututils_2.0.png) @@ -41,7 +41,7 @@ rely on the proper methods from `UtUtils` class. ## Where to find it -`UtUtils` class is usually located in the chosen **Test sources root** near the generated test classes, it's package is named after the selected codegen language. +`UtUtils` class is usually located in the chosen **Test sources root** near the generated test classes. The corresponding package name mentions the language of the generated tests: e.g. `org.utbot.runtime.utils.java`. ## How to test From ecd04ec21c885aa07226046713f086866da73089 Mon Sep 17 00:00:00 2001 From: Egor Kulikov Date: Tue, 15 Nov 2022 13:29:25 +0300 Subject: [PATCH 7/7] Fix compilation --- .../kotlin/org/utbot/framework/codegen/model/CodeGenerator.kt | 0 .../org/utbot/framework/codegen/tree/ututils/UtilClassKind.kt | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) delete mode 100644 utbot-framework/src/main/kotlin/org/utbot/framework/codegen/model/CodeGenerator.kt diff --git a/utbot-framework/src/main/kotlin/org/utbot/framework/codegen/model/CodeGenerator.kt b/utbot-framework/src/main/kotlin/org/utbot/framework/codegen/model/CodeGenerator.kt deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/utbot-framework/src/main/kotlin/org/utbot/framework/codegen/tree/ututils/UtilClassKind.kt b/utbot-framework/src/main/kotlin/org/utbot/framework/codegen/tree/ututils/UtilClassKind.kt index 65222922a9..a38e0b4655 100644 --- a/utbot-framework/src/main/kotlin/org/utbot/framework/codegen/tree/ututils/UtilClassKind.kt +++ b/utbot-framework/src/main/kotlin/org/utbot/framework/codegen/tree/ututils/UtilClassKind.kt @@ -35,7 +35,7 @@ sealed class UtilClassKind( fun utilClassDocumentation(codegenLanguage: CodegenLanguage): CgDocumentationComment = CgDocumentationComment( listOf( - CgDocRegularStmt(utilClassKindCommentText), + CgDocRegularStmt("$utilClassKindCommentText \n"), CgDocRegularStmt("$UTIL_CLASS_VERSION_COMMENT_PREFIX${utilClassVersion(codegenLanguage)}"), ) )