Skip to content

Commit 4c29331

Browse files
committed
Disabled Kotlin codegen tests with static mocks
1 parent a53d179 commit 4c29331

File tree

5 files changed

+57
-7
lines changed

5 files changed

+57
-7
lines changed

utbot-framework-test/src/test/kotlin/org/utbot/examples/algorithms/SortTest.kt

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,20 @@ import org.utbot.framework.plugin.api.DocPreTagStatement
99
import org.utbot.framework.plugin.api.DocRegularStmt
1010
import org.utbot.framework.plugin.api.MockStrategyApi
1111
import org.junit.jupiter.api.Test
12+
import org.utbot.framework.plugin.api.CodegenLanguage
1213
import org.utbot.testcheckers.eq
1314
import org.utbot.testcheckers.ge
14-
15-
internal class SortTest : UtValueTestCaseChecker(testClass = Sort::class) {
15+
import org.utbot.tests.infrastructure.CodeGeneration
16+
17+
// TODO Kotlin mocks generics https://github.com/UnitTestBot/UTBotJava/issues/88
18+
internal class SortTest : UtValueTestCaseChecker(
19+
testClass = Sort::class,
20+
testCodeGeneration = true,
21+
languagePipelines = listOf(
22+
CodeGenerationLanguageLastStage(CodegenLanguage.JAVA),
23+
CodeGenerationLanguageLastStage(CodegenLanguage.KOTLIN, CodeGeneration)
24+
)
25+
) {
1626
@Test
1727
fun testQuickSort() {
1828
check(

utbot-framework-test/src/test/kotlin/org/utbot/examples/mock/MockRandomTest.kt

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,19 @@ import org.utbot.framework.plugin.api.UtCompositeModel
1111
import org.utbot.framework.plugin.api.UtNewInstanceInstrumentation
1212
import java.util.Random
1313
import org.junit.jupiter.api.Test
14+
import org.utbot.framework.plugin.api.CodegenLanguage
1415
import org.utbot.testcheckers.eq
15-
16-
internal class MockRandomTest : UtValueTestCaseChecker(testClass = MockRandomExamples::class) {
16+
import org.utbot.tests.infrastructure.CodeGeneration
17+
18+
// TODO Kotlin mocks generics https://github.com/UnitTestBot/UTBotJava/issues/88
19+
internal class MockRandomTest : UtValueTestCaseChecker(
20+
testClass = MockRandomExamples::class,
21+
testCodeGeneration = true,
22+
languagePipelines = listOf(
23+
CodeGenerationLanguageLastStage(CodegenLanguage.JAVA),
24+
CodeGenerationLanguageLastStage(CodegenLanguage.KOTLIN, CodeGeneration)
25+
)
26+
) {
1727
@Test
1828
fun testRandomAsParameter() {
1929
val method: Random.() -> Int = Random::nextInt

utbot-framework-test/src/test/kotlin/org/utbot/examples/mock/MockStaticMethodExampleTest.kt

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,19 @@ import org.utbot.framework.util.singleModel
88
import org.utbot.framework.util.singleStaticMethod
99
import org.utbot.framework.util.singleValue
1010
import org.junit.jupiter.api.Test
11+
import org.utbot.framework.plugin.api.CodegenLanguage
1112
import org.utbot.testcheckers.eq
13+
import org.utbot.tests.infrastructure.CodeGeneration
1214

13-
internal class MockStaticMethodExampleTest : UtValueTestCaseChecker(testClass = MockStaticMethodExample::class) {
15+
// TODO Kotlin mocks generics https://github.com/UnitTestBot/UTBotJava/issues/88
16+
internal class MockStaticMethodExampleTest : UtValueTestCaseChecker(
17+
testClass = MockStaticMethodExample::class,
18+
testCodeGeneration = true,
19+
languagePipelines = listOf(
20+
CodeGenerationLanguageLastStage(CodegenLanguage.JAVA),
21+
CodeGenerationLanguageLastStage(CodegenLanguage.KOTLIN, CodeGeneration)
22+
)
23+
) {
1424
@Test
1525
fun testUseStaticMethod() {
1626
checkMocksAndInstrumentation(

utbot-framework-test/src/test/kotlin/org/utbot/examples/natives/NativeExamplesTest.kt

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,21 @@ package org.utbot.examples.natives
33
import org.utbot.tests.infrastructure.UtValueTestCaseChecker
44
import org.utbot.tests.infrastructure.DoNotCalculate
55
import org.junit.jupiter.api.Test
6+
import org.utbot.framework.plugin.api.CodegenLanguage
67
import org.utbot.testcheckers.eq
78
import org.utbot.testcheckers.ge
89
import org.utbot.testcheckers.withSolverTimeoutInMillis
10+
import org.utbot.tests.infrastructure.CodeGeneration
911

10-
internal class NativeExamplesTest : UtValueTestCaseChecker(testClass = NativeExamples::class) {
12+
// TODO Kotlin mocks generics https://github.com/UnitTestBot/UTBotJava/issues/88
13+
internal class NativeExamplesTest : UtValueTestCaseChecker(
14+
testClass = NativeExamples::class,
15+
testCodeGeneration = true,
16+
languagePipelines = listOf(
17+
CodeGenerationLanguageLastStage(CodegenLanguage.JAVA),
18+
CodeGenerationLanguageLastStage(CodegenLanguage.KOTLIN, CodeGeneration)
19+
)
20+
) {
1121

1222
@Test
1323
fun testFindAndPrintSum() {

utbot-framework-test/src/test/kotlin/org/utbot/examples/recursion/RecursionTest.kt

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,20 @@ import org.utbot.framework.plugin.api.DocStatement
1313
import kotlin.math.pow
1414
import org.junit.jupiter.api.Disabled
1515
import org.junit.jupiter.api.Test
16+
import org.utbot.framework.plugin.api.CodegenLanguage
1617
import org.utbot.testcheckers.eq
1718
import org.utbot.testcheckers.ge
19+
import org.utbot.tests.infrastructure.CodeGeneration
1820

19-
internal class RecursionTest : UtValueTestCaseChecker(testClass = Recursion::class) {
21+
// TODO Kotlin mocks generics https://github.com/UnitTestBot/UTBotJava/issues/88
22+
internal class RecursionTest : UtValueTestCaseChecker(
23+
testClass = Recursion::class,
24+
testCodeGeneration = true,
25+
languagePipelines = listOf(
26+
CodeGenerationLanguageLastStage(CodegenLanguage.JAVA),
27+
CodeGenerationLanguageLastStage(CodegenLanguage.KOTLIN, CodeGeneration)
28+
)
29+
) {
2030
@Test
2131
fun testFactorial() {
2232
val factorialSummary = listOf<DocStatement>(

0 commit comments

Comments
 (0)