diff --git a/utbot-framework-api/src/main/kotlin/org/utbot/framework/plugin/api/Api.kt b/utbot-framework-api/src/main/kotlin/org/utbot/framework/plugin/api/Api.kt index ae9921257e..491e87cb1b 100644 --- a/utbot-framework-api/src/main/kotlin/org/utbot/framework/plugin/api/Api.kt +++ b/utbot-framework-api/src/main/kotlin/org/utbot/framework/plugin/api/Api.kt @@ -136,6 +136,8 @@ class UtSymbolicExecution( val staticFields: Set get() = stateBefore.statics.keys + var containsMocking: Boolean = false + override fun toString(): String = buildString { append("UtSymbolicExecution(") appendLine() diff --git a/utbot-framework-test/src/test/kotlin/org/utbot/examples/algorithms/CorrectBracketSequencesTest.kt b/utbot-framework-test/src/test/kotlin/org/utbot/examples/algorithms/CorrectBracketSequencesTest.kt index d19f753319..02e9eae72a 100644 --- a/utbot-framework-test/src/test/kotlin/org/utbot/examples/algorithms/CorrectBracketSequencesTest.kt +++ b/utbot-framework-test/src/test/kotlin/org/utbot/examples/algorithms/CorrectBracketSequencesTest.kt @@ -17,9 +17,9 @@ import org.utbot.tests.infrastructure.CodeGeneration internal class CorrectBracketSequencesTest : UtValueTestCaseChecker( testClass = CorrectBracketSequences::class, testCodeGeneration = true, - languagePipelines = listOf( - CodeGenerationLanguageLastStage(CodegenLanguage.JAVA), - CodeGenerationLanguageLastStage(CodegenLanguage.KOTLIN, CodeGeneration) // TODO generics in lists + pipelines = listOf( + TestLastStage(CodegenLanguage.JAVA), + TestLastStage(CodegenLanguage.KOTLIN, CodeGeneration) // TODO generics in lists ) ) { @Test diff --git a/utbot-framework-test/src/test/kotlin/org/utbot/examples/algorithms/SortTest.kt b/utbot-framework-test/src/test/kotlin/org/utbot/examples/algorithms/SortTest.kt index c761456052..0df50b9009 100644 --- a/utbot-framework-test/src/test/kotlin/org/utbot/examples/algorithms/SortTest.kt +++ b/utbot-framework-test/src/test/kotlin/org/utbot/examples/algorithms/SortTest.kt @@ -18,9 +18,9 @@ import org.utbot.tests.infrastructure.CodeGeneration internal class SortTest : UtValueTestCaseChecker( testClass = Sort::class, testCodeGeneration = true, - languagePipelines = listOf( - CodeGenerationLanguageLastStage(CodegenLanguage.JAVA), - CodeGenerationLanguageLastStage(CodegenLanguage.KOTLIN, CodeGeneration) + pipelines = listOf( + TestLastStage(CodegenLanguage.JAVA), + TestLastStage(CodegenLanguage.KOTLIN, CodeGeneration) ) ) { @Test diff --git a/utbot-framework-test/src/test/kotlin/org/utbot/examples/arrays/ArrayOfObjectsTest.kt b/utbot-framework-test/src/test/kotlin/org/utbot/examples/arrays/ArrayOfObjectsTest.kt index 5f67396996..ae4fd7b874 100644 --- a/utbot-framework-test/src/test/kotlin/org/utbot/examples/arrays/ArrayOfObjectsTest.kt +++ b/utbot-framework-test/src/test/kotlin/org/utbot/examples/arrays/ArrayOfObjectsTest.kt @@ -16,9 +16,9 @@ import org.utbot.tests.infrastructure.CodeGeneration internal class ArrayOfObjectsTest : UtValueTestCaseChecker( testClass = ArrayOfObjects::class, testCodeGeneration = true, - languagePipelines = listOf( - CodeGenerationLanguageLastStage(CodegenLanguage.JAVA), - CodeGenerationLanguageLastStage(CodegenLanguage.KOTLIN, CodeGeneration) + pipelines = listOf( + TestLastStage(CodegenLanguage.JAVA), + TestLastStage(CodegenLanguage.KOTLIN, CodeGeneration) ) ) { @Test diff --git a/utbot-framework-test/src/test/kotlin/org/utbot/examples/arrays/ArrayStoreExceptionExamplesTest.kt b/utbot-framework-test/src/test/kotlin/org/utbot/examples/arrays/ArrayStoreExceptionExamplesTest.kt index 2e6fdc5b49..0d23117b75 100644 --- a/utbot-framework-test/src/test/kotlin/org/utbot/examples/arrays/ArrayStoreExceptionExamplesTest.kt +++ b/utbot-framework-test/src/test/kotlin/org/utbot/examples/arrays/ArrayStoreExceptionExamplesTest.kt @@ -11,10 +11,10 @@ import org.utbot.tests.infrastructure.isException class ArrayStoreExceptionExamplesTest : UtValueTestCaseChecker( testClass = ArrayStoreExceptionExamples::class, - languagePipelines = listOf( - CodeGenerationLanguageLastStage(CodegenLanguage.JAVA), + pipelines = listOf( + TestLastStage(CodegenLanguage.JAVA), // Type inference errors in generated Kotlin code - CodeGenerationLanguageLastStage(CodegenLanguage.KOTLIN, CodeGeneration) + TestLastStage(CodegenLanguage.KOTLIN, CodeGeneration) ) ) { @Test diff --git a/utbot-framework-test/src/test/kotlin/org/utbot/examples/arrays/ArraysOverwriteValueTest.kt b/utbot-framework-test/src/test/kotlin/org/utbot/examples/arrays/ArraysOverwriteValueTest.kt index 3f0bab6159..00f896bfe8 100644 --- a/utbot-framework-test/src/test/kotlin/org/utbot/examples/arrays/ArraysOverwriteValueTest.kt +++ b/utbot-framework-test/src/test/kotlin/org/utbot/examples/arrays/ArraysOverwriteValueTest.kt @@ -10,9 +10,9 @@ import org.utbot.tests.infrastructure.CodeGeneration class ArraysOverwriteValueTest : UtValueTestCaseChecker( testClass = ArraysOverwriteValue::class, testCodeGeneration = true, - languagePipelines = listOf( - CodeGenerationLanguageLastStage(CodegenLanguage.JAVA), - CodeGenerationLanguageLastStage(CodegenLanguage.KOTLIN, CodeGeneration) + pipelines = listOf( + TestLastStage(CodegenLanguage.JAVA), + TestLastStage(CodegenLanguage.KOTLIN, CodeGeneration) ) ) { @Test diff --git a/utbot-framework-test/src/test/kotlin/org/utbot/examples/arrays/IntArrayBasicsTest.kt b/utbot-framework-test/src/test/kotlin/org/utbot/examples/arrays/IntArrayBasicsTest.kt index 89cd68e821..158d2402fd 100644 --- a/utbot-framework-test/src/test/kotlin/org/utbot/examples/arrays/IntArrayBasicsTest.kt +++ b/utbot-framework-test/src/test/kotlin/org/utbot/examples/arrays/IntArrayBasicsTest.kt @@ -14,9 +14,9 @@ import org.utbot.tests.infrastructure.CodeGeneration internal class IntArrayBasicsTest : UtValueTestCaseChecker( testClass = IntArrayBasics::class, testCodeGeneration = true, - languagePipelines = listOf( - CodeGenerationLanguageLastStage(CodegenLanguage.JAVA), - CodeGenerationLanguageLastStage(CodegenLanguage.KOTLIN, CodeGeneration) + pipelines = listOf( + TestLastStage(CodegenLanguage.JAVA), + TestLastStage(CodegenLanguage.KOTLIN, CodeGeneration) ) ) { @Test diff --git a/utbot-framework-test/src/test/kotlin/org/utbot/examples/arrays/PrimitiveArraysTest.kt b/utbot-framework-test/src/test/kotlin/org/utbot/examples/arrays/PrimitiveArraysTest.kt index 93353521fe..f2009247aa 100644 --- a/utbot-framework-test/src/test/kotlin/org/utbot/examples/arrays/PrimitiveArraysTest.kt +++ b/utbot-framework-test/src/test/kotlin/org/utbot/examples/arrays/PrimitiveArraysTest.kt @@ -12,9 +12,9 @@ import org.utbot.tests.infrastructure.CodeGeneration internal class PrimitiveArraysTest : UtValueTestCaseChecker( testClass = PrimitiveArrays::class, testCodeGeneration = true, - languagePipelines = listOf( - CodeGenerationLanguageLastStage(CodegenLanguage.JAVA), - CodeGenerationLanguageLastStage(CodegenLanguage.KOTLIN, CodeGeneration) + pipelines = listOf( + TestLastStage(CodegenLanguage.JAVA), + TestLastStage(CodegenLanguage.KOTLIN, CodeGeneration) ) ) { @Test diff --git a/utbot-framework-test/src/test/kotlin/org/utbot/examples/casts/ArrayCastExampleTest.kt b/utbot-framework-test/src/test/kotlin/org/utbot/examples/casts/ArrayCastExampleTest.kt index e57047e56c..78a2a8b548 100644 --- a/utbot-framework-test/src/test/kotlin/org/utbot/examples/casts/ArrayCastExampleTest.kt +++ b/utbot-framework-test/src/test/kotlin/org/utbot/examples/casts/ArrayCastExampleTest.kt @@ -13,9 +13,9 @@ import org.utbot.tests.infrastructure.CodeGeneration internal class ArrayCastExampleTest : UtValueTestCaseChecker( testClass = ArrayCastExample::class, testCodeGeneration = true, - languagePipelines = listOf( - CodeGenerationLanguageLastStage(CodegenLanguage.JAVA), - CodeGenerationLanguageLastStage(CodegenLanguage.KOTLIN, CodeGeneration) + pipelines = listOf( + TestLastStage(CodegenLanguage.JAVA), + TestLastStage(CodegenLanguage.KOTLIN, CodeGeneration) ) ) { @Test diff --git a/utbot-framework-test/src/test/kotlin/org/utbot/examples/casts/CastClassTest.kt b/utbot-framework-test/src/test/kotlin/org/utbot/examples/casts/CastClassTest.kt index 8444e963cf..0de77bbb9d 100644 --- a/utbot-framework-test/src/test/kotlin/org/utbot/examples/casts/CastClassTest.kt +++ b/utbot-framework-test/src/test/kotlin/org/utbot/examples/casts/CastClassTest.kt @@ -10,9 +10,9 @@ import org.utbot.tests.infrastructure.CodeGeneration internal class CastClassTest : UtValueTestCaseChecker( testClass = CastClass::class, testCodeGeneration = true, - languagePipelines = listOf( - CodeGenerationLanguageLastStage(CodegenLanguage.JAVA), - CodeGenerationLanguageLastStage(CodegenLanguage.KOTLIN, CodeGeneration) + pipelines = listOf( + TestLastStage(CodegenLanguage.JAVA), + TestLastStage(CodegenLanguage.KOTLIN, CodeGeneration) ) ) { @Test diff --git a/utbot-framework-test/src/test/kotlin/org/utbot/examples/casts/CastExampleTest.kt b/utbot-framework-test/src/test/kotlin/org/utbot/examples/casts/CastExampleTest.kt index cc6078c0f7..7e48a85432 100644 --- a/utbot-framework-test/src/test/kotlin/org/utbot/examples/casts/CastExampleTest.kt +++ b/utbot-framework-test/src/test/kotlin/org/utbot/examples/casts/CastExampleTest.kt @@ -12,9 +12,9 @@ import org.utbot.tests.infrastructure.CodeGeneration internal class CastExampleTest : UtValueTestCaseChecker( testClass = CastExample::class, testCodeGeneration = true, - languagePipelines = listOf( - CodeGenerationLanguageLastStage(CodegenLanguage.JAVA), - CodeGenerationLanguageLastStage(CodegenLanguage.KOTLIN, CodeGeneration) + pipelines = listOf( + TestLastStage(CodegenLanguage.JAVA), + TestLastStage(CodegenLanguage.KOTLIN, CodeGeneration) ) ) { @Test diff --git a/utbot-framework-test/src/test/kotlin/org/utbot/examples/casts/GenericCastExampleTest.kt b/utbot-framework-test/src/test/kotlin/org/utbot/examples/casts/GenericCastExampleTest.kt index d903203673..faa8f103f4 100644 --- a/utbot-framework-test/src/test/kotlin/org/utbot/examples/casts/GenericCastExampleTest.kt +++ b/utbot-framework-test/src/test/kotlin/org/utbot/examples/casts/GenericCastExampleTest.kt @@ -12,9 +12,9 @@ import org.utbot.tests.infrastructure.CodeGeneration internal class GenericCastExampleTest : UtValueTestCaseChecker( testClass = GenericCastExample::class, testCodeGeneration = true, - languagePipelines = listOf( - CodeGenerationLanguageLastStage(CodegenLanguage.JAVA), - CodeGenerationLanguageLastStage(CodegenLanguage.KOTLIN, CodeGeneration) + pipelines = listOf( + TestLastStage(CodegenLanguage.JAVA), + TestLastStage(CodegenLanguage.KOTLIN, CodeGeneration) ) ) { @Test diff --git a/utbot-framework-test/src/test/kotlin/org/utbot/examples/casts/InstanceOfExampleTest.kt b/utbot-framework-test/src/test/kotlin/org/utbot/examples/casts/InstanceOfExampleTest.kt index 2b4561ecf3..3120762937 100644 --- a/utbot-framework-test/src/test/kotlin/org/utbot/examples/casts/InstanceOfExampleTest.kt +++ b/utbot-framework-test/src/test/kotlin/org/utbot/examples/casts/InstanceOfExampleTest.kt @@ -14,9 +14,9 @@ import org.utbot.tests.infrastructure.CodeGeneration internal class InstanceOfExampleTest : UtValueTestCaseChecker( testClass = InstanceOfExample::class, testCodeGeneration = true, - languagePipelines = listOf( - CodeGenerationLanguageLastStage(CodegenLanguage.JAVA), - CodeGenerationLanguageLastStage(CodegenLanguage.KOTLIN, CodeGeneration) + pipelines = listOf( + TestLastStage(CodegenLanguage.JAVA), + TestLastStage(CodegenLanguage.KOTLIN, CodeGeneration) ) ) { @Test diff --git a/utbot-framework-test/src/test/kotlin/org/utbot/examples/codegen/ClassWithStaticAndInnerClassesTest.kt b/utbot-framework-test/src/test/kotlin/org/utbot/examples/codegen/ClassWithStaticAndInnerClassesTest.kt index ee12e07204..0f9f32fdb7 100644 --- a/utbot-framework-test/src/test/kotlin/org/utbot/examples/codegen/ClassWithStaticAndInnerClassesTest.kt +++ b/utbot-framework-test/src/test/kotlin/org/utbot/examples/codegen/ClassWithStaticAndInnerClassesTest.kt @@ -3,10 +3,19 @@ package org.utbot.examples.codegen import org.utbot.tests.infrastructure.UtValueTestCaseChecker import org.utbot.tests.infrastructure.DoNotCalculate import org.junit.jupiter.api.Test +import org.utbot.framework.plugin.api.CodegenLanguage import org.utbot.testcheckers.eq +import org.utbot.tests.infrastructure.Compilation +import org.utbot.tests.infrastructure.TestExecution @Suppress("INACCESSIBLE_TYPE") -internal class ClassWithStaticAndInnerClassesTest : UtValueTestCaseChecker(testClass = ClassWithStaticAndInnerClasses::class) { +internal class ClassWithStaticAndInnerClassesTest : UtValueTestCaseChecker( + testClass = ClassWithStaticAndInnerClasses::class, + pipelines = listOf( + TestLastStage(CodegenLanguage.JAVA, lastStage = TestExecution, parameterizedModeLastStage = Compilation), + TestLastStage(CodegenLanguage.KOTLIN, lastStage = TestExecution) + ) +) { @Test fun testUsePrivateStaticClassWithPrivateField() { check( diff --git a/utbot-framework-test/src/test/kotlin/org/utbot/examples/codegen/VoidStaticMethodsTest.kt b/utbot-framework-test/src/test/kotlin/org/utbot/examples/codegen/VoidStaticMethodsTest.kt index 65c76c7bd1..2348360e27 100644 --- a/utbot-framework-test/src/test/kotlin/org/utbot/examples/codegen/VoidStaticMethodsTest.kt +++ b/utbot-framework-test/src/test/kotlin/org/utbot/examples/codegen/VoidStaticMethodsTest.kt @@ -3,9 +3,12 @@ package org.utbot.examples.codegen import org.utbot.tests.infrastructure.UtValueTestCaseChecker import org.utbot.tests.infrastructure.DoNotCalculate import org.junit.jupiter.api.Test +import org.utbot.framework.plugin.api.CodegenLanguage import org.utbot.testcheckers.eq +import org.utbot.tests.infrastructure.Compilation -class VoidStaticMethodsTest : UtValueTestCaseChecker(testClass = VoidStaticMethodsTestingClass::class) { +class VoidStaticMethodsTest : UtValueTestCaseChecker( + testClass = VoidStaticMethodsTestingClass::class) { @Test fun testInvokeChangeStaticFieldMethod() { check( diff --git a/utbot-framework-test/src/test/kotlin/org/utbot/examples/codegen/deepequals/ClassWithCrossReferenceRelationshipTest.kt b/utbot-framework-test/src/test/kotlin/org/utbot/examples/codegen/deepequals/ClassWithCrossReferenceRelationshipTest.kt index 3d62c2acb2..d7ca1dc689 100644 --- a/utbot-framework-test/src/test/kotlin/org/utbot/examples/codegen/deepequals/ClassWithCrossReferenceRelationshipTest.kt +++ b/utbot-framework-test/src/test/kotlin/org/utbot/examples/codegen/deepequals/ClassWithCrossReferenceRelationshipTest.kt @@ -10,9 +10,9 @@ import org.utbot.tests.infrastructure.UtValueTestCaseChecker class ClassWithCrossReferenceRelationshipTest : UtValueTestCaseChecker( testClass = ClassWithCrossReferenceRelationship::class, testCodeGeneration = true, - languagePipelines = listOf( - CodeGenerationLanguageLastStage(CodegenLanguage.JAVA), - CodeGenerationLanguageLastStage(CodegenLanguage.KOTLIN, CodeGeneration) + pipelines = listOf( + TestLastStage(CodegenLanguage.JAVA), + TestLastStage(CodegenLanguage.KOTLIN, CodeGeneration) ) ) { @Test diff --git a/utbot-framework-test/src/test/kotlin/org/utbot/examples/codegen/deepequals/ClassWithNullableFieldTest.kt b/utbot-framework-test/src/test/kotlin/org/utbot/examples/codegen/deepequals/ClassWithNullableFieldTest.kt index 7b29e44c7e..f39c394b4b 100644 --- a/utbot-framework-test/src/test/kotlin/org/utbot/examples/codegen/deepequals/ClassWithNullableFieldTest.kt +++ b/utbot-framework-test/src/test/kotlin/org/utbot/examples/codegen/deepequals/ClassWithNullableFieldTest.kt @@ -10,9 +10,9 @@ import org.utbot.tests.infrastructure.CodeGeneration class ClassWithNullableFieldTest : UtValueTestCaseChecker( testClass = ClassWithNullableField::class, testCodeGeneration = true, - languagePipelines = listOf( - CodeGenerationLanguageLastStage(CodegenLanguage.JAVA), - CodeGenerationLanguageLastStage(CodegenLanguage.KOTLIN, CodeGeneration) + pipelines = listOf( + TestLastStage(CodegenLanguage.JAVA), + TestLastStage(CodegenLanguage.KOTLIN, CodeGeneration) ) ) { @Test diff --git a/utbot-framework-test/src/test/kotlin/org/utbot/examples/codegen/deepequals/DeepEqualsTest.kt b/utbot-framework-test/src/test/kotlin/org/utbot/examples/codegen/deepequals/DeepEqualsTest.kt index 6fd453ca51..398a7be8fc 100644 --- a/utbot-framework-test/src/test/kotlin/org/utbot/examples/codegen/deepequals/DeepEqualsTest.kt +++ b/utbot-framework-test/src/test/kotlin/org/utbot/examples/codegen/deepequals/DeepEqualsTest.kt @@ -12,9 +12,9 @@ import org.utbot.tests.infrastructure.CodeGeneration class DeepEqualsTest : UtValueTestCaseChecker( testClass = DeepEqualsTestingClass::class, testCodeGeneration = true, - languagePipelines = listOf( - CodeGenerationLanguageLastStage(CodegenLanguage.JAVA), - CodeGenerationLanguageLastStage(CodegenLanguage.KOTLIN, CodeGeneration) + pipelines = listOf( + TestLastStage(CodegenLanguage.JAVA), + TestLastStage(CodegenLanguage.KOTLIN, CodeGeneration) ) ) { @Test diff --git a/utbot-framework-test/src/test/kotlin/org/utbot/examples/collections/CustomerExamplesTest.kt b/utbot-framework-test/src/test/kotlin/org/utbot/examples/collections/CustomerExamplesTest.kt index 72e5dadcd7..5723e045dd 100644 --- a/utbot-framework-test/src/test/kotlin/org/utbot/examples/collections/CustomerExamplesTest.kt +++ b/utbot-framework-test/src/test/kotlin/org/utbot/examples/collections/CustomerExamplesTest.kt @@ -9,13 +9,15 @@ import org.utbot.framework.plugin.api.UtConcreteValue import org.junit.jupiter.api.Test import org.utbot.testcheckers.eq import org.utbot.tests.infrastructure.CodeGeneration +import org.utbot.tests.infrastructure.Compilation +import org.utbot.tests.infrastructure.TestExecution internal class CustomerExamplesTest: UtValueTestCaseChecker( testClass = CustomerExamples::class, testCodeGeneration = true, - languagePipelines = listOf( - CodeGenerationLanguageLastStage(CodegenLanguage.JAVA), - CodeGenerationLanguageLastStage(CodegenLanguage.KOTLIN, CodeGeneration) + pipelines = listOf( + TestLastStage(CodegenLanguage.JAVA, lastStage = TestExecution, parameterizedModeLastStage = Compilation), + TestLastStage(CodegenLanguage.KOTLIN, lastStage = CodeGeneration) ) ) { @Test diff --git a/utbot-framework-test/src/test/kotlin/org/utbot/examples/collections/GenericListsExampleTest.kt b/utbot-framework-test/src/test/kotlin/org/utbot/examples/collections/GenericListsExampleTest.kt index f3746e865c..6c541525ab 100644 --- a/utbot-framework-test/src/test/kotlin/org/utbot/examples/collections/GenericListsExampleTest.kt +++ b/utbot-framework-test/src/test/kotlin/org/utbot/examples/collections/GenericListsExampleTest.kt @@ -12,9 +12,9 @@ import org.utbot.tests.infrastructure.CodeGeneration internal class GenericListsExampleTest : UtValueTestCaseChecker( testClass = GenericListsExample::class, testCodeGeneration = true, - languagePipelines = listOf( - CodeGenerationLanguageLastStage(CodegenLanguage.JAVA), - CodeGenerationLanguageLastStage(CodegenLanguage.KOTLIN, CodeGeneration) + pipelines = listOf( + TestLastStage(CodegenLanguage.JAVA), + TestLastStage(CodegenLanguage.KOTLIN, CodeGeneration) ) ) { @Test diff --git a/utbot-framework-test/src/test/kotlin/org/utbot/examples/collections/LinkedListsTest.kt b/utbot-framework-test/src/test/kotlin/org/utbot/examples/collections/LinkedListsTest.kt index 7bc1497ffe..d8fa642c3f 100644 --- a/utbot-framework-test/src/test/kotlin/org/utbot/examples/collections/LinkedListsTest.kt +++ b/utbot-framework-test/src/test/kotlin/org/utbot/examples/collections/LinkedListsTest.kt @@ -12,9 +12,9 @@ import org.utbot.tests.infrastructure.CodeGeneration internal class LinkedListsTest : UtValueTestCaseChecker( testClass = LinkedLists::class, testCodeGeneration = true, - languagePipelines = listOf( - CodeGenerationLanguageLastStage(CodegenLanguage.JAVA), - CodeGenerationLanguageLastStage(CodegenLanguage.KOTLIN, CodeGeneration) + pipelines = listOf( + TestLastStage(CodegenLanguage.JAVA), + TestLastStage(CodegenLanguage.KOTLIN, CodeGeneration) ) ) { diff --git a/utbot-framework-test/src/test/kotlin/org/utbot/examples/collections/ListAlgorithmsTest.kt b/utbot-framework-test/src/test/kotlin/org/utbot/examples/collections/ListAlgorithmsTest.kt index 714c790228..9e88ec075a 100644 --- a/utbot-framework-test/src/test/kotlin/org/utbot/examples/collections/ListAlgorithmsTest.kt +++ b/utbot-framework-test/src/test/kotlin/org/utbot/examples/collections/ListAlgorithmsTest.kt @@ -11,9 +11,9 @@ import org.utbot.tests.infrastructure.CodeGeneration class ListAlgorithmsTest : UtValueTestCaseChecker( testClass = ListAlgorithms::class, testCodeGeneration = true, - languagePipelines = listOf( - CodeGenerationLanguageLastStage(CodegenLanguage.JAVA), - CodeGenerationLanguageLastStage(CodegenLanguage.KOTLIN, CodeGeneration) + pipelines = listOf( + TestLastStage(CodegenLanguage.JAVA), + TestLastStage(CodegenLanguage.KOTLIN, CodeGeneration) ) ) { diff --git a/utbot-framework-test/src/test/kotlin/org/utbot/examples/collections/ListIteratorsTest.kt b/utbot-framework-test/src/test/kotlin/org/utbot/examples/collections/ListIteratorsTest.kt index 053a1fa1da..153d845930 100644 --- a/utbot-framework-test/src/test/kotlin/org/utbot/examples/collections/ListIteratorsTest.kt +++ b/utbot-framework-test/src/test/kotlin/org/utbot/examples/collections/ListIteratorsTest.kt @@ -14,9 +14,9 @@ import org.utbot.tests.infrastructure.CodeGeneration internal class ListIteratorsTest : UtValueTestCaseChecker( testClass = ListIterators::class, testCodeGeneration = true, - languagePipelines = listOf( - CodeGenerationLanguageLastStage(CodegenLanguage.JAVA), - CodeGenerationLanguageLastStage(CodegenLanguage.KOTLIN, CodeGeneration) + pipelines = listOf( + TestLastStage(CodegenLanguage.JAVA), + TestLastStage(CodegenLanguage.KOTLIN, CodeGeneration) ) ) { diff --git a/utbot-framework-test/src/test/kotlin/org/utbot/examples/collections/ListWrapperReturnsVoidTest.kt b/utbot-framework-test/src/test/kotlin/org/utbot/examples/collections/ListWrapperReturnsVoidTest.kt index b1356ecb47..8916476ec9 100644 --- a/utbot-framework-test/src/test/kotlin/org/utbot/examples/collections/ListWrapperReturnsVoidTest.kt +++ b/utbot-framework-test/src/test/kotlin/org/utbot/examples/collections/ListWrapperReturnsVoidTest.kt @@ -14,9 +14,9 @@ import org.utbot.tests.infrastructure.CodeGeneration internal class ListWrapperReturnsVoidTest : UtValueTestCaseChecker( testClass = ListWrapperReturnsVoidExample::class, testCodeGeneration = true, - languagePipelines = listOf( - CodeGenerationLanguageLastStage(CodegenLanguage.JAVA), - CodeGenerationLanguageLastStage(CodegenLanguage.KOTLIN, CodeGeneration) + pipelines = listOf( + TestLastStage(CodegenLanguage.JAVA), + TestLastStage(CodegenLanguage.KOTLIN, CodeGeneration) ) ) { @Test diff --git a/utbot-framework-test/src/test/kotlin/org/utbot/examples/collections/ListsPart1Test.kt b/utbot-framework-test/src/test/kotlin/org/utbot/examples/collections/ListsPart1Test.kt index 0564bf685c..cec153c583 100644 --- a/utbot-framework-test/src/test/kotlin/org/utbot/examples/collections/ListsPart1Test.kt +++ b/utbot-framework-test/src/test/kotlin/org/utbot/examples/collections/ListsPart1Test.kt @@ -12,9 +12,9 @@ import org.utbot.tests.infrastructure.CodeGeneration internal class ListsPart1Test : UtValueTestCaseChecker( testClass = Lists::class, testCodeGeneration = true, - languagePipelines = listOf( - CodeGenerationLanguageLastStage(CodegenLanguage.JAVA), - CodeGenerationLanguageLastStage(CodegenLanguage.KOTLIN, CodeGeneration) + pipelines = listOf( + TestLastStage(CodegenLanguage.JAVA), + TestLastStage(CodegenLanguage.KOTLIN, CodeGeneration) ) ) { @Test diff --git a/utbot-framework-test/src/test/kotlin/org/utbot/examples/collections/ListsPart2Test.kt b/utbot-framework-test/src/test/kotlin/org/utbot/examples/collections/ListsPart2Test.kt index dd62849c37..166e321fc1 100644 --- a/utbot-framework-test/src/test/kotlin/org/utbot/examples/collections/ListsPart2Test.kt +++ b/utbot-framework-test/src/test/kotlin/org/utbot/examples/collections/ListsPart2Test.kt @@ -12,9 +12,9 @@ import org.utbot.tests.infrastructure.ignoreExecutionsNumber internal class ListsPart2Test : UtValueTestCaseChecker( testClass = Lists::class, testCodeGeneration = true, - languagePipelines = listOf( - CodeGenerationLanguageLastStage(CodegenLanguage.JAVA), - CodeGenerationLanguageLastStage(CodegenLanguage.KOTLIN, CodeGeneration) + pipelines = listOf( + TestLastStage(CodegenLanguage.JAVA), + TestLastStage(CodegenLanguage.KOTLIN, CodeGeneration) ) ) { @Test diff --git a/utbot-framework-test/src/test/kotlin/org/utbot/examples/collections/ListsPart3Test.kt b/utbot-framework-test/src/test/kotlin/org/utbot/examples/collections/ListsPart3Test.kt index 5242bc47d3..d02f176ed8 100644 --- a/utbot-framework-test/src/test/kotlin/org/utbot/examples/collections/ListsPart3Test.kt +++ b/utbot-framework-test/src/test/kotlin/org/utbot/examples/collections/ListsPart3Test.kt @@ -15,9 +15,9 @@ import org.utbot.tests.infrastructure.CodeGeneration internal class ListsPart3Test : UtValueTestCaseChecker( testClass = Lists::class, testCodeGeneration = true, - languagePipelines = listOf( - CodeGenerationLanguageLastStage(CodegenLanguage.JAVA), - CodeGenerationLanguageLastStage(CodegenLanguage.KOTLIN, CodeGeneration) + pipelines = listOf( + TestLastStage(CodegenLanguage.JAVA), + TestLastStage(CodegenLanguage.KOTLIN, CodeGeneration) ) ) { @Test diff --git a/utbot-framework-test/src/test/kotlin/org/utbot/examples/collections/MapEntrySetTest.kt b/utbot-framework-test/src/test/kotlin/org/utbot/examples/collections/MapEntrySetTest.kt index 0139515e59..7d62a1fa88 100644 --- a/utbot-framework-test/src/test/kotlin/org/utbot/examples/collections/MapEntrySetTest.kt +++ b/utbot-framework-test/src/test/kotlin/org/utbot/examples/collections/MapEntrySetTest.kt @@ -16,9 +16,9 @@ import org.utbot.tests.infrastructure.CodeGeneration class MapEntrySetTest : UtValueTestCaseChecker( testClass = MapEntrySet::class, testCodeGeneration = true, - languagePipelines = listOf( - CodeGenerationLanguageLastStage(CodegenLanguage.JAVA), - CodeGenerationLanguageLastStage(CodegenLanguage.KOTLIN, CodeGeneration) + pipelines = listOf( + TestLastStage(CodegenLanguage.JAVA), + TestLastStage(CodegenLanguage.KOTLIN, CodeGeneration) ) ) { @Test diff --git a/utbot-framework-test/src/test/kotlin/org/utbot/examples/collections/MapKeySetTest.kt b/utbot-framework-test/src/test/kotlin/org/utbot/examples/collections/MapKeySetTest.kt index d82f0a87a7..6f2a1f5f48 100644 --- a/utbot-framework-test/src/test/kotlin/org/utbot/examples/collections/MapKeySetTest.kt +++ b/utbot-framework-test/src/test/kotlin/org/utbot/examples/collections/MapKeySetTest.kt @@ -18,9 +18,9 @@ import org.utbot.tests.infrastructure.CodeGeneration class MapKeySetTest : UtValueTestCaseChecker( testClass = MapKeySet::class, testCodeGeneration = true, - languagePipelines = listOf( - CodeGenerationLanguageLastStage(CodegenLanguage.JAVA), - CodeGenerationLanguageLastStage(CodegenLanguage.KOTLIN, CodeGeneration) + pipelines = listOf( + TestLastStage(CodegenLanguage.JAVA), + TestLastStage(CodegenLanguage.KOTLIN, CodeGeneration) ) ) { @Test diff --git a/utbot-framework-test/src/test/kotlin/org/utbot/examples/collections/MapValuesTest.kt b/utbot-framework-test/src/test/kotlin/org/utbot/examples/collections/MapValuesTest.kt index 3eb88f6594..7ac0205a89 100644 --- a/utbot-framework-test/src/test/kotlin/org/utbot/examples/collections/MapValuesTest.kt +++ b/utbot-framework-test/src/test/kotlin/org/utbot/examples/collections/MapValuesTest.kt @@ -16,9 +16,9 @@ import org.utbot.tests.infrastructure.CodeGeneration class MapValuesTest : UtValueTestCaseChecker( testClass = MapValues::class, testCodeGeneration = true, - languagePipelines = listOf( - CodeGenerationLanguageLastStage(CodegenLanguage.JAVA), - CodeGenerationLanguageLastStage(CodegenLanguage.KOTLIN, CodeGeneration) + pipelines = listOf( + TestLastStage(CodegenLanguage.JAVA), + TestLastStage(CodegenLanguage.KOTLIN, CodeGeneration) ) ) { @Test diff --git a/utbot-framework-test/src/test/kotlin/org/utbot/examples/collections/MapsPart1Test.kt b/utbot-framework-test/src/test/kotlin/org/utbot/examples/collections/MapsPart1Test.kt index 80a318fd8a..926f1fad71 100644 --- a/utbot-framework-test/src/test/kotlin/org/utbot/examples/collections/MapsPart1Test.kt +++ b/utbot-framework-test/src/test/kotlin/org/utbot/examples/collections/MapsPart1Test.kt @@ -19,9 +19,9 @@ import org.utbot.tests.infrastructure.CodeGeneration internal class MapsPart1Test : UtValueTestCaseChecker( testClass = Maps::class, testCodeGeneration = true, - languagePipelines = listOf( - CodeGenerationLanguageLastStage(CodegenLanguage.JAVA), - CodeGenerationLanguageLastStage(CodegenLanguage.KOTLIN, CodeGeneration) + pipelines = listOf( + TestLastStage(CodegenLanguage.JAVA), + TestLastStage(CodegenLanguage.KOTLIN, CodeGeneration) ) ) { @Test diff --git a/utbot-framework-test/src/test/kotlin/org/utbot/examples/collections/MapsPart2Test.kt b/utbot-framework-test/src/test/kotlin/org/utbot/examples/collections/MapsPart2Test.kt index 62150776f1..b4ae041c13 100644 --- a/utbot-framework-test/src/test/kotlin/org/utbot/examples/collections/MapsPart2Test.kt +++ b/utbot-framework-test/src/test/kotlin/org/utbot/examples/collections/MapsPart2Test.kt @@ -14,9 +14,9 @@ import org.utbot.tests.infrastructure.CodeGeneration internal class MapsPart2Test : UtValueTestCaseChecker( testClass = Maps::class, testCodeGeneration = true, - languagePipelines = listOf( - CodeGenerationLanguageLastStage(CodegenLanguage.JAVA), - CodeGenerationLanguageLastStage(CodegenLanguage.KOTLIN, CodeGeneration) + pipelines = listOf( + TestLastStage(CodegenLanguage.JAVA), + TestLastStage(CodegenLanguage.KOTLIN, CodeGeneration) ) ) { @Test diff --git a/utbot-framework-test/src/test/kotlin/org/utbot/examples/collections/OptionalsTest.kt b/utbot-framework-test/src/test/kotlin/org/utbot/examples/collections/OptionalsTest.kt index d6bfec1bdd..964dd93f2c 100644 --- a/utbot-framework-test/src/test/kotlin/org/utbot/examples/collections/OptionalsTest.kt +++ b/utbot-framework-test/src/test/kotlin/org/utbot/examples/collections/OptionalsTest.kt @@ -14,9 +14,9 @@ import java.util.* class OptionalsTest : UtValueTestCaseChecker( Optionals::class, testCodeGeneration = true, - languagePipelines = listOf( - CodeGenerationLanguageLastStage(CodegenLanguage.JAVA), - CodeGenerationLanguageLastStage(CodegenLanguage.KOTLIN, CodeGeneration) + pipelines = listOf( + TestLastStage(CodegenLanguage.JAVA), + TestLastStage(CodegenLanguage.KOTLIN, CodeGeneration) ) ) { diff --git a/utbot-framework-test/src/test/kotlin/org/utbot/examples/collections/QueueUsagesTest.kt b/utbot-framework-test/src/test/kotlin/org/utbot/examples/collections/QueueUsagesTest.kt index f218b23945..69dd432ada 100644 --- a/utbot-framework-test/src/test/kotlin/org/utbot/examples/collections/QueueUsagesTest.kt +++ b/utbot-framework-test/src/test/kotlin/org/utbot/examples/collections/QueueUsagesTest.kt @@ -11,9 +11,9 @@ import org.utbot.tests.infrastructure.isException class QueueUsagesTest : UtValueTestCaseChecker( testClass = QueueUsages::class, testCodeGeneration = true, - languagePipelines = listOf( - CodeGenerationLanguageLastStage(CodegenLanguage.JAVA), - CodeGenerationLanguageLastStage(CodegenLanguage.KOTLIN, CodeGeneration) + pipelines = listOf( + TestLastStage(CodegenLanguage.JAVA), + TestLastStage(CodegenLanguage.KOTLIN, CodeGeneration) ) ) { @Test diff --git a/utbot-framework-test/src/test/kotlin/org/utbot/examples/collections/SetIteratorsTest.kt b/utbot-framework-test/src/test/kotlin/org/utbot/examples/collections/SetIteratorsTest.kt index 145a083892..bdaa3d4f14 100644 --- a/utbot-framework-test/src/test/kotlin/org/utbot/examples/collections/SetIteratorsTest.kt +++ b/utbot-framework-test/src/test/kotlin/org/utbot/examples/collections/SetIteratorsTest.kt @@ -13,9 +13,9 @@ import org.utbot.tests.infrastructure.CodeGeneration class SetIteratorsTest : UtValueTestCaseChecker( testClass = SetIterators::class, testCodeGeneration = true, - languagePipelines = listOf( - CodeGenerationLanguageLastStage(CodegenLanguage.JAVA), - CodeGenerationLanguageLastStage(CodegenLanguage.KOTLIN, CodeGeneration) + pipelines = listOf( + TestLastStage(CodegenLanguage.JAVA), + TestLastStage(CodegenLanguage.KOTLIN, CodeGeneration) ) ) { @Test diff --git a/utbot-framework-test/src/test/kotlin/org/utbot/examples/collections/SetsTest.kt b/utbot-framework-test/src/test/kotlin/org/utbot/examples/collections/SetsTest.kt index add140e79f..525e8e4126 100644 --- a/utbot-framework-test/src/test/kotlin/org/utbot/examples/collections/SetsTest.kt +++ b/utbot-framework-test/src/test/kotlin/org/utbot/examples/collections/SetsTest.kt @@ -18,9 +18,9 @@ import org.utbot.tests.infrastructure.CodeGeneration internal class SetsTest : UtValueTestCaseChecker( testClass = Sets::class, testCodeGeneration = true, - languagePipelines = listOf( - CodeGenerationLanguageLastStage(CodegenLanguage.JAVA), - CodeGenerationLanguageLastStage(CodegenLanguage.KOTLIN, CodeGeneration) + pipelines = listOf( + TestLastStage(CodegenLanguage.JAVA), + TestLastStage(CodegenLanguage.KOTLIN, CodeGeneration) ) ) { @Test diff --git a/utbot-framework-test/src/test/kotlin/org/utbot/examples/enums/ComplexEnumExamplesTest.kt b/utbot-framework-test/src/test/kotlin/org/utbot/examples/enums/ComplexEnumExamplesTest.kt index 901245dec5..7b8b064b0c 100644 --- a/utbot-framework-test/src/test/kotlin/org/utbot/examples/enums/ComplexEnumExamplesTest.kt +++ b/utbot-framework-test/src/test/kotlin/org/utbot/examples/enums/ComplexEnumExamplesTest.kt @@ -15,9 +15,9 @@ import org.utbot.tests.infrastructure.CodeGeneration class ComplexEnumExamplesTest : UtValueTestCaseChecker( testClass = ComplexEnumExamples::class, testCodeGeneration = true, - languagePipelines = listOf( - CodeGenerationLanguageLastStage(CodegenLanguage.JAVA), - CodeGenerationLanguageLastStage(CodegenLanguage.KOTLIN, CodeGeneration) + pipelines = listOf( + TestLastStage(CodegenLanguage.JAVA), + TestLastStage(CodegenLanguage.KOTLIN, CodeGeneration) ) ) { @Test diff --git a/utbot-framework-test/src/test/kotlin/org/utbot/examples/exceptions/ExceptionExamplesTest.kt b/utbot-framework-test/src/test/kotlin/org/utbot/examples/exceptions/ExceptionExamplesTest.kt index 96bc056f47..b66c17f8b2 100644 --- a/utbot-framework-test/src/test/kotlin/org/utbot/examples/exceptions/ExceptionExamplesTest.kt +++ b/utbot-framework-test/src/test/kotlin/org/utbot/examples/exceptions/ExceptionExamplesTest.kt @@ -12,9 +12,9 @@ import org.utbot.tests.infrastructure.CodeGeneration internal class ExceptionExamplesTest : UtValueTestCaseChecker( testClass = ExceptionExamples::class, testCodeGeneration = true, - languagePipelines = listOf( - CodeGenerationLanguageLastStage(CodegenLanguage.JAVA), - CodeGenerationLanguageLastStage(CodegenLanguage.KOTLIN, CodeGeneration) // TODO: fails because we construct lists with generics + pipelines = listOf( + TestLastStage(CodegenLanguage.JAVA), + TestLastStage(CodegenLanguage.KOTLIN, CodeGeneration) // TODO: fails because we construct lists with generics ) ) { @Test diff --git a/utbot-framework-test/src/test/kotlin/org/utbot/examples/lambda/CustomPredicateExampleTest.kt b/utbot-framework-test/src/test/kotlin/org/utbot/examples/lambda/CustomPredicateExampleTest.kt index 2327358339..c3b9692b3e 100644 --- a/utbot-framework-test/src/test/kotlin/org/utbot/examples/lambda/CustomPredicateExampleTest.kt +++ b/utbot-framework-test/src/test/kotlin/org/utbot/examples/lambda/CustomPredicateExampleTest.kt @@ -10,13 +10,13 @@ import org.utbot.tests.infrastructure.isException class CustomPredicateExampleTest : UtValueTestCaseChecker( testClass = CustomPredicateExample::class, - languagePipelines = listOf( - CodeGenerationLanguageLastStage(CodegenLanguage.JAVA), + pipelines = listOf( + TestLastStage(CodegenLanguage.JAVA), // TODO: https://github.com/UnitTestBot/UTBotJava/issues/88 (generics in Kotlin) // At the moment, when we create an instance of a functional interface via lambda (through reflection), // we need to do a type cast (e.g. `obj as Predicate`), but since generics are not supported yet, // we use a raw type (e.g. `Predicate`) instead (which is not allowed in Kotlin). - CodeGenerationLanguageLastStage(CodegenLanguage.KOTLIN, CodeGeneration) + TestLastStage(CodegenLanguage.KOTLIN, CodeGeneration) ) ) { @Test diff --git a/utbot-framework-test/src/test/kotlin/org/utbot/examples/lambda/SimpleLambdaExamplesTest.kt b/utbot-framework-test/src/test/kotlin/org/utbot/examples/lambda/SimpleLambdaExamplesTest.kt index d3a04948b2..32f83ef9e2 100644 --- a/utbot-framework-test/src/test/kotlin/org/utbot/examples/lambda/SimpleLambdaExamplesTest.kt +++ b/utbot-framework-test/src/test/kotlin/org/utbot/examples/lambda/SimpleLambdaExamplesTest.kt @@ -11,9 +11,9 @@ import org.utbot.tests.infrastructure.isException // TODO failed Kotlin compilation (generics) SAT-1332 class SimpleLambdaExamplesTest : UtValueTestCaseChecker( testClass = SimpleLambdaExamples::class, - languagePipelines = listOf( - CodeGenerationLanguageLastStage(CodegenLanguage.JAVA), - CodeGenerationLanguageLastStage(CodegenLanguage.KOTLIN, CodeGeneration), + pipelines = listOf( + TestLastStage(CodegenLanguage.JAVA), + TestLastStage(CodegenLanguage.KOTLIN, CodeGeneration), ) ) { @Test diff --git a/utbot-framework-test/src/test/kotlin/org/utbot/examples/make/symbolic/ClassWithComplicatedMethodsTest.kt b/utbot-framework-test/src/test/kotlin/org/utbot/examples/make/symbolic/ClassWithComplicatedMethodsTest.kt index ddba26f794..63456488d6 100644 --- a/utbot-framework-test/src/test/kotlin/org/utbot/examples/make/symbolic/ClassWithComplicatedMethodsTest.kt +++ b/utbot-framework-test/src/test/kotlin/org/utbot/examples/make/symbolic/ClassWithComplicatedMethodsTest.kt @@ -18,9 +18,9 @@ import org.utbot.tests.infrastructure.Compilation internal class ClassWithComplicatedMethodsTest : UtValueTestCaseChecker( testClass = ClassWithComplicatedMethods::class, testCodeGeneration = true, - languagePipelines = listOf( - CodeGenerationLanguageLastStage(CodegenLanguage.JAVA, Compilation), - CodeGenerationLanguageLastStage(CodegenLanguage.KOTLIN, Compilation) + pipelines = listOf( + TestLastStage(CodegenLanguage.JAVA, Compilation), + TestLastStage(CodegenLanguage.KOTLIN, Compilation) ) ) { @Test diff --git a/utbot-framework-test/src/test/kotlin/org/utbot/examples/math/OverflowAsErrorTest.kt b/utbot-framework-test/src/test/kotlin/org/utbot/examples/math/OverflowAsErrorTest.kt index 558fe403d3..625f195710 100644 --- a/utbot-framework-test/src/test/kotlin/org/utbot/examples/math/OverflowAsErrorTest.kt +++ b/utbot-framework-test/src/test/kotlin/org/utbot/examples/math/OverflowAsErrorTest.kt @@ -21,8 +21,8 @@ internal class OverflowAsErrorTest : UtValueTestCaseChecker( // Don't launch tests, because ArithmeticException will be expected, but it is not supposed to be actually thrown. // ArithmeticException acts as a sign of Overflow. listOf( - CodeGenerationLanguageLastStage(CodegenLanguage.JAVA, Compilation), - CodeGenerationLanguageLastStage(CodegenLanguage.KOTLIN, Compilation), + TestLastStage(CodegenLanguage.JAVA, Compilation), + TestLastStage(CodegenLanguage.KOTLIN, Compilation), ) ) { @Test diff --git a/utbot-framework-test/src/test/kotlin/org/utbot/examples/mixed/LoggerExampleTest.kt b/utbot-framework-test/src/test/kotlin/org/utbot/examples/mixed/LoggerExampleTest.kt index 128d55e97c..b751e01672 100644 --- a/utbot-framework-test/src/test/kotlin/org/utbot/examples/mixed/LoggerExampleTest.kt +++ b/utbot-framework-test/src/test/kotlin/org/utbot/examples/mixed/LoggerExampleTest.kt @@ -15,9 +15,9 @@ import org.utbot.tests.infrastructure.CodeGeneration internal class LoggerExampleTest : UtValueTestCaseChecker( testClass = LoggerExample::class, testCodeGeneration = true, - languagePipelines = listOf( - CodeGenerationLanguageLastStage(CodegenLanguage.JAVA), - CodeGenerationLanguageLastStage(CodegenLanguage.KOTLIN, CodeGeneration) + pipelines = listOf( + TestLastStage(CodegenLanguage.JAVA), + TestLastStage(CodegenLanguage.KOTLIN, CodeGeneration) ) ) { @Test diff --git a/utbot-framework-test/src/test/kotlin/org/utbot/examples/mock/FieldMockTest.kt b/utbot-framework-test/src/test/kotlin/org/utbot/examples/mock/FieldMockTest.kt index caa273ea18..fa53ee4043 100644 --- a/utbot-framework-test/src/test/kotlin/org/utbot/examples/mock/FieldMockTest.kt +++ b/utbot-framework-test/src/test/kotlin/org/utbot/examples/mock/FieldMockTest.kt @@ -10,9 +10,18 @@ import org.utbot.tests.infrastructure.mocksMethod import org.utbot.tests.infrastructure.value import org.utbot.framework.plugin.api.MockStrategyApi.OTHER_PACKAGES import org.junit.jupiter.api.Test +import org.utbot.framework.plugin.api.CodegenLanguage import org.utbot.testcheckers.eq +import org.utbot.tests.infrastructure.Compilation +import org.utbot.tests.infrastructure.TestExecution -internal class FieldMockTest : UtValueTestCaseChecker(testClass = ServiceWithField::class) { +internal class FieldMockTest : UtValueTestCaseChecker( + testClass = ServiceWithField::class, + pipelines = listOf( + TestLastStage(CodegenLanguage.JAVA, lastStage = TestExecution, parameterizedModeLastStage = Compilation), + TestLastStage(CodegenLanguage.KOTLIN, lastStage = TestExecution) + ) +) { @Test fun testMockForField_callMultipleMethods() { checkMocksAndInstrumentation( diff --git a/utbot-framework-test/src/test/kotlin/org/utbot/examples/mock/MockFinalClassTest.kt b/utbot-framework-test/src/test/kotlin/org/utbot/examples/mock/MockFinalClassTest.kt index 0e96e4ee1a..2df65a261b 100644 --- a/utbot-framework-test/src/test/kotlin/org/utbot/examples/mock/MockFinalClassTest.kt +++ b/utbot-framework-test/src/test/kotlin/org/utbot/examples/mock/MockFinalClassTest.kt @@ -7,9 +7,18 @@ import org.utbot.tests.infrastructure.singleMock import org.utbot.tests.infrastructure.value import org.utbot.framework.plugin.api.MockStrategyApi.OTHER_CLASSES import org.junit.jupiter.api.Test +import org.utbot.framework.plugin.api.CodegenLanguage import org.utbot.testcheckers.ge +import org.utbot.tests.infrastructure.Compilation +import org.utbot.tests.infrastructure.TestExecution -internal class MockFinalClassTest : UtValueTestCaseChecker(testClass = MockFinalClassExample::class) { +internal class MockFinalClassTest : UtValueTestCaseChecker( + testClass = MockFinalClassExample::class, + pipelines = listOf( + TestLastStage(CodegenLanguage.JAVA, lastStage = TestExecution, parameterizedModeLastStage = Compilation), + TestLastStage(CodegenLanguage.KOTLIN, lastStage = TestExecution) + ) +) { @Test fun testFinalClass() { checkMocks( diff --git a/utbot-framework-test/src/test/kotlin/org/utbot/examples/mock/MockRandomTest.kt b/utbot-framework-test/src/test/kotlin/org/utbot/examples/mock/MockRandomTest.kt index 05e1793014..df7cfc37c6 100644 --- a/utbot-framework-test/src/test/kotlin/org/utbot/examples/mock/MockRandomTest.kt +++ b/utbot-framework-test/src/test/kotlin/org/utbot/examples/mock/MockRandomTest.kt @@ -14,14 +14,16 @@ import org.junit.jupiter.api.Test import org.utbot.framework.plugin.api.CodegenLanguage import org.utbot.testcheckers.eq import org.utbot.tests.infrastructure.CodeGeneration +import org.utbot.tests.infrastructure.Compilation +import org.utbot.tests.infrastructure.TestExecution // TODO Kotlin mocks generics https://github.com/UnitTestBot/UTBotJava/issues/88 internal class MockRandomTest : UtValueTestCaseChecker( testClass = MockRandomExamples::class, testCodeGeneration = true, - languagePipelines = listOf( - CodeGenerationLanguageLastStage(CodegenLanguage.JAVA), - CodeGenerationLanguageLastStage(CodegenLanguage.KOTLIN, CodeGeneration) + pipelines = listOf( + TestLastStage(CodegenLanguage.JAVA, lastStage = TestExecution, parameterizedModeLastStage = Compilation), + TestLastStage(CodegenLanguage.KOTLIN, lastStage = CodeGeneration) ) ) { @Test diff --git a/utbot-framework-test/src/test/kotlin/org/utbot/examples/mock/MockStaticMethodExampleTest.kt b/utbot-framework-test/src/test/kotlin/org/utbot/examples/mock/MockStaticMethodExampleTest.kt index 37ffbefa2f..fcdbf694ad 100644 --- a/utbot-framework-test/src/test/kotlin/org/utbot/examples/mock/MockStaticMethodExampleTest.kt +++ b/utbot-framework-test/src/test/kotlin/org/utbot/examples/mock/MockStaticMethodExampleTest.kt @@ -11,14 +11,16 @@ import org.junit.jupiter.api.Test import org.utbot.framework.plugin.api.CodegenLanguage import org.utbot.testcheckers.eq import org.utbot.tests.infrastructure.CodeGeneration +import org.utbot.tests.infrastructure.Compilation +import org.utbot.tests.infrastructure.TestExecution // TODO Kotlin mocks generics https://github.com/UnitTestBot/UTBotJava/issues/88 internal class MockStaticMethodExampleTest : UtValueTestCaseChecker( testClass = MockStaticMethodExample::class, testCodeGeneration = true, - languagePipelines = listOf( - CodeGenerationLanguageLastStage(CodegenLanguage.JAVA), - CodeGenerationLanguageLastStage(CodegenLanguage.KOTLIN, CodeGeneration) + pipelines = listOf( + TestLastStage(CodegenLanguage.JAVA, lastStage = TestExecution, parameterizedModeLastStage = Compilation), + TestLastStage(CodegenLanguage.KOTLIN, lastStage = CodeGeneration) ) ) { @Test diff --git a/utbot-framework-test/src/test/kotlin/org/utbot/examples/mock/UseNetworkTest.kt b/utbot-framework-test/src/test/kotlin/org/utbot/examples/mock/UseNetworkTest.kt index 277ed3aff0..acff778b01 100644 --- a/utbot-framework-test/src/test/kotlin/org/utbot/examples/mock/UseNetworkTest.kt +++ b/utbot-framework-test/src/test/kotlin/org/utbot/examples/mock/UseNetworkTest.kt @@ -6,7 +6,9 @@ import org.utbot.tests.infrastructure.isException import org.utbot.framework.plugin.api.MockStrategyApi import org.utbot.framework.plugin.api.UtConcreteValue import org.junit.jupiter.api.Test +import org.utbot.framework.plugin.api.CodegenLanguage import org.utbot.testcheckers.eq +import org.utbot.tests.infrastructure.Compilation internal class UseNetworkTest : UtValueTestCaseChecker(testClass = UseNetwork::class) { @Test diff --git a/utbot-framework-test/src/test/kotlin/org/utbot/examples/models/CompositeModelMinimizationChecker.kt b/utbot-framework-test/src/test/kotlin/org/utbot/examples/models/CompositeModelMinimizationChecker.kt index dcd76468f3..271d950301 100644 --- a/utbot-framework-test/src/test/kotlin/org/utbot/examples/models/CompositeModelMinimizationChecker.kt +++ b/utbot-framework-test/src/test/kotlin/org/utbot/examples/models/CompositeModelMinimizationChecker.kt @@ -14,9 +14,9 @@ import org.utbot.tests.infrastructure.CodeGeneration internal class CompositeModelMinimizationChecker : UtModelTestCaseChecker( testClass = CompositeModelMinimizationExample::class, testCodeGeneration = true, - languagePipelines = listOf( - CodeGenerationLanguageLastStage(CodegenLanguage.JAVA), - CodeGenerationLanguageLastStage(CodegenLanguage.KOTLIN, CodeGeneration) + pipelines = listOf( + TestLastStage(CodegenLanguage.JAVA), + TestLastStage(CodegenLanguage.KOTLIN, CodeGeneration) ) ) { private fun UtModel.getFieldsOrNull(): Map? = when(this) { diff --git a/utbot-framework-test/src/test/kotlin/org/utbot/examples/models/ModelsIdEqualityChecker.kt b/utbot-framework-test/src/test/kotlin/org/utbot/examples/models/ModelsIdEqualityChecker.kt index 2a13e9a976..eea119bcbc 100644 --- a/utbot-framework-test/src/test/kotlin/org/utbot/examples/models/ModelsIdEqualityChecker.kt +++ b/utbot-framework-test/src/test/kotlin/org/utbot/examples/models/ModelsIdEqualityChecker.kt @@ -15,9 +15,9 @@ import org.utbot.tests.infrastructure.CodeGeneration internal class ModelsIdEqualityChecker : UtModelTestCaseChecker( testClass = ModelsIdEqualityExample::class, testCodeGeneration = true, - languagePipelines = listOf( - CodeGenerationLanguageLastStage(CodegenLanguage.JAVA), - CodeGenerationLanguageLastStage(CodegenLanguage.KOTLIN, CodeGeneration) + pipelines = listOf( + TestLastStage(CodegenLanguage.JAVA), + TestLastStage(CodegenLanguage.KOTLIN, CodeGeneration) ) ) { @Test diff --git a/utbot-framework-test/src/test/kotlin/org/utbot/examples/natives/NativeExamplesTest.kt b/utbot-framework-test/src/test/kotlin/org/utbot/examples/natives/NativeExamplesTest.kt index 863bff2d53..5c3d4da5ab 100644 --- a/utbot-framework-test/src/test/kotlin/org/utbot/examples/natives/NativeExamplesTest.kt +++ b/utbot-framework-test/src/test/kotlin/org/utbot/examples/natives/NativeExamplesTest.kt @@ -13,9 +13,9 @@ import org.utbot.tests.infrastructure.CodeGeneration internal class NativeExamplesTest : UtValueTestCaseChecker( testClass = NativeExamples::class, testCodeGeneration = true, - languagePipelines = listOf( - CodeGenerationLanguageLastStage(CodegenLanguage.JAVA), - CodeGenerationLanguageLastStage(CodegenLanguage.KOTLIN, CodeGeneration) + pipelines = listOf( + TestLastStage(CodegenLanguage.JAVA), + TestLastStage(CodegenLanguage.KOTLIN, CodeGeneration) ) ) { diff --git a/utbot-framework-test/src/test/kotlin/org/utbot/examples/objects/AnonymousClassesExampleTest.kt b/utbot-framework-test/src/test/kotlin/org/utbot/examples/objects/AnonymousClassesExampleTest.kt index 11e152f510..6b7b74a045 100644 --- a/utbot-framework-test/src/test/kotlin/org/utbot/examples/objects/AnonymousClassesExampleTest.kt +++ b/utbot-framework-test/src/test/kotlin/org/utbot/examples/objects/AnonymousClassesExampleTest.kt @@ -4,9 +4,18 @@ import org.utbot.tests.infrastructure.Full import org.utbot.tests.infrastructure.UtValueTestCaseChecker import org.utbot.tests.infrastructure.isException import org.junit.jupiter.api.Test +import org.utbot.framework.plugin.api.CodegenLanguage import org.utbot.testcheckers.eq +import org.utbot.tests.infrastructure.Compilation +import org.utbot.tests.infrastructure.TestExecution -class AnonymousClassesExampleTest : UtValueTestCaseChecker(testClass = AnonymousClassesExample::class) { +class AnonymousClassesExampleTest : UtValueTestCaseChecker( + testClass = AnonymousClassesExample::class, + pipelines = listOf( + TestLastStage(CodegenLanguage.JAVA, lastStage = TestExecution, parameterizedModeLastStage = Compilation), + TestLastStage(CodegenLanguage.KOTLIN, lastStage = TestExecution) + ) +) { @Test fun testAnonymousClassAsParam() { checkWithException( diff --git a/utbot-framework-test/src/test/kotlin/org/utbot/examples/objects/ClassRefTest.kt b/utbot-framework-test/src/test/kotlin/org/utbot/examples/objects/ClassRefTest.kt index 28ad43a36b..31297e978e 100644 --- a/utbot-framework-test/src/test/kotlin/org/utbot/examples/objects/ClassRefTest.kt +++ b/utbot-framework-test/src/test/kotlin/org/utbot/examples/objects/ClassRefTest.kt @@ -16,10 +16,10 @@ import org.utbot.tests.infrastructure.CodeGeneration internal class ClassRefTest : UtValueTestCaseChecker( testClass = ClassRef::class, testCodeGeneration = true, - languagePipelines = listOf( - CodeGenerationLanguageLastStage(CodegenLanguage.JAVA), + pipelines = listOf( + TestLastStage(CodegenLanguage.JAVA), // TODO: SAT-1457 Restore Kotlin codegen for a group of tests with type casts - CodeGenerationLanguageLastStage(CodegenLanguage.KOTLIN, CodeGeneration) + TestLastStage(CodegenLanguage.KOTLIN, CodeGeneration) ) ) { @Test diff --git a/utbot-framework-test/src/test/kotlin/org/utbot/examples/objects/ClassWithClassRefTest.kt b/utbot-framework-test/src/test/kotlin/org/utbot/examples/objects/ClassWithClassRefTest.kt index 474293cf44..7770fbf977 100644 --- a/utbot-framework-test/src/test/kotlin/org/utbot/examples/objects/ClassWithClassRefTest.kt +++ b/utbot-framework-test/src/test/kotlin/org/utbot/examples/objects/ClassWithClassRefTest.kt @@ -15,9 +15,9 @@ import org.utbot.tests.infrastructure.Compilation internal class ClassWithClassRefTest : UtValueTestCaseChecker( testClass = ClassWithClassRef::class, testCodeGeneration = true, - languagePipelines = listOf( - CodeGenerationLanguageLastStage(CodegenLanguage.JAVA, Compilation), // TODO JIRA:1479 - CodeGenerationLanguageLastStage(CodegenLanguage.KOTLIN, CodeGeneration) + pipelines = listOf( + TestLastStage(CodegenLanguage.JAVA, Compilation), // TODO JIRA:1479 + TestLastStage(CodegenLanguage.KOTLIN, CodeGeneration) ) ) { @Test diff --git a/utbot-framework-test/src/test/kotlin/org/utbot/examples/objects/ObjectWithFinalStaticTest.kt b/utbot-framework-test/src/test/kotlin/org/utbot/examples/objects/ObjectWithFinalStaticTest.kt index c14cea0dec..ec219a7022 100644 --- a/utbot-framework-test/src/test/kotlin/org/utbot/examples/objects/ObjectWithFinalStaticTest.kt +++ b/utbot-framework-test/src/test/kotlin/org/utbot/examples/objects/ObjectWithFinalStaticTest.kt @@ -11,9 +11,9 @@ import org.utbot.tests.infrastructure.CodeGeneration class ObjectWithFinalStaticTest : UtValueTestCaseChecker( testClass = ObjectWithFinalStatic::class, testCodeGeneration = true, - languagePipelines = listOf( - CodeGenerationLanguageLastStage(CodegenLanguage.JAVA), - CodeGenerationLanguageLastStage(CodegenLanguage.KOTLIN, CodeGeneration) + pipelines = listOf( + TestLastStage(CodegenLanguage.JAVA), + TestLastStage(CodegenLanguage.KOTLIN, CodeGeneration) ) ) { @Test diff --git a/utbot-framework-test/src/test/kotlin/org/utbot/examples/objects/SimpleClassMultiInstanceExampleTest.kt b/utbot-framework-test/src/test/kotlin/org/utbot/examples/objects/SimpleClassMultiInstanceExampleTest.kt index 92134bfb17..bb7ddc71af 100644 --- a/utbot-framework-test/src/test/kotlin/org/utbot/examples/objects/SimpleClassMultiInstanceExampleTest.kt +++ b/utbot-framework-test/src/test/kotlin/org/utbot/examples/objects/SimpleClassMultiInstanceExampleTest.kt @@ -3,9 +3,12 @@ package org.utbot.examples.objects import org.utbot.tests.infrastructure.UtValueTestCaseChecker import org.utbot.tests.infrastructure.DoNotCalculate import org.junit.Test +import org.utbot.framework.plugin.api.CodegenLanguage import org.utbot.testcheckers.eq +import org.utbot.tests.infrastructure.Compilation -internal class SimpleClassMultiInstanceExampleTest : UtValueTestCaseChecker(testClass = SimpleClassMultiInstanceExample::class) { +internal class SimpleClassMultiInstanceExampleTest : UtValueTestCaseChecker(testClass = + SimpleClassMultiInstanceExample::class) { @Test fun singleObjectChangeTest() { check( diff --git a/utbot-framework-test/src/test/kotlin/org/utbot/examples/recursion/RecursionTest.kt b/utbot-framework-test/src/test/kotlin/org/utbot/examples/recursion/RecursionTest.kt index aa30f2ace5..ec2746f191 100644 --- a/utbot-framework-test/src/test/kotlin/org/utbot/examples/recursion/RecursionTest.kt +++ b/utbot-framework-test/src/test/kotlin/org/utbot/examples/recursion/RecursionTest.kt @@ -22,9 +22,9 @@ import org.utbot.tests.infrastructure.CodeGeneration internal class RecursionTest : UtValueTestCaseChecker( testClass = Recursion::class, testCodeGeneration = true, - languagePipelines = listOf( - CodeGenerationLanguageLastStage(CodegenLanguage.JAVA), - CodeGenerationLanguageLastStage(CodegenLanguage.KOTLIN, CodeGeneration) + pipelines = listOf( + TestLastStage(CodegenLanguage.JAVA), + TestLastStage(CodegenLanguage.KOTLIN, CodeGeneration) ) ) { @Test diff --git a/utbot-framework-test/src/test/kotlin/org/utbot/examples/stream/BaseStreamExampleTest.kt b/utbot-framework-test/src/test/kotlin/org/utbot/examples/stream/BaseStreamExampleTest.kt index 919352f53e..b1dbb5a64d 100644 --- a/utbot-framework-test/src/test/kotlin/org/utbot/examples/stream/BaseStreamExampleTest.kt +++ b/utbot-framework-test/src/test/kotlin/org/utbot/examples/stream/BaseStreamExampleTest.kt @@ -24,9 +24,9 @@ import kotlin.streams.toList class BaseStreamExampleTest : UtValueTestCaseChecker( testClass = BaseStreamExample::class, testCodeGeneration = true, - languagePipelines = listOf( - CodeGenerationLanguageLastStage(CodegenLanguage.JAVA), - CodeGenerationLanguageLastStage(CodegenLanguage.KOTLIN, CodeGeneration) + pipelines = listOf( + TestLastStage(CodegenLanguage.JAVA), + TestLastStage(CodegenLanguage.KOTLIN, CodeGeneration) ) ) { @Test diff --git a/utbot-framework-test/src/test/kotlin/org/utbot/examples/stream/DoubleStreamExampleTest.kt b/utbot-framework-test/src/test/kotlin/org/utbot/examples/stream/DoubleStreamExampleTest.kt index 6d7b4f7ec4..b480daa90c 100644 --- a/utbot-framework-test/src/test/kotlin/org/utbot/examples/stream/DoubleStreamExampleTest.kt +++ b/utbot-framework-test/src/test/kotlin/org/utbot/examples/stream/DoubleStreamExampleTest.kt @@ -16,9 +16,9 @@ import kotlin.streams.toList class DoubleStreamExampleTest : UtValueTestCaseChecker( testClass = DoubleStreamExample::class, testCodeGeneration = true, - languagePipelines = listOf( - CodeGenerationLanguageLastStage(CodegenLanguage.JAVA), - CodeGenerationLanguageLastStage(CodegenLanguage.KOTLIN, CodeGeneration) + pipelines = listOf( + TestLastStage(CodegenLanguage.JAVA), + TestLastStage(CodegenLanguage.KOTLIN, CodeGeneration) ) ) { @Test diff --git a/utbot-framework-test/src/test/kotlin/org/utbot/examples/stream/IntStreamExampleTest.kt b/utbot-framework-test/src/test/kotlin/org/utbot/examples/stream/IntStreamExampleTest.kt index b91045e00d..62a1ecbca0 100644 --- a/utbot-framework-test/src/test/kotlin/org/utbot/examples/stream/IntStreamExampleTest.kt +++ b/utbot-framework-test/src/test/kotlin/org/utbot/examples/stream/IntStreamExampleTest.kt @@ -17,9 +17,9 @@ import kotlin.streams.toList class IntStreamExampleTest : UtValueTestCaseChecker( testClass = IntStreamExample::class, testCodeGeneration = true, - languagePipelines = listOf( - CodeGenerationLanguageLastStage(CodegenLanguage.JAVA), - CodeGenerationLanguageLastStage(CodegenLanguage.KOTLIN, CodeGeneration) + pipelines = listOf( + TestLastStage(CodegenLanguage.JAVA), + TestLastStage(CodegenLanguage.KOTLIN, CodeGeneration) ) ) { @Test diff --git a/utbot-framework-test/src/test/kotlin/org/utbot/examples/stream/LongStreamExampleTest.kt b/utbot-framework-test/src/test/kotlin/org/utbot/examples/stream/LongStreamExampleTest.kt index 704ed750b0..8864db2a3a 100644 --- a/utbot-framework-test/src/test/kotlin/org/utbot/examples/stream/LongStreamExampleTest.kt +++ b/utbot-framework-test/src/test/kotlin/org/utbot/examples/stream/LongStreamExampleTest.kt @@ -17,9 +17,9 @@ import kotlin.streams.toList class LongStreamExampleTest : UtValueTestCaseChecker( testClass = LongStreamExample::class, testCodeGeneration = true, - languagePipelines = listOf( - CodeGenerationLanguageLastStage(CodegenLanguage.JAVA), - CodeGenerationLanguageLastStage(CodegenLanguage.KOTLIN, CodeGeneration) + pipelines = listOf( + TestLastStage(CodegenLanguage.JAVA), + TestLastStage(CodegenLanguage.KOTLIN, CodeGeneration) ) ) { @Test diff --git a/utbot-framework-test/src/test/kotlin/org/utbot/examples/strings/StringExamplesTest.kt b/utbot-framework-test/src/test/kotlin/org/utbot/examples/strings/StringExamplesTest.kt index 6275940f52..7ff61edaad 100644 --- a/utbot-framework-test/src/test/kotlin/org/utbot/examples/strings/StringExamplesTest.kt +++ b/utbot-framework-test/src/test/kotlin/org/utbot/examples/strings/StringExamplesTest.kt @@ -20,9 +20,9 @@ import org.utbot.tests.infrastructure.CodeGeneration internal class StringExamplesTest : UtValueTestCaseChecker( testClass = StringExamples::class, testCodeGeneration = true, - languagePipelines = listOf( - CodeGenerationLanguageLastStage(CodegenLanguage.JAVA), - CodeGenerationLanguageLastStage(CodegenLanguage.KOTLIN, CodeGeneration) + pipelines = listOf( + TestLastStage(CodegenLanguage.JAVA), + TestLastStage(CodegenLanguage.KOTLIN, CodeGeneration) ) ) { @Test diff --git a/utbot-framework-test/src/test/kotlin/org/utbot/examples/structures/StandardStructuresTest.kt b/utbot-framework-test/src/test/kotlin/org/utbot/examples/structures/StandardStructuresTest.kt index aff33bc2d3..7287a964c6 100644 --- a/utbot-framework-test/src/test/kotlin/org/utbot/examples/structures/StandardStructuresTest.kt +++ b/utbot-framework-test/src/test/kotlin/org/utbot/examples/structures/StandardStructuresTest.kt @@ -18,9 +18,9 @@ import org.utbot.tests.infrastructure.CodeGeneration internal class StandardStructuresTest : UtValueTestCaseChecker( testClass = StandardStructures::class, - languagePipelines = listOf( - CodeGenerationLanguageLastStage(CodegenLanguage.JAVA), - CodeGenerationLanguageLastStage(CodegenLanguage.KOTLIN, CodeGeneration) + pipelines = listOf( + TestLastStage(CodegenLanguage.JAVA), + TestLastStage(CodegenLanguage.KOTLIN, CodeGeneration) ) ) { @Test diff --git a/utbot-framework-test/src/test/kotlin/org/utbot/examples/wrappers/CharacterWrapperTest.kt b/utbot-framework-test/src/test/kotlin/org/utbot/examples/wrappers/CharacterWrapperTest.kt index e9f4bb5f3a..3d81e52688 100644 --- a/utbot-framework-test/src/test/kotlin/org/utbot/examples/wrappers/CharacterWrapperTest.kt +++ b/utbot-framework-test/src/test/kotlin/org/utbot/examples/wrappers/CharacterWrapperTest.kt @@ -12,9 +12,9 @@ import org.utbot.tests.infrastructure.CodeGeneration internal class CharacterWrapperTest : UtValueTestCaseChecker( testClass = CharacterWrapper::class, testCodeGeneration = true, - languagePipelines = listOf( - CodeGenerationLanguageLastStage(CodegenLanguage.JAVA), - CodeGenerationLanguageLastStage(CodegenLanguage.KOTLIN, CodeGeneration) + pipelines = listOf( + TestLastStage(CodegenLanguage.JAVA), + TestLastStage(CodegenLanguage.KOTLIN, CodeGeneration) ) ) { @Test diff --git a/utbot-framework-test/src/test/kotlin/org/utbot/examples/wrappers/LongWrapperTest.kt b/utbot-framework-test/src/test/kotlin/org/utbot/examples/wrappers/LongWrapperTest.kt index 51b4de5557..990367c628 100644 --- a/utbot-framework-test/src/test/kotlin/org/utbot/examples/wrappers/LongWrapperTest.kt +++ b/utbot-framework-test/src/test/kotlin/org/utbot/examples/wrappers/LongWrapperTest.kt @@ -12,9 +12,9 @@ import org.utbot.tests.infrastructure.CodeGeneration internal class LongWrapperTest : UtValueTestCaseChecker( testClass = LongWrapper::class, testCodeGeneration = true, - languagePipelines = listOf( - CodeGenerationLanguageLastStage(CodegenLanguage.JAVA), - CodeGenerationLanguageLastStage(CodegenLanguage.KOTLIN, CodeGeneration) + pipelines = listOf( + TestLastStage(CodegenLanguage.JAVA), + TestLastStage(CodegenLanguage.KOTLIN, CodeGeneration) ) ) { @Test diff --git a/utbot-framework/src/main/kotlin/org/utbot/engine/util/mockListeners/ForceMockListener.kt b/utbot-framework/src/main/kotlin/org/utbot/engine/util/mockListeners/ForceMockListener.kt index 557c1c7199..f07f906259 100644 --- a/utbot-framework/src/main/kotlin/org/utbot/engine/util/mockListeners/ForceMockListener.kt +++ b/utbot-framework/src/main/kotlin/org/utbot/engine/util/mockListeners/ForceMockListener.kt @@ -12,17 +12,17 @@ import org.utbot.framework.util.ConflictTriggers * * Supposed to be created only if Mockito is not installed. */ -class ForceMockListener(triggers: ConflictTriggers): MockListener(triggers) { +class ForceMockListener private constructor(triggers: ConflictTriggers, private val cancelJob: Boolean): MockListener(triggers) { override fun onShouldMock(controller: EngineController, strategy: MockStrategy, mockInfo: UtMockInfo) { // If force mocking happened -- сancel engine job - controller.job?.cancel(ForceMockCancellationException()) + if (cancelJob) controller.job?.cancel(ForceMockCancellationException()) triggers[Conflict.ForceMockHappened] = true } companion object { - fun create(testCaseGenerator: TestCaseGenerator, conflictTriggers: ConflictTriggers) : ForceMockListener { - val listener = ForceMockListener(conflictTriggers) + fun create(testCaseGenerator: TestCaseGenerator, conflictTriggers: ConflictTriggers, cancelJob: Boolean = true) : ForceMockListener { + val listener = ForceMockListener(conflictTriggers, cancelJob) testCaseGenerator.engineActions.add { engine -> engine.attachMockListener(listener) } return listener diff --git a/utbot-framework/src/main/kotlin/org/utbot/engine/util/mockListeners/ForceStaticMockListener.kt b/utbot-framework/src/main/kotlin/org/utbot/engine/util/mockListeners/ForceStaticMockListener.kt index 77ad602e27..1e0ec17016 100644 --- a/utbot-framework/src/main/kotlin/org/utbot/engine/util/mockListeners/ForceStaticMockListener.kt +++ b/utbot-framework/src/main/kotlin/org/utbot/engine/util/mockListeners/ForceStaticMockListener.kt @@ -16,21 +16,21 @@ import org.utbot.framework.util.ConflictTriggers * * Supposed to be created only if Mockito inline is not installed. */ -class ForceStaticMockListener(triggers: ConflictTriggers): MockListener(triggers) { +class ForceStaticMockListener private constructor(triggers: ConflictTriggers, private val cancelJob: Boolean): MockListener(triggers) { override fun onShouldMock(controller: EngineController, strategy: MockStrategy, mockInfo: UtMockInfo) { if (mockInfo is UtNewInstanceMockInfo || mockInfo is UtStaticMethodMockInfo || mockInfo is UtStaticObjectMockInfo) { // If force static mocking happened -- сancel engine job - controller.job?.cancel(ForceStaticMockCancellationException()) + if (cancelJob) controller.job?.cancel(ForceStaticMockCancellationException()) triggers[Conflict.ForceStaticMockHappened] = true } } companion object { - fun create(testCaseGenerator: TestCaseGenerator, conflictTriggers: ConflictTriggers) : ForceStaticMockListener { - val listener = ForceStaticMockListener(conflictTriggers) + fun create(testCaseGenerator: TestCaseGenerator, conflictTriggers: ConflictTriggers, cancelJob: Boolean = true) : ForceStaticMockListener { + val listener = ForceStaticMockListener(conflictTriggers, cancelJob) testCaseGenerator.engineActions.add { engine -> engine.attachMockListener(listener) } return listener diff --git a/utbot-framework/src/main/kotlin/org/utbot/framework/codegen/model/constructor/CgMethodTestSet.kt b/utbot-framework/src/main/kotlin/org/utbot/framework/codegen/model/constructor/CgMethodTestSet.kt index d29a0e8036..80994c49b4 100644 --- a/utbot-framework/src/main/kotlin/org/utbot/framework/codegen/model/constructor/CgMethodTestSet.kt +++ b/utbot-framework/src/main/kotlin/org/utbot/framework/codegen/model/constructor/CgMethodTestSet.kt @@ -8,8 +8,10 @@ import org.utbot.framework.plugin.api.UtExecution import org.utbot.framework.plugin.api.UtExecutionFailure import org.utbot.framework.plugin.api.UtExecutionSuccess import org.utbot.framework.plugin.api.UtMethodTestSet +import org.utbot.framework.plugin.api.UtSymbolicExecution import org.utbot.framework.plugin.api.util.objectClassId import org.utbot.framework.plugin.api.util.voidClassId +import org.utbot.fuzzer.UtFuzzedExecution import soot.jimple.JimpleBody data class CgMethodTestSet private constructor( @@ -65,6 +67,18 @@ data class CgMethodTestSet private constructor( return executionsByStaticsUsage.map { (_, executions) -> substituteExecutions(executions) } } + /* + * Excludes executions with mocking from [CgMethodTestSet]. + * */ + fun excludeExecutionsWithMocking(): CgMethodTestSet { + val fuzzedExecutions = executions.filterIsInstance() + val symbolicExecutionsWithoutMocking = executions + .filterIsInstance() + .filter { !it.containsMocking } + + return substituteExecutions(symbolicExecutionsWithoutMocking + fuzzedExecutions) + } + /** * Finds a [ClassId] of all result models in executions. * diff --git a/utbot-framework/src/main/kotlin/org/utbot/framework/codegen/model/constructor/tree/CgTestClassConstructor.kt b/utbot-framework/src/main/kotlin/org/utbot/framework/codegen/model/constructor/tree/CgTestClassConstructor.kt index 34b876307e..a404b2826f 100644 --- a/utbot-framework/src/main/kotlin/org/utbot/framework/codegen/model/constructor/tree/CgTestClassConstructor.kt +++ b/utbot-framework/src/main/kotlin/org/utbot/framework/codegen/model/constructor/tree/CgTestClassConstructor.kt @@ -164,7 +164,10 @@ internal class CgTestClassConstructor(val context: CgContext) : } } ParametrizedTestSource.PARAMETRIZE -> { - for (splitByExecutionTestSet in testSet.splitExecutionsByResult()) { + // Mocks are not supported in parametrized tests, we should exclude them + val testSetWithoutMocking = testSet.excludeExecutionsWithMocking() + + for (splitByExecutionTestSet in testSetWithoutMocking.splitExecutionsByResult()) { for (splitByChangedStaticsTestSet in splitByExecutionTestSet.splitExecutionsByChangedStatics()) { createParametrizedTestAndDataProvider( splitByChangedStaticsTestSet, diff --git a/utbot-framework/src/main/kotlin/org/utbot/framework/process/EngineMain.kt b/utbot-framework/src/main/kotlin/org/utbot/framework/process/EngineMain.kt index 16c888ddda..2c259bb2e7 100644 --- a/utbot-framework/src/main/kotlin/org/utbot/framework/process/EngineMain.kt +++ b/utbot-framework/src/main/kotlin/org/utbot/framework/process/EngineMain.kt @@ -96,11 +96,11 @@ private fun EngineProcessModel.setup( val mockFrameworkInstalled = params.mockInstalled val conflictTriggers = ConflictTriggers(kryoHelper.readObject(params.conflictTriggers)) if (!mockFrameworkInstalled) { - ForceMockListener.create(testGenerator, conflictTriggers) + ForceMockListener.create(testGenerator, conflictTriggers, cancelJob = true) } val staticsMockingConfigured = params.staticsMockingIsConfigureda if (!staticsMockingConfigured) { - ForceStaticMockListener.create(testGenerator, conflictTriggers) + ForceStaticMockListener.create(testGenerator, conflictTriggers, cancelJob = true) } val result = testGenerator.generate(kryoHelper.readObject(params.methods), MockStrategyApi.valueOf(params.mockStrategy), diff --git a/utbot-framework/src/main/kotlin/org/utbot/framework/util/TestUtils.kt b/utbot-framework/src/main/kotlin/org/utbot/framework/util/TestUtils.kt index e4e0436ebd..7c95e724f2 100644 --- a/utbot-framework/src/main/kotlin/org/utbot/framework/util/TestUtils.kt +++ b/utbot-framework/src/main/kotlin/org/utbot/framework/util/TestUtils.kt @@ -153,9 +153,13 @@ class ConflictTriggers( Conflict.values().forEach { conflict -> map[conflict] = false } } ) : MutableMap by triggers { - val triggered: Boolean + val anyTriggered: Boolean get() = triggers.values.any { it } + fun triggered(conflict: Conflict): Boolean { + return triggers[conflict] ?: false + } + fun reset(vararg conflicts: Conflict) { for (conflict in conflicts) { triggers[conflict] = false diff --git a/utbot-framework/src/main/kotlin/org/utbot/tests/infrastructure/CodeGenerationIntegrationTest.kt b/utbot-framework/src/main/kotlin/org/utbot/tests/infrastructure/CodeGenerationIntegrationTest.kt index cdc4dce755..fd0333d5c0 100644 --- a/utbot-framework/src/main/kotlin/org/utbot/tests/infrastructure/CodeGenerationIntegrationTest.kt +++ b/utbot-framework/src/main/kotlin/org/utbot/tests/infrastructure/CodeGenerationIntegrationTest.kt @@ -21,6 +21,7 @@ import org.junit.jupiter.api.extension.ExtensionContext import org.junit.jupiter.api.fail import org.junit.jupiter.engine.descriptor.ClassTestDescriptor import org.junit.jupiter.engine.descriptor.JupiterEngineDescriptor +import org.utbot.framework.codegen.ParametrizedTestSource import java.nio.file.Path @TestInstance(TestInstance.Lifecycle.PER_CLASS) @@ -29,14 +30,18 @@ import java.nio.file.Path abstract class CodeGenerationIntegrationTest( private val testClass: KClass<*>, private var testCodeGeneration: Boolean = true, - private val languagesLastStages: List = listOf( - CodeGenerationLanguageLastStage(CodegenLanguage.JAVA), - CodeGenerationLanguageLastStage(CodegenLanguage.KOTLIN) + private val languagesLastStages: List = listOf( + TestLastStage(CodegenLanguage.JAVA), + TestLastStage(CodegenLanguage.KOTLIN) ) ) { private val testSets: MutableList = arrayListOf() - data class CodeGenerationLanguageLastStage(val language: CodegenLanguage, val lastStage: Stage = TestExecution) + data class TestLastStage( + val language: CodegenLanguage, + val lastStage: Stage = TestExecution, + val parameterizedModeLastStage: Stage = lastStage, + ) fun processTestCase(testSet: UtMethodTestSet) { if (testCodeGeneration) testSets += testSet @@ -91,27 +96,46 @@ abstract class CodeGenerationIntegrationTest( val result = packageResult[pkg] ?: return try { val pipelineErrors = mutableListOf() - languages.map { language -> + + // TODO: leave kotlin & parameterized mode configuration alone for now + val pipelineConfigurations = languages + .flatMap { language -> parameterizationModes.map { mode -> language to mode } } + .filterNot { it == CodegenLanguage.KOTLIN to ParametrizedTestSource.PARAMETRIZE } + + for ((language, parameterizationMode) in pipelineConfigurations) { try { // choose all test cases that should be tested with current language - val resultsWithCurLanguage = result.filter { codeGenerationTestCases -> - codeGenerationTestCases.languagePipelines.any { it.language == language } + val languageSpecificResults = result.filter { codeGenerationTestCases -> + codeGenerationTestCases.lastStages.any { it.language == language } } // for each test class choose code generation pipeline stages - val classStages = resultsWithCurLanguage.map { codeGenerationTestCases -> + val classStages = languageSpecificResults.map { codeGenerationTestCases -> + val codeGenerationConfiguration = + codeGenerationTestCases.lastStages.single { it.language == language } + + val lastStage = when (parameterizationMode) { + ParametrizedTestSource.DO_NOT_PARAMETRIZE -> { + codeGenerationConfiguration.lastStage + } + + ParametrizedTestSource.PARAMETRIZE -> { + codeGenerationConfiguration.parameterizedModeLastStage + } + } + ClassStages( codeGenerationTestCases.testClass, StageStatusCheck( firstStage = CodeGeneration, - lastStage = codeGenerationTestCases.languagePipelines.single { it.language == language }.lastStage, + lastStage = lastStage, status = ExecutionStatus.SUCCESS ), codeGenerationTestCases.testSets ) } - val config = TestCodeGeneratorPipeline.defaultTestFrameworkConfiguration(language) + val config = TestCodeGeneratorPipeline.defaultTestFrameworkConfiguration(language, parameterizationMode) TestCodeGeneratorPipeline(config).runClassesCodeGenerationTests(classStages) } catch (e: RuntimeException) { pipelineErrors.add(e.message) @@ -138,10 +162,12 @@ abstract class CodeGenerationIntegrationTest( private val languages = listOf(CodegenLanguage.JAVA, CodegenLanguage.KOTLIN) + private val parameterizationModes = listOf(ParametrizedTestSource.DO_NOT_PARAMETRIZE, ParametrizedTestSource.PARAMETRIZE) + data class CodeGenerationTestCases( val testClass: KClass<*>, val testSets: List, - val languagePipelines: List + val lastStages: List ) class ReadRunningTestsNumberBeforeAllTestsCallback : BeforeAllCallback { diff --git a/utbot-framework/src/main/kotlin/org/utbot/tests/infrastructure/TestCodeGeneratorPipeline.kt b/utbot-framework/src/main/kotlin/org/utbot/tests/infrastructure/TestCodeGeneratorPipeline.kt index fcf65e23b6..5cab79ad50 100644 --- a/utbot-framework/src/main/kotlin/org/utbot/tests/infrastructure/TestCodeGeneratorPipeline.kt +++ b/utbot-framework/src/main/kotlin/org/utbot/tests/infrastructure/TestCodeGeneratorPipeline.kt @@ -316,13 +316,16 @@ class TestCodeGeneratorPipeline(private val testFrameworkConfiguration: TestFram companion object { var currentTestFrameworkConfiguration = defaultTestFrameworkConfiguration() - fun defaultTestFrameworkConfiguration(language: CodegenLanguage = CodegenLanguage.JAVA) = TestFrameworkConfiguration( + fun defaultTestFrameworkConfiguration( + language: CodegenLanguage = CodegenLanguage.JAVA, + parameterizationMode: ParametrizedTestSource = ParametrizedTestSource.defaultItem + ) = TestFrameworkConfiguration( testFramework = TestFramework.defaultItem, codegenLanguage = language, mockFramework = MockFramework.defaultItem, mockStrategy = MockStrategyApi.defaultItem, staticsMocking = StaticsMocking.defaultItem, - parametrizedTestSource = ParametrizedTestSource.defaultItem, + parametrizedTestSource = parameterizationMode, forceStaticMocking = ForceStaticMocking.defaultItem, generateUtilClassFile = false ) diff --git a/utbot-framework/src/main/kotlin/org/utbot/tests/infrastructure/TestSpecificTestCaseGenerator.kt b/utbot-framework/src/main/kotlin/org/utbot/tests/infrastructure/TestSpecificTestCaseGenerator.kt index 0f90157486..3ab7e3d33f 100644 --- a/utbot-framework/src/main/kotlin/org/utbot/tests/infrastructure/TestSpecificTestCaseGenerator.kt +++ b/utbot-framework/src/main/kotlin/org/utbot/tests/infrastructure/TestSpecificTestCaseGenerator.kt @@ -10,15 +10,16 @@ import org.utbot.engine.UtBotSymbolicEngine import org.utbot.engine.util.mockListeners.ForceMockListener import org.utbot.engine.util.mockListeners.ForceStaticMockListener import org.utbot.framework.UtSettings -import org.utbot.framework.codegen.ParametrizedTestSource import org.utbot.framework.plugin.api.ExecutableId import org.utbot.framework.plugin.api.MockStrategyApi import org.utbot.framework.plugin.api.TestCaseGenerator import org.utbot.framework.plugin.api.UtError import org.utbot.framework.plugin.api.UtExecution import org.utbot.framework.plugin.api.UtMethodTestSet +import org.utbot.framework.plugin.api.UtSymbolicExecution import org.utbot.framework.plugin.api.util.id import org.utbot.framework.plugin.services.JdkInfoDefaultProvider +import org.utbot.framework.util.Conflict import org.utbot.framework.util.jimpleBody import java.nio.file.Path @@ -57,14 +58,8 @@ class TestSpecificTestCaseGenerator( val mockAlwaysDefaults = Mocker.javaDefaultClasses.mapTo(mutableSetOf()) { it.id } val defaultTimeEstimator = ExecutionTimeEstimator(UtSettings.utBotGenerationTimeoutInMillis, 1) - val config = TestCodeGeneratorPipeline.currentTestFrameworkConfiguration - var forceMockListener: ForceMockListener? = null - var forceStaticMockListener: ForceStaticMockListener? = null - - if (config.parametrizedTestSource == ParametrizedTestSource.PARAMETRIZE) { - forceMockListener = ForceMockListener.create(this, conflictTriggers) - forceStaticMockListener = ForceStaticMockListener.create(this, conflictTriggers) - } + val forceMockListener = ForceMockListener.create(this, conflictTriggers, cancelJob = false) + val forceStaticMockListener = ForceStaticMockListener.create(this, conflictTriggers, cancelJob = false) runIgnoringCancellationException { runBlockingWithCancellationPredicate(isCanceled) { @@ -74,7 +69,20 @@ class TestSpecificTestCaseGenerator( .generateAsync(controller, method, mockStrategy, mockAlwaysDefaults, defaultTimeEstimator) .collect { when (it) { - is UtExecution -> executions += it + is UtExecution -> { + if (it is UtSymbolicExecution && + (conflictTriggers.triggered(Conflict.ForceMockHappened) || + conflictTriggers.triggered(Conflict.ForceStaticMockHappened)) + ) { + it.containsMocking = true + + conflictTriggers.reset( + Conflict.ForceMockHappened, + Conflict.ForceStaticMockHappened + ) + } + executions += it + } is UtError -> errors.merge(it.description, 1, Int::plus) } } @@ -82,8 +90,8 @@ class TestSpecificTestCaseGenerator( } } - forceMockListener?.detach(this, forceMockListener) - forceStaticMockListener?.detach(this, forceStaticMockListener) + forceMockListener.detach(this, forceMockListener) + forceStaticMockListener.detach(this, forceStaticMockListener) val minimizedExecutions = super.minimizeExecutions(executions) return UtMethodTestSet(method, minimizedExecutions, jimpleBody(method), errors) diff --git a/utbot-framework/src/main/kotlin/org/utbot/tests/infrastructure/UtModelTestCaseChecker.kt b/utbot-framework/src/main/kotlin/org/utbot/tests/infrastructure/UtModelTestCaseChecker.kt index fb4399d81a..e47675135a 100644 --- a/utbot-framework/src/main/kotlin/org/utbot/tests/infrastructure/UtModelTestCaseChecker.kt +++ b/utbot-framework/src/main/kotlin/org/utbot/tests/infrastructure/UtModelTestCaseChecker.kt @@ -44,11 +44,11 @@ import kotlin.reflect.KFunction3 abstract class UtModelTestCaseChecker( testClass: KClass<*>, testCodeGeneration: Boolean = true, - languagePipelines: List = listOf( - CodeGenerationLanguageLastStage(CodegenLanguage.JAVA), - CodeGenerationLanguageLastStage(CodegenLanguage.KOTLIN) + pipelines: List = listOf( + TestLastStage(CodegenLanguage.JAVA), + TestLastStage(CodegenLanguage.KOTLIN) ) -) : CodeGenerationIntegrationTest(testClass, testCodeGeneration, languagePipelines) { +) : CodeGenerationIntegrationTest(testClass, testCodeGeneration, pipelines) { protected fun check( method: KFunction2<*, *, *>, branches: ExecutionsNumberMatcher, diff --git a/utbot-framework/src/main/kotlin/org/utbot/tests/infrastructure/UtValueTestCaseChecker.kt b/utbot-framework/src/main/kotlin/org/utbot/tests/infrastructure/UtValueTestCaseChecker.kt index 6e321c4cf2..e631723b1b 100644 --- a/utbot-framework/src/main/kotlin/org/utbot/tests/infrastructure/UtValueTestCaseChecker.kt +++ b/utbot-framework/src/main/kotlin/org/utbot/tests/infrastructure/UtValueTestCaseChecker.kt @@ -69,11 +69,11 @@ import kotlin.reflect.KFunction5 abstract class UtValueTestCaseChecker( testClass: KClass<*>, testCodeGeneration: Boolean = true, - languagePipelines: List = listOf( - CodeGenerationLanguageLastStage(CodegenLanguage.JAVA), - CodeGenerationLanguageLastStage(CodegenLanguage.KOTLIN) + pipelines: List = listOf( + TestLastStage(CodegenLanguage.JAVA), + TestLastStage(CodegenLanguage.KOTLIN) ) -) : CodeGenerationIntegrationTest(testClass, testCodeGeneration, languagePipelines) { +) : CodeGenerationIntegrationTest(testClass, testCodeGeneration, pipelines) { // contains already analyzed by the engine methods private val analyzedMethods: MutableMap = mutableMapOf() diff --git a/utbot-intellij/src/main/kotlin/org/utbot/intellij/plugin/process/EngineProcess.kt b/utbot-intellij/src/main/kotlin/org/utbot/intellij/plugin/process/EngineProcess.kt index b4740eeb30..f44b56093f 100644 --- a/utbot-intellij/src/main/kotlin/org/utbot/intellij/plugin/process/EngineProcess.kt +++ b/utbot-intellij/src/main/kotlin/org/utbot/intellij/plugin/process/EngineProcess.kt @@ -356,7 +356,7 @@ class EngineProcess(parent: Lifetime, val project: Project) { forceMockWarning, forceStaticMockWarnings, testFrameworkWarnings, - model.conflictTriggers.triggered + model.conflictTriggers.anyTriggered ) ) diff --git a/utbot-summary-tests/src/test/kotlin/examples/SummaryTestCaseGeneratorTest.kt b/utbot-summary-tests/src/test/kotlin/examples/SummaryTestCaseGeneratorTest.kt index 86400d6d00..fcdc5d4b30 100644 --- a/utbot-summary-tests/src/test/kotlin/examples/SummaryTestCaseGeneratorTest.kt +++ b/utbot-summary-tests/src/test/kotlin/examples/SummaryTestCaseGeneratorTest.kt @@ -26,11 +26,11 @@ private const val COMMENT_SEPARATOR = "----------------------------------------- open class SummaryTestCaseGeneratorTest( testClass: KClass<*>, testCodeGeneration: Boolean = false, - languagePipelines: List = listOf( - CodeGenerationLanguageLastStage(CodegenLanguage.JAVA), - CodeGenerationLanguageLastStage(CodegenLanguage.KOTLIN, TestExecution) + pipelines: List = listOf( + TestLastStage(CodegenLanguage.JAVA), + TestLastStage(CodegenLanguage.KOTLIN, TestExecution) ) -) : UtValueTestCaseChecker(testClass, testCodeGeneration, languagePipelines) { +) : UtValueTestCaseChecker(testClass, testCodeGeneration, pipelines) { private lateinit var cookie: AutoCloseable @BeforeEach