From 59757287f36930e4758a66138057463d0197aff1 Mon Sep 17 00:00:00 2001 From: Andrey Tarbeev Date: Fri, 7 Oct 2022 12:43:48 +0300 Subject: [PATCH 1/3] Add parameterized test generation in ci --- .../org/utbot/framework/plugin/api/Api.kt | 4 +- .../algorithms/CorrectBracketSequencesTest.kt | 6 +-- .../org/utbot/examples/algorithms/SortTest.kt | 6 +-- .../examples/arrays/ArrayOfObjectsTest.kt | 6 +-- .../arrays/ArrayStoreExceptionExamplesTest.kt | 6 +-- .../arrays/ArraysOverwriteValueTest.kt | 6 +-- .../examples/arrays/IntArrayBasicsTest.kt | 6 +-- .../examples/arrays/PrimitiveArraysTest.kt | 6 +-- .../examples/casts/ArrayCastExampleTest.kt | 6 +-- .../org/utbot/examples/casts/CastClassTest.kt | 6 +-- .../utbot/examples/casts/CastExampleTest.kt | 6 +-- .../examples/casts/GenericCastExampleTest.kt | 6 +-- .../examples/casts/InstanceOfExampleTest.kt | 6 +-- .../ClassWithStaticAndInnerClassesTest.kt | 12 ++++- .../examples/codegen/VoidStaticMethodsTest.kt | 5 +- ...ClassWithCrossReferenceRelationshipTest.kt | 6 +-- .../deepequals/ClassWithNullableFieldTest.kt | 6 +-- .../codegen/deepequals/DeepEqualsTest.kt | 6 +-- .../collections/CustomerExamplesTest.kt | 8 +-- .../collections/GenericListsExampleTest.kt | 6 +-- .../examples/collections/LinkedListsTest.kt | 6 +-- .../collections/ListAlgorithmsTest.kt | 6 +-- .../examples/collections/ListIteratorsTest.kt | 6 +-- .../collections/ListWrapperReturnsVoidTest.kt | 6 +-- .../examples/collections/ListsPart1Test.kt | 6 +-- .../examples/collections/ListsPart2Test.kt | 6 +-- .../examples/collections/ListsPart3Test.kt | 6 +-- .../examples/collections/MapEntrySetTest.kt | 6 +-- .../examples/collections/MapKeySetTest.kt | 7 +-- .../examples/collections/MapValuesTest.kt | 6 +-- .../examples/collections/MapsPart1Test.kt | 6 +-- .../examples/collections/MapsPart2Test.kt | 6 +-- .../examples/collections/OptionalsTest.kt | 6 +-- .../examples/collections/QueueUsagesTest.kt | 6 +-- .../examples/collections/SetIteratorsTest.kt | 6 +-- .../utbot/examples/collections/SetsTest.kt | 6 +-- .../examples/enums/ComplexEnumExamplesTest.kt | 6 +-- .../exceptions/ExceptionExamplesTest.kt | 6 +-- .../lambda/CustomPredicateExampleTest.kt | 6 +-- .../lambda/SimpleLambdaExamplesTest.kt | 6 +-- .../ClassWithComplicatedMethodsTest.kt | 6 +-- .../examples/math/OverflowAsErrorTest.kt | 4 +- .../utbot/examples/mixed/LoggerExampleTest.kt | 6 +-- .../org/utbot/examples/mock/FieldMockTest.kt | 11 ++++- .../utbot/examples/mock/MockFinalClassTest.kt | 11 ++++- .../org/utbot/examples/mock/MockRandomTest.kt | 8 +-- .../mock/MockStaticMethodExampleTest.kt | 8 +-- .../org/utbot/examples/mock/UseNetworkTest.kt | 2 + .../CompositeModelMinimizationChecker.kt | 6 +-- .../models/ModelsIdEqualityChecker.kt | 6 +-- .../examples/natives/NativeExamplesTest.kt | 6 +-- .../objects/AnonymousClassesExampleTest.kt | 11 ++++- .../utbot/examples/objects/ClassRefTest.kt | 6 +-- .../examples/objects/ClassWithClassRefTest.kt | 6 +-- .../objects/ObjectWithFinalStaticTest.kt | 6 +-- .../SimpleClassMultiInstanceExampleTest.kt | 5 +- .../utbot/examples/recursion/RecursionTest.kt | 6 +-- .../examples/stream/BaseStreamExampleTest.kt | 6 +-- .../stream/DoubleStreamExampleTest.kt | 6 +-- .../examples/stream/IntStreamExampleTest.kt | 6 +-- .../examples/stream/LongStreamExampleTest.kt | 6 +-- .../examples/strings/StringExamplesTest.kt | 6 +-- .../structures/StandardStructuresTest.kt | 6 +-- .../examples/wrappers/CharacterWrapperTest.kt | 6 +-- .../examples/wrappers/LongWrapperTest.kt | 6 +-- .../util/mockListeners/ForceMockListener.kt | 8 +-- .../mockListeners/ForceStaticMockListener.kt | 8 +-- .../model/constructor/CgMethodTestSet.kt | 9 ++++ .../tree/CgTestClassConstructor.kt | 2 +- .../org/utbot/framework/process/EngineMain.kt | 4 +- .../org/utbot/framework/util/TestUtils.kt | 6 ++- .../CodeGenerationIntegrationTest.kt | 49 ++++++++++++++----- .../TestCodeGeneratorPipeline.kt | 7 ++- .../TestSpecificTestCaseGenerator.kt | 29 ++++++----- .../infrastructure/UtModelTestCaseChecker.kt | 8 +-- .../infrastructure/UtValueTestCaseChecker.kt | 8 +-- .../intellij/plugin/process/EngineProcess.kt | 2 +- .../examples/SummaryTestCaseGeneratorTest.kt | 8 +-- 78 files changed, 330 insertions(+), 226 deletions(-) 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..aa3fce61f3 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 @@ -103,7 +103,9 @@ abstract class UtExecution( var summary: List? = null, var testMethodName: String? = null, var displayName: String? = null -) : UtResult() +) : UtResult() { + var wasForceMocked: Boolean = false +} /** * Symbolic execution. 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..215edd167c 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( + CodeGenerationLastStage(CodegenLanguage.JAVA), + CodeGenerationLastStage(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..6c01352d2f 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( + CodeGenerationLastStage(CodegenLanguage.JAVA), + CodeGenerationLastStage(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..f3b6f7a57e 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( + CodeGenerationLastStage(CodegenLanguage.JAVA), + CodeGenerationLastStage(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..4fec4f7a56 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( + CodeGenerationLastStage(CodegenLanguage.JAVA), // Type inference errors in generated Kotlin code - CodeGenerationLanguageLastStage(CodegenLanguage.KOTLIN, CodeGeneration) + CodeGenerationLastStage(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..9da270bb97 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( + CodeGenerationLastStage(CodegenLanguage.JAVA), + CodeGenerationLastStage(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..53b96520a7 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( + CodeGenerationLastStage(CodegenLanguage.JAVA), + CodeGenerationLastStage(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..1b429e89bf 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( + CodeGenerationLastStage(CodegenLanguage.JAVA), + CodeGenerationLastStage(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..20146609c8 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( + CodeGenerationLastStage(CodegenLanguage.JAVA), + CodeGenerationLastStage(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..bd2459d195 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( + CodeGenerationLastStage(CodegenLanguage.JAVA), + CodeGenerationLastStage(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..418835132e 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( + CodeGenerationLastStage(CodegenLanguage.JAVA), + CodeGenerationLastStage(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..ac2d921ac2 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( + CodeGenerationLastStage(CodegenLanguage.JAVA), + CodeGenerationLastStage(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..913c8c06d8 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( + CodeGenerationLastStage(CodegenLanguage.JAVA), + CodeGenerationLastStage(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..9392731d55 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 @@ -1,12 +1,22 @@ package org.utbot.examples.codegen +import org.junit.jupiter.api.Disabled 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( + CodeGenerationLastStage(CodegenLanguage.JAVA, lastStage = TestExecution, parameterizedModeLastStage = Compilation), + CodeGenerationLastStage(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..96cb7a52a7 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( + CodeGenerationLastStage(CodegenLanguage.JAVA), + CodeGenerationLastStage(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..ef06818679 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( + CodeGenerationLastStage(CodegenLanguage.JAVA), + CodeGenerationLastStage(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..b9f0e9816f 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( + CodeGenerationLastStage(CodegenLanguage.JAVA), + CodeGenerationLastStage(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..5456002eba 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( + CodeGenerationLastStage(CodegenLanguage.JAVA, lastStage = TestExecution, parameterizedModeLastStage = Compilation), + CodeGenerationLastStage(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..641b2713c6 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( + CodeGenerationLastStage(CodegenLanguage.JAVA), + CodeGenerationLastStage(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..1a82221ccc 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( + CodeGenerationLastStage(CodegenLanguage.JAVA), + CodeGenerationLastStage(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..e6839f5374 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( + CodeGenerationLastStage(CodegenLanguage.JAVA), + CodeGenerationLastStage(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..1046864bcb 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( + CodeGenerationLastStage(CodegenLanguage.JAVA), + CodeGenerationLastStage(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..17526ac169 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( + CodeGenerationLastStage(CodegenLanguage.JAVA), + CodeGenerationLastStage(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..7d90c39c9d 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( + CodeGenerationLastStage(CodegenLanguage.JAVA), + CodeGenerationLastStage(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..fc83600fab 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( + CodeGenerationLastStage(CodegenLanguage.JAVA), + CodeGenerationLastStage(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..203078842d 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( + CodeGenerationLastStage(CodegenLanguage.JAVA), + CodeGenerationLastStage(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..e898a7ba60 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( + CodeGenerationLastStage(CodegenLanguage.JAVA), + CodeGenerationLastStage(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..5bd4899e4d 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 @@ -13,14 +13,15 @@ import org.utbot.testcheckers.ge import org.utbot.testcheckers.withPushingStateFromPathSelectorForConcrete import org.utbot.testcheckers.withoutMinimization import org.utbot.tests.infrastructure.CodeGeneration +import org.utbot.tests.infrastructure.Compilation // TODO failed Kotlin compilation SAT-1332 class MapKeySetTest : UtValueTestCaseChecker( testClass = MapKeySet::class, testCodeGeneration = true, - languagePipelines = listOf( - CodeGenerationLanguageLastStage(CodegenLanguage.JAVA), - CodeGenerationLanguageLastStage(CodegenLanguage.KOTLIN, CodeGeneration) + pipelines = listOf( + CodeGenerationLastStage(CodegenLanguage.JAVA), + CodeGenerationLastStage(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..59b6e628d4 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( + CodeGenerationLastStage(CodegenLanguage.JAVA), + CodeGenerationLastStage(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..f1d88f2c98 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( + CodeGenerationLastStage(CodegenLanguage.JAVA), + CodeGenerationLastStage(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..325146dde5 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( + CodeGenerationLastStage(CodegenLanguage.JAVA), + CodeGenerationLastStage(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..bf5ad82f09 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( + CodeGenerationLastStage(CodegenLanguage.JAVA), + CodeGenerationLastStage(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..2e22f56c69 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( + CodeGenerationLastStage(CodegenLanguage.JAVA), + CodeGenerationLastStage(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..a74cff92f5 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( + CodeGenerationLastStage(CodegenLanguage.JAVA), + CodeGenerationLastStage(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..ffe9d70414 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( + CodeGenerationLastStage(CodegenLanguage.JAVA), + CodeGenerationLastStage(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..cacbc37d5d 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( + CodeGenerationLastStage(CodegenLanguage.JAVA), + CodeGenerationLastStage(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..4db58a3611 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( + CodeGenerationLastStage(CodegenLanguage.JAVA), + CodeGenerationLastStage(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..b17a3032d9 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( + CodeGenerationLastStage(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) + CodeGenerationLastStage(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..b2b8b7c901 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( + CodeGenerationLastStage(CodegenLanguage.JAVA), + CodeGenerationLastStage(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..14b8a51e53 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( + CodeGenerationLastStage(CodegenLanguage.JAVA, Compilation), + CodeGenerationLastStage(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..a817038695 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), + CodeGenerationLastStage(CodegenLanguage.JAVA, Compilation), + CodeGenerationLastStage(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..6cb809344b 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( + CodeGenerationLastStage(CodegenLanguage.JAVA), + CodeGenerationLastStage(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..ad028496cc 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( + CodeGenerationLastStage(CodegenLanguage.JAVA, lastStage = TestExecution, parameterizedModeLastStage = Compilation), + CodeGenerationLastStage(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..f873a8cc37 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( + CodeGenerationLastStage(CodegenLanguage.JAVA, lastStage = TestExecution, parameterizedModeLastStage = Compilation), + CodeGenerationLastStage(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..c74c62e96b 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( + CodeGenerationLastStage(CodegenLanguage.JAVA, lastStage = TestExecution, parameterizedModeLastStage = Compilation), + CodeGenerationLastStage(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..9a5b255d3a 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( + CodeGenerationLastStage(CodegenLanguage.JAVA, lastStage = TestExecution, parameterizedModeLastStage = Compilation), + CodeGenerationLastStage(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..b1db5ae04b 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( + CodeGenerationLastStage(CodegenLanguage.JAVA), + CodeGenerationLastStage(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..64d07b7c39 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( + CodeGenerationLastStage(CodegenLanguage.JAVA), + CodeGenerationLastStage(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..84a2c4e3e6 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( + CodeGenerationLastStage(CodegenLanguage.JAVA), + CodeGenerationLastStage(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..488f571486 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( + CodeGenerationLastStage(CodegenLanguage.JAVA, lastStage = TestExecution, parameterizedModeLastStage = Compilation), + CodeGenerationLastStage(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..7325a252d4 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( + CodeGenerationLastStage(CodegenLanguage.JAVA), // TODO: SAT-1457 Restore Kotlin codegen for a group of tests with type casts - CodeGenerationLanguageLastStage(CodegenLanguage.KOTLIN, CodeGeneration) + CodeGenerationLastStage(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..be00c6476d 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( + CodeGenerationLastStage(CodegenLanguage.JAVA, Compilation), // TODO JIRA:1479 + CodeGenerationLastStage(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..e32baad132 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( + CodeGenerationLastStage(CodegenLanguage.JAVA), + CodeGenerationLastStage(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..2fb31f68e5 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( + CodeGenerationLastStage(CodegenLanguage.JAVA), + CodeGenerationLastStage(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..f3567ea8a4 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( + CodeGenerationLastStage(CodegenLanguage.JAVA), + CodeGenerationLastStage(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..25d44ab1e0 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( + CodeGenerationLastStage(CodegenLanguage.JAVA), + CodeGenerationLastStage(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..bdc33449d9 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( + CodeGenerationLastStage(CodegenLanguage.JAVA), + CodeGenerationLastStage(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..0fa23e36ff 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( + CodeGenerationLastStage(CodegenLanguage.JAVA), + CodeGenerationLastStage(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..490e52b12e 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( + CodeGenerationLastStage(CodegenLanguage.JAVA), + CodeGenerationLastStage(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..f435210065 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( + CodeGenerationLastStage(CodegenLanguage.JAVA), + CodeGenerationLastStage(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..5cbc54fe64 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( + CodeGenerationLastStage(CodegenLanguage.JAVA), + CodeGenerationLastStage(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..ebe4d08802 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( + CodeGenerationLastStage(CodegenLanguage.JAVA), + CodeGenerationLastStage(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..4d01d8cd9e 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 @@ -65,6 +65,15 @@ data class CgMethodTestSet private constructor( return executionsByStaticsUsage.map { (_, executions) -> substituteExecutions(executions) } } + /* + * Excludes executions with mocking from [CgMethodTestSet]. + * */ + fun excludeExecutionsWithMocking(): CgMethodTestSet { + val executionsWithoutMocking = executions.filter { !it.wasForceMocked } + + return substituteExecutions(executionsWithoutMocking) + } + /** * 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..b66df0f2d5 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,7 @@ internal class CgTestClassConstructor(val context: CgContext) : } } ParametrizedTestSource.PARAMETRIZE -> { - for (splitByExecutionTestSet in testSet.splitExecutionsByResult()) { + for (splitByExecutionTestSet in testSet.excludeExecutionsWithMocking().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..524899bb34 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,8 @@ 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.common.filterWhen +import org.utbot.framework.codegen.ParametrizedTestSource import java.nio.file.Path @TestInstance(TestInstance.Lifecycle.PER_CLASS) @@ -29,14 +31,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( + CodeGenerationLastStage(CodegenLanguage.JAVA), + CodeGenerationLastStage(CodegenLanguage.KOTLIN) ) ) { private val testSets: MutableList = arrayListOf() - data class CodeGenerationLanguageLastStage(val language: CodegenLanguage, val lastStage: Stage = TestExecution) + data class CodeGenerationLastStage( + val language: CodegenLanguage, + val lastStage: Stage = TestExecution, + val parameterizedModeLastStage: Stage = lastStage, + ) fun processTestCase(testSet: UtMethodTestSet) { if (testCodeGeneration) testSets += testSet @@ -91,27 +97,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 +163,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..1873f721be 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 @@ -19,6 +19,7 @@ import org.utbot.framework.plugin.api.UtExecution import org.utbot.framework.plugin.api.UtMethodTestSet 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,19 @@ class TestSpecificTestCaseGenerator( .generateAsync(controller, method, mockStrategy, mockAlwaysDefaults, defaultTimeEstimator) .collect { when (it) { - is UtExecution -> executions += it + is UtExecution -> { + if ( + conflictTriggers.triggered(Conflict.ForceMockHappened) || + conflictTriggers.triggered(Conflict.ForceStaticMockHappened) + ) { + it.wasForceMocked = true + conflictTriggers.reset( + Conflict.ForceMockHappened, + Conflict.ForceStaticMockHappened + ) + } + executions += it + } is UtError -> errors.merge(it.description, 1, Int::plus) } } @@ -82,8 +89,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..2e0fc3c1b1 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( + CodeGenerationLastStage(CodegenLanguage.JAVA), + CodeGenerationLastStage(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..c70e2f7b85 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( + CodeGenerationLastStage(CodegenLanguage.JAVA), + CodeGenerationLastStage(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..de86786362 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( + CodeGenerationLastStage(CodegenLanguage.JAVA), + CodeGenerationLastStage(CodegenLanguage.KOTLIN, TestExecution) ) -) : UtValueTestCaseChecker(testClass, testCodeGeneration, languagePipelines) { +) : UtValueTestCaseChecker(testClass, testCodeGeneration, pipelines) { private lateinit var cookie: AutoCloseable @BeforeEach From d8f175b0b365fde642a15e9e7adb2f8cf00df9c8 Mon Sep 17 00:00:00 2001 From: Egor Kulikov Date: Tue, 11 Oct 2022 15:02:39 +0300 Subject: [PATCH 2/3] Little style corrections --- .../main/kotlin/org/utbot/framework/plugin/api/Api.kt | 2 +- .../algorithms/CorrectBracketSequencesTest.kt | 4 ++-- .../kotlin/org/utbot/examples/algorithms/SortTest.kt | 4 ++-- .../org/utbot/examples/arrays/ArrayOfObjectsTest.kt | 4 ++-- .../arrays/ArrayStoreExceptionExamplesTest.kt | 4 ++-- .../utbot/examples/arrays/ArraysOverwriteValueTest.kt | 4 ++-- .../org/utbot/examples/arrays/IntArrayBasicsTest.kt | 4 ++-- .../org/utbot/examples/arrays/PrimitiveArraysTest.kt | 4 ++-- .../org/utbot/examples/casts/ArrayCastExampleTest.kt | 4 ++-- .../kotlin/org/utbot/examples/casts/CastClassTest.kt | 4 ++-- .../org/utbot/examples/casts/CastExampleTest.kt | 4 ++-- .../utbot/examples/casts/GenericCastExampleTest.kt | 4 ++-- .../org/utbot/examples/casts/InstanceOfExampleTest.kt | 4 ++-- .../codegen/ClassWithStaticAndInnerClassesTest.kt | 5 ++--- .../ClassWithCrossReferenceRelationshipTest.kt | 4 ++-- .../codegen/deepequals/ClassWithNullableFieldTest.kt | 4 ++-- .../examples/codegen/deepequals/DeepEqualsTest.kt | 4 ++-- .../examples/collections/CustomerExamplesTest.kt | 4 ++-- .../examples/collections/GenericListsExampleTest.kt | 4 ++-- .../org/utbot/examples/collections/LinkedListsTest.kt | 4 ++-- .../utbot/examples/collections/ListAlgorithmsTest.kt | 4 ++-- .../utbot/examples/collections/ListIteratorsTest.kt | 4 ++-- .../collections/ListWrapperReturnsVoidTest.kt | 4 ++-- .../org/utbot/examples/collections/ListsPart1Test.kt | 4 ++-- .../org/utbot/examples/collections/ListsPart2Test.kt | 4 ++-- .../org/utbot/examples/collections/ListsPart3Test.kt | 4 ++-- .../org/utbot/examples/collections/MapEntrySetTest.kt | 4 ++-- .../org/utbot/examples/collections/MapKeySetTest.kt | 5 ++--- .../org/utbot/examples/collections/MapValuesTest.kt | 4 ++-- .../org/utbot/examples/collections/MapsPart1Test.kt | 4 ++-- .../org/utbot/examples/collections/MapsPart2Test.kt | 4 ++-- .../org/utbot/examples/collections/OptionalsTest.kt | 4 ++-- .../org/utbot/examples/collections/QueueUsagesTest.kt | 4 ++-- .../utbot/examples/collections/SetIteratorsTest.kt | 4 ++-- .../kotlin/org/utbot/examples/collections/SetsTest.kt | 4 ++-- .../utbot/examples/enums/ComplexEnumExamplesTest.kt | 4 ++-- .../examples/exceptions/ExceptionExamplesTest.kt | 4 ++-- .../examples/lambda/CustomPredicateExampleTest.kt | 4 ++-- .../utbot/examples/lambda/SimpleLambdaExamplesTest.kt | 4 ++-- .../make/symbolic/ClassWithComplicatedMethodsTest.kt | 4 ++-- .../org/utbot/examples/math/OverflowAsErrorTest.kt | 4 ++-- .../org/utbot/examples/mixed/LoggerExampleTest.kt | 4 ++-- .../kotlin/org/utbot/examples/mock/FieldMockTest.kt | 4 ++-- .../org/utbot/examples/mock/MockFinalClassTest.kt | 4 ++-- .../kotlin/org/utbot/examples/mock/MockRandomTest.kt | 4 ++-- .../examples/mock/MockStaticMethodExampleTest.kt | 4 ++-- .../models/CompositeModelMinimizationChecker.kt | 4 ++-- .../utbot/examples/models/ModelsIdEqualityChecker.kt | 4 ++-- .../org/utbot/examples/natives/NativeExamplesTest.kt | 4 ++-- .../examples/objects/AnonymousClassesExampleTest.kt | 4 ++-- .../kotlin/org/utbot/examples/objects/ClassRefTest.kt | 4 ++-- .../utbot/examples/objects/ClassWithClassRefTest.kt | 4 ++-- .../examples/objects/ObjectWithFinalStaticTest.kt | 4 ++-- .../org/utbot/examples/recursion/RecursionTest.kt | 4 ++-- .../utbot/examples/stream/BaseStreamExampleTest.kt | 4 ++-- .../utbot/examples/stream/DoubleStreamExampleTest.kt | 4 ++-- .../org/utbot/examples/stream/IntStreamExampleTest.kt | 4 ++-- .../utbot/examples/stream/LongStreamExampleTest.kt | 4 ++-- .../org/utbot/examples/strings/StringExamplesTest.kt | 4 ++-- .../examples/structures/StandardStructuresTest.kt | 4 ++-- .../utbot/examples/wrappers/CharacterWrapperTest.kt | 4 ++-- .../org/utbot/examples/wrappers/LongWrapperTest.kt | 4 ++-- .../codegen/model/constructor/CgMethodTestSet.kt | 3 +-- .../model/constructor/tree/CgTestClassConstructor.kt | 5 ++++- .../infrastructure/CodeGenerationIntegrationTest.kt | 11 +++++------ .../infrastructure/TestSpecificTestCaseGenerator.kt | 9 +++------ .../tests/infrastructure/UtModelTestCaseChecker.kt | 6 +++--- .../tests/infrastructure/UtValueTestCaseChecker.kt | 6 +++--- .../kotlin/examples/SummaryTestCaseGeneratorTest.kt | 6 +++--- 69 files changed, 145 insertions(+), 149 deletions(-) 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 aa3fce61f3..293006f99e 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 @@ -104,7 +104,7 @@ abstract class UtExecution( var testMethodName: String? = null, var displayName: String? = null ) : UtResult() { - var wasForceMocked: Boolean = false + var containsMocking: Boolean = false } /** 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 215edd167c..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 @@ -18,8 +18,8 @@ internal class CorrectBracketSequencesTest : UtValueTestCaseChecker( testClass = CorrectBracketSequences::class, testCodeGeneration = true, pipelines = listOf( - CodeGenerationLastStage(CodegenLanguage.JAVA), - CodeGenerationLastStage(CodegenLanguage.KOTLIN, CodeGeneration) // TODO generics in lists + 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 6c01352d2f..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 @@ -19,8 +19,8 @@ internal class SortTest : UtValueTestCaseChecker( testClass = Sort::class, testCodeGeneration = true, pipelines = listOf( - CodeGenerationLastStage(CodegenLanguage.JAVA), - CodeGenerationLastStage(CodegenLanguage.KOTLIN, CodeGeneration) + 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 f3b6f7a57e..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 @@ -17,8 +17,8 @@ internal class ArrayOfObjectsTest : UtValueTestCaseChecker( testClass = ArrayOfObjects::class, testCodeGeneration = true, pipelines = listOf( - CodeGenerationLastStage(CodegenLanguage.JAVA), - CodeGenerationLastStage(CodegenLanguage.KOTLIN, CodeGeneration) + 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 4fec4f7a56..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 @@ -12,9 +12,9 @@ import org.utbot.tests.infrastructure.isException class ArrayStoreExceptionExamplesTest : UtValueTestCaseChecker( testClass = ArrayStoreExceptionExamples::class, pipelines = listOf( - CodeGenerationLastStage(CodegenLanguage.JAVA), + TestLastStage(CodegenLanguage.JAVA), // Type inference errors in generated Kotlin code - CodeGenerationLastStage(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 9da270bb97..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 @@ -11,8 +11,8 @@ class ArraysOverwriteValueTest : UtValueTestCaseChecker( testClass = ArraysOverwriteValue::class, testCodeGeneration = true, pipelines = listOf( - CodeGenerationLastStage(CodegenLanguage.JAVA), - CodeGenerationLastStage(CodegenLanguage.KOTLIN, CodeGeneration) + 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 53b96520a7..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 @@ -15,8 +15,8 @@ internal class IntArrayBasicsTest : UtValueTestCaseChecker( testClass = IntArrayBasics::class, testCodeGeneration = true, pipelines = listOf( - CodeGenerationLastStage(CodegenLanguage.JAVA), - CodeGenerationLastStage(CodegenLanguage.KOTLIN, CodeGeneration) + 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 1b429e89bf..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 @@ -13,8 +13,8 @@ internal class PrimitiveArraysTest : UtValueTestCaseChecker( testClass = PrimitiveArrays::class, testCodeGeneration = true, pipelines = listOf( - CodeGenerationLastStage(CodegenLanguage.JAVA), - CodeGenerationLastStage(CodegenLanguage.KOTLIN, CodeGeneration) + 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 20146609c8..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 @@ -14,8 +14,8 @@ internal class ArrayCastExampleTest : UtValueTestCaseChecker( testClass = ArrayCastExample::class, testCodeGeneration = true, pipelines = listOf( - CodeGenerationLastStage(CodegenLanguage.JAVA), - CodeGenerationLastStage(CodegenLanguage.KOTLIN, CodeGeneration) + 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 bd2459d195..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 @@ -11,8 +11,8 @@ internal class CastClassTest : UtValueTestCaseChecker( testClass = CastClass::class, testCodeGeneration = true, pipelines = listOf( - CodeGenerationLastStage(CodegenLanguage.JAVA), - CodeGenerationLastStage(CodegenLanguage.KOTLIN, CodeGeneration) + 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 418835132e..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 @@ -13,8 +13,8 @@ internal class CastExampleTest : UtValueTestCaseChecker( testClass = CastExample::class, testCodeGeneration = true, pipelines = listOf( - CodeGenerationLastStage(CodegenLanguage.JAVA), - CodeGenerationLastStage(CodegenLanguage.KOTLIN, CodeGeneration) + 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 ac2d921ac2..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 @@ -13,8 +13,8 @@ internal class GenericCastExampleTest : UtValueTestCaseChecker( testClass = GenericCastExample::class, testCodeGeneration = true, pipelines = listOf( - CodeGenerationLastStage(CodegenLanguage.JAVA), - CodeGenerationLastStage(CodegenLanguage.KOTLIN, CodeGeneration) + 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 913c8c06d8..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 @@ -15,8 +15,8 @@ internal class InstanceOfExampleTest : UtValueTestCaseChecker( testClass = InstanceOfExample::class, testCodeGeneration = true, pipelines = listOf( - CodeGenerationLastStage(CodegenLanguage.JAVA), - CodeGenerationLastStage(CodegenLanguage.KOTLIN, CodeGeneration) + 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 9392731d55..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 @@ -1,6 +1,5 @@ package org.utbot.examples.codegen -import org.junit.jupiter.api.Disabled import org.utbot.tests.infrastructure.UtValueTestCaseChecker import org.utbot.tests.infrastructure.DoNotCalculate import org.junit.jupiter.api.Test @@ -13,8 +12,8 @@ import org.utbot.tests.infrastructure.TestExecution internal class ClassWithStaticAndInnerClassesTest : UtValueTestCaseChecker( testClass = ClassWithStaticAndInnerClasses::class, pipelines = listOf( - CodeGenerationLastStage(CodegenLanguage.JAVA, lastStage = TestExecution, parameterizedModeLastStage = Compilation), - CodeGenerationLastStage(CodegenLanguage.KOTLIN, lastStage = TestExecution) + TestLastStage(CodegenLanguage.JAVA, lastStage = TestExecution, parameterizedModeLastStage = Compilation), + TestLastStage(CodegenLanguage.KOTLIN, lastStage = TestExecution) ) ) { @Test 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 96cb7a52a7..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 @@ -11,8 +11,8 @@ class ClassWithCrossReferenceRelationshipTest : UtValueTestCaseChecker( testClass = ClassWithCrossReferenceRelationship::class, testCodeGeneration = true, pipelines = listOf( - CodeGenerationLastStage(CodegenLanguage.JAVA), - CodeGenerationLastStage(CodegenLanguage.KOTLIN, CodeGeneration) + 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 ef06818679..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 @@ -11,8 +11,8 @@ class ClassWithNullableFieldTest : UtValueTestCaseChecker( testClass = ClassWithNullableField::class, testCodeGeneration = true, pipelines = listOf( - CodeGenerationLastStage(CodegenLanguage.JAVA), - CodeGenerationLastStage(CodegenLanguage.KOTLIN, CodeGeneration) + 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 b9f0e9816f..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 @@ -13,8 +13,8 @@ class DeepEqualsTest : UtValueTestCaseChecker( testClass = DeepEqualsTestingClass::class, testCodeGeneration = true, pipelines = listOf( - CodeGenerationLastStage(CodegenLanguage.JAVA), - CodeGenerationLastStage(CodegenLanguage.KOTLIN, CodeGeneration) + 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 5456002eba..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 @@ -16,8 +16,8 @@ internal class CustomerExamplesTest: UtValueTestCaseChecker( testClass = CustomerExamples::class, testCodeGeneration = true, pipelines = listOf( - CodeGenerationLastStage(CodegenLanguage.JAVA, lastStage = TestExecution, parameterizedModeLastStage = Compilation), - CodeGenerationLastStage(CodegenLanguage.KOTLIN, lastStage = CodeGeneration) + 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 641b2713c6..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 @@ -13,8 +13,8 @@ internal class GenericListsExampleTest : UtValueTestCaseChecker( testClass = GenericListsExample::class, testCodeGeneration = true, pipelines = listOf( - CodeGenerationLastStage(CodegenLanguage.JAVA), - CodeGenerationLastStage(CodegenLanguage.KOTLIN, CodeGeneration) + 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 1a82221ccc..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 @@ -13,8 +13,8 @@ internal class LinkedListsTest : UtValueTestCaseChecker( testClass = LinkedLists::class, testCodeGeneration = true, pipelines = listOf( - CodeGenerationLastStage(CodegenLanguage.JAVA), - CodeGenerationLastStage(CodegenLanguage.KOTLIN, CodeGeneration) + 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 e6839f5374..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 @@ -12,8 +12,8 @@ class ListAlgorithmsTest : UtValueTestCaseChecker( testClass = ListAlgorithms::class, testCodeGeneration = true, pipelines = listOf( - CodeGenerationLastStage(CodegenLanguage.JAVA), - CodeGenerationLastStage(CodegenLanguage.KOTLIN, CodeGeneration) + 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 1046864bcb..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 @@ -15,8 +15,8 @@ internal class ListIteratorsTest : UtValueTestCaseChecker( testClass = ListIterators::class, testCodeGeneration = true, pipelines = listOf( - CodeGenerationLastStage(CodegenLanguage.JAVA), - CodeGenerationLastStage(CodegenLanguage.KOTLIN, CodeGeneration) + 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 17526ac169..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 @@ -15,8 +15,8 @@ internal class ListWrapperReturnsVoidTest : UtValueTestCaseChecker( testClass = ListWrapperReturnsVoidExample::class, testCodeGeneration = true, pipelines = listOf( - CodeGenerationLastStage(CodegenLanguage.JAVA), - CodeGenerationLastStage(CodegenLanguage.KOTLIN, CodeGeneration) + 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 7d90c39c9d..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 @@ -13,8 +13,8 @@ internal class ListsPart1Test : UtValueTestCaseChecker( testClass = Lists::class, testCodeGeneration = true, pipelines = listOf( - CodeGenerationLastStage(CodegenLanguage.JAVA), - CodeGenerationLastStage(CodegenLanguage.KOTLIN, CodeGeneration) + 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 fc83600fab..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 @@ -13,8 +13,8 @@ internal class ListsPart2Test : UtValueTestCaseChecker( testClass = Lists::class, testCodeGeneration = true, pipelines = listOf( - CodeGenerationLastStage(CodegenLanguage.JAVA), - CodeGenerationLastStage(CodegenLanguage.KOTLIN, CodeGeneration) + 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 203078842d..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 @@ -16,8 +16,8 @@ internal class ListsPart3Test : UtValueTestCaseChecker( testClass = Lists::class, testCodeGeneration = true, pipelines = listOf( - CodeGenerationLastStage(CodegenLanguage.JAVA), - CodeGenerationLastStage(CodegenLanguage.KOTLIN, CodeGeneration) + 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 e898a7ba60..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 @@ -17,8 +17,8 @@ class MapEntrySetTest : UtValueTestCaseChecker( testClass = MapEntrySet::class, testCodeGeneration = true, pipelines = listOf( - CodeGenerationLastStage(CodegenLanguage.JAVA), - CodeGenerationLastStage(CodegenLanguage.KOTLIN, CodeGeneration) + 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 5bd4899e4d..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 @@ -13,15 +13,14 @@ import org.utbot.testcheckers.ge import org.utbot.testcheckers.withPushingStateFromPathSelectorForConcrete import org.utbot.testcheckers.withoutMinimization import org.utbot.tests.infrastructure.CodeGeneration -import org.utbot.tests.infrastructure.Compilation // TODO failed Kotlin compilation SAT-1332 class MapKeySetTest : UtValueTestCaseChecker( testClass = MapKeySet::class, testCodeGeneration = true, pipelines = listOf( - CodeGenerationLastStage(CodegenLanguage.JAVA), - CodeGenerationLastStage(CodegenLanguage.KOTLIN, CodeGeneration) + 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 59b6e628d4..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 @@ -17,8 +17,8 @@ class MapValuesTest : UtValueTestCaseChecker( testClass = MapValues::class, testCodeGeneration = true, pipelines = listOf( - CodeGenerationLastStage(CodegenLanguage.JAVA), - CodeGenerationLastStage(CodegenLanguage.KOTLIN, CodeGeneration) + 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 f1d88f2c98..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 @@ -20,8 +20,8 @@ internal class MapsPart1Test : UtValueTestCaseChecker( testClass = Maps::class, testCodeGeneration = true, pipelines = listOf( - CodeGenerationLastStage(CodegenLanguage.JAVA), - CodeGenerationLastStage(CodegenLanguage.KOTLIN, CodeGeneration) + 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 325146dde5..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 @@ -15,8 +15,8 @@ internal class MapsPart2Test : UtValueTestCaseChecker( testClass = Maps::class, testCodeGeneration = true, pipelines = listOf( - CodeGenerationLastStage(CodegenLanguage.JAVA), - CodeGenerationLastStage(CodegenLanguage.KOTLIN, CodeGeneration) + 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 bf5ad82f09..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 @@ -15,8 +15,8 @@ class OptionalsTest : UtValueTestCaseChecker( Optionals::class, testCodeGeneration = true, pipelines = listOf( - CodeGenerationLastStage(CodegenLanguage.JAVA), - CodeGenerationLastStage(CodegenLanguage.KOTLIN, CodeGeneration) + 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 2e22f56c69..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 @@ -12,8 +12,8 @@ class QueueUsagesTest : UtValueTestCaseChecker( testClass = QueueUsages::class, testCodeGeneration = true, pipelines = listOf( - CodeGenerationLastStage(CodegenLanguage.JAVA), - CodeGenerationLastStage(CodegenLanguage.KOTLIN, CodeGeneration) + 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 a74cff92f5..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 @@ -14,8 +14,8 @@ class SetIteratorsTest : UtValueTestCaseChecker( testClass = SetIterators::class, testCodeGeneration = true, pipelines = listOf( - CodeGenerationLastStage(CodegenLanguage.JAVA), - CodeGenerationLastStage(CodegenLanguage.KOTLIN, CodeGeneration) + 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 ffe9d70414..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 @@ -19,8 +19,8 @@ internal class SetsTest : UtValueTestCaseChecker( testClass = Sets::class, testCodeGeneration = true, pipelines = listOf( - CodeGenerationLastStage(CodegenLanguage.JAVA), - CodeGenerationLastStage(CodegenLanguage.KOTLIN, CodeGeneration) + 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 cacbc37d5d..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 @@ -16,8 +16,8 @@ class ComplexEnumExamplesTest : UtValueTestCaseChecker( testClass = ComplexEnumExamples::class, testCodeGeneration = true, pipelines = listOf( - CodeGenerationLastStage(CodegenLanguage.JAVA), - CodeGenerationLastStage(CodegenLanguage.KOTLIN, CodeGeneration) + 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 4db58a3611..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 @@ -13,8 +13,8 @@ internal class ExceptionExamplesTest : UtValueTestCaseChecker( testClass = ExceptionExamples::class, testCodeGeneration = true, pipelines = listOf( - CodeGenerationLastStage(CodegenLanguage.JAVA), - CodeGenerationLastStage(CodegenLanguage.KOTLIN, CodeGeneration) // TODO: fails because we construct lists with generics + 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 b17a3032d9..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 @@ -11,12 +11,12 @@ import org.utbot.tests.infrastructure.isException class CustomPredicateExampleTest : UtValueTestCaseChecker( testClass = CustomPredicateExample::class, pipelines = listOf( - CodeGenerationLastStage(CodegenLanguage.JAVA), + 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). - CodeGenerationLastStage(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 b2b8b7c901..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 @@ -12,8 +12,8 @@ import org.utbot.tests.infrastructure.isException class SimpleLambdaExamplesTest : UtValueTestCaseChecker( testClass = SimpleLambdaExamples::class, pipelines = listOf( - CodeGenerationLastStage(CodegenLanguage.JAVA), - CodeGenerationLastStage(CodegenLanguage.KOTLIN, CodeGeneration), + 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 14b8a51e53..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 @@ -19,8 +19,8 @@ internal class ClassWithComplicatedMethodsTest : UtValueTestCaseChecker( testClass = ClassWithComplicatedMethods::class, testCodeGeneration = true, pipelines = listOf( - CodeGenerationLastStage(CodegenLanguage.JAVA, Compilation), - CodeGenerationLastStage(CodegenLanguage.KOTLIN, Compilation) + 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 a817038695..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( - CodeGenerationLastStage(CodegenLanguage.JAVA, Compilation), - CodeGenerationLastStage(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 6cb809344b..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 @@ -16,8 +16,8 @@ internal class LoggerExampleTest : UtValueTestCaseChecker( testClass = LoggerExample::class, testCodeGeneration = true, pipelines = listOf( - CodeGenerationLastStage(CodegenLanguage.JAVA), - CodeGenerationLastStage(CodegenLanguage.KOTLIN, CodeGeneration) + 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 ad028496cc..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 @@ -18,8 +18,8 @@ import org.utbot.tests.infrastructure.TestExecution internal class FieldMockTest : UtValueTestCaseChecker( testClass = ServiceWithField::class, pipelines = listOf( - CodeGenerationLastStage(CodegenLanguage.JAVA, lastStage = TestExecution, parameterizedModeLastStage = Compilation), - CodeGenerationLastStage(CodegenLanguage.KOTLIN, lastStage = TestExecution) + TestLastStage(CodegenLanguage.JAVA, lastStage = TestExecution, parameterizedModeLastStage = Compilation), + TestLastStage(CodegenLanguage.KOTLIN, lastStage = TestExecution) ) ) { @Test 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 f873a8cc37..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 @@ -15,8 +15,8 @@ import org.utbot.tests.infrastructure.TestExecution internal class MockFinalClassTest : UtValueTestCaseChecker( testClass = MockFinalClassExample::class, pipelines = listOf( - CodeGenerationLastStage(CodegenLanguage.JAVA, lastStage = TestExecution, parameterizedModeLastStage = Compilation), - CodeGenerationLastStage(CodegenLanguage.KOTLIN, lastStage = TestExecution) + TestLastStage(CodegenLanguage.JAVA, lastStage = TestExecution, parameterizedModeLastStage = Compilation), + TestLastStage(CodegenLanguage.KOTLIN, lastStage = TestExecution) ) ) { @Test 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 c74c62e96b..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 @@ -22,8 +22,8 @@ internal class MockRandomTest : UtValueTestCaseChecker( testClass = MockRandomExamples::class, testCodeGeneration = true, pipelines = listOf( - CodeGenerationLastStage(CodegenLanguage.JAVA, lastStage = TestExecution, parameterizedModeLastStage = Compilation), - CodeGenerationLastStage(CodegenLanguage.KOTLIN, lastStage = CodeGeneration) + 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 9a5b255d3a..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 @@ -19,8 +19,8 @@ internal class MockStaticMethodExampleTest : UtValueTestCaseChecker( testClass = MockStaticMethodExample::class, testCodeGeneration = true, pipelines = listOf( - CodeGenerationLastStage(CodegenLanguage.JAVA, lastStage = TestExecution, parameterizedModeLastStage = Compilation), - CodeGenerationLastStage(CodegenLanguage.KOTLIN, lastStage = CodeGeneration) + 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/models/CompositeModelMinimizationChecker.kt b/utbot-framework-test/src/test/kotlin/org/utbot/examples/models/CompositeModelMinimizationChecker.kt index b1db5ae04b..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 @@ -15,8 +15,8 @@ internal class CompositeModelMinimizationChecker : UtModelTestCaseChecker( testClass = CompositeModelMinimizationExample::class, testCodeGeneration = true, pipelines = listOf( - CodeGenerationLastStage(CodegenLanguage.JAVA), - CodeGenerationLastStage(CodegenLanguage.KOTLIN, CodeGeneration) + 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 64d07b7c39..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 @@ -16,8 +16,8 @@ internal class ModelsIdEqualityChecker : UtModelTestCaseChecker( testClass = ModelsIdEqualityExample::class, testCodeGeneration = true, pipelines = listOf( - CodeGenerationLastStage(CodegenLanguage.JAVA), - CodeGenerationLastStage(CodegenLanguage.KOTLIN, CodeGeneration) + 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 84a2c4e3e6..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 @@ -14,8 +14,8 @@ internal class NativeExamplesTest : UtValueTestCaseChecker( testClass = NativeExamples::class, testCodeGeneration = true, pipelines = listOf( - CodeGenerationLastStage(CodegenLanguage.JAVA), - CodeGenerationLastStage(CodegenLanguage.KOTLIN, CodeGeneration) + 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 488f571486..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 @@ -12,8 +12,8 @@ import org.utbot.tests.infrastructure.TestExecution class AnonymousClassesExampleTest : UtValueTestCaseChecker( testClass = AnonymousClassesExample::class, pipelines = listOf( - CodeGenerationLastStage(CodegenLanguage.JAVA, lastStage = TestExecution, parameterizedModeLastStage = Compilation), - CodeGenerationLastStage(CodegenLanguage.KOTLIN, lastStage = TestExecution) + TestLastStage(CodegenLanguage.JAVA, lastStage = TestExecution, parameterizedModeLastStage = Compilation), + TestLastStage(CodegenLanguage.KOTLIN, lastStage = TestExecution) ) ) { @Test 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 7325a252d4..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 @@ -17,9 +17,9 @@ internal class ClassRefTest : UtValueTestCaseChecker( testClass = ClassRef::class, testCodeGeneration = true, pipelines = listOf( - CodeGenerationLastStage(CodegenLanguage.JAVA), + TestLastStage(CodegenLanguage.JAVA), // TODO: SAT-1457 Restore Kotlin codegen for a group of tests with type casts - CodeGenerationLastStage(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 be00c6476d..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 @@ -16,8 +16,8 @@ internal class ClassWithClassRefTest : UtValueTestCaseChecker( testClass = ClassWithClassRef::class, testCodeGeneration = true, pipelines = listOf( - CodeGenerationLastStage(CodegenLanguage.JAVA, Compilation), // TODO JIRA:1479 - CodeGenerationLastStage(CodegenLanguage.KOTLIN, CodeGeneration) + 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 e32baad132..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 @@ -12,8 +12,8 @@ class ObjectWithFinalStaticTest : UtValueTestCaseChecker( testClass = ObjectWithFinalStatic::class, testCodeGeneration = true, pipelines = listOf( - CodeGenerationLastStage(CodegenLanguage.JAVA), - CodeGenerationLastStage(CodegenLanguage.KOTLIN, CodeGeneration) + TestLastStage(CodegenLanguage.JAVA), + TestLastStage(CodegenLanguage.KOTLIN, CodeGeneration) ) ) { @Test 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 2fb31f68e5..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 @@ -23,8 +23,8 @@ internal class RecursionTest : UtValueTestCaseChecker( testClass = Recursion::class, testCodeGeneration = true, pipelines = listOf( - CodeGenerationLastStage(CodegenLanguage.JAVA), - CodeGenerationLastStage(CodegenLanguage.KOTLIN, CodeGeneration) + 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 f3567ea8a4..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 @@ -25,8 +25,8 @@ class BaseStreamExampleTest : UtValueTestCaseChecker( testClass = BaseStreamExample::class, testCodeGeneration = true, pipelines = listOf( - CodeGenerationLastStage(CodegenLanguage.JAVA), - CodeGenerationLastStage(CodegenLanguage.KOTLIN, CodeGeneration) + 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 25d44ab1e0..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 @@ -17,8 +17,8 @@ class DoubleStreamExampleTest : UtValueTestCaseChecker( testClass = DoubleStreamExample::class, testCodeGeneration = true, pipelines = listOf( - CodeGenerationLastStage(CodegenLanguage.JAVA), - CodeGenerationLastStage(CodegenLanguage.KOTLIN, CodeGeneration) + 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 bdc33449d9..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 @@ -18,8 +18,8 @@ class IntStreamExampleTest : UtValueTestCaseChecker( testClass = IntStreamExample::class, testCodeGeneration = true, pipelines = listOf( - CodeGenerationLastStage(CodegenLanguage.JAVA), - CodeGenerationLastStage(CodegenLanguage.KOTLIN, CodeGeneration) + 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 0fa23e36ff..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 @@ -18,8 +18,8 @@ class LongStreamExampleTest : UtValueTestCaseChecker( testClass = LongStreamExample::class, testCodeGeneration = true, pipelines = listOf( - CodeGenerationLastStage(CodegenLanguage.JAVA), - CodeGenerationLastStage(CodegenLanguage.KOTLIN, CodeGeneration) + 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 490e52b12e..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 @@ -21,8 +21,8 @@ internal class StringExamplesTest : UtValueTestCaseChecker( testClass = StringExamples::class, testCodeGeneration = true, pipelines = listOf( - CodeGenerationLastStage(CodegenLanguage.JAVA), - CodeGenerationLastStage(CodegenLanguage.KOTLIN, CodeGeneration) + 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 f435210065..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 @@ -19,8 +19,8 @@ import org.utbot.tests.infrastructure.CodeGeneration internal class StandardStructuresTest : UtValueTestCaseChecker( testClass = StandardStructures::class, pipelines = listOf( - CodeGenerationLastStage(CodegenLanguage.JAVA), - CodeGenerationLastStage(CodegenLanguage.KOTLIN, CodeGeneration) + 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 5cbc54fe64..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 @@ -13,8 +13,8 @@ internal class CharacterWrapperTest : UtValueTestCaseChecker( testClass = CharacterWrapper::class, testCodeGeneration = true, pipelines = listOf( - CodeGenerationLastStage(CodegenLanguage.JAVA), - CodeGenerationLastStage(CodegenLanguage.KOTLIN, CodeGeneration) + 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 ebe4d08802..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 @@ -13,8 +13,8 @@ internal class LongWrapperTest : UtValueTestCaseChecker( testClass = LongWrapper::class, testCodeGeneration = true, pipelines = listOf( - CodeGenerationLastStage(CodegenLanguage.JAVA), - CodeGenerationLastStage(CodegenLanguage.KOTLIN, CodeGeneration) + TestLastStage(CodegenLanguage.JAVA), + TestLastStage(CodegenLanguage.KOTLIN, CodeGeneration) ) ) { @Test 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 4d01d8cd9e..ac532526e6 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 @@ -69,8 +69,7 @@ data class CgMethodTestSet private constructor( * Excludes executions with mocking from [CgMethodTestSet]. * */ fun excludeExecutionsWithMocking(): CgMethodTestSet { - val executionsWithoutMocking = executions.filter { !it.wasForceMocked } - + val executionsWithoutMocking = executions.filter { !it.containsMocking } return substituteExecutions(executionsWithoutMocking) } 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 b66df0f2d5..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.excludeExecutionsWithMocking().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/tests/infrastructure/CodeGenerationIntegrationTest.kt b/utbot-framework/src/main/kotlin/org/utbot/tests/infrastructure/CodeGenerationIntegrationTest.kt index 524899bb34..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,7 +21,6 @@ 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.common.filterWhen import org.utbot.framework.codegen.ParametrizedTestSource import java.nio.file.Path @@ -31,14 +30,14 @@ import java.nio.file.Path abstract class CodeGenerationIntegrationTest( private val testClass: KClass<*>, private var testCodeGeneration: Boolean = true, - private val languagesLastStages: List = listOf( - CodeGenerationLastStage(CodegenLanguage.JAVA), - CodeGenerationLastStage(CodegenLanguage.KOTLIN) + private val languagesLastStages: List = listOf( + TestLastStage(CodegenLanguage.JAVA), + TestLastStage(CodegenLanguage.KOTLIN) ) ) { private val testSets: MutableList = arrayListOf() - data class CodeGenerationLastStage( + data class TestLastStage( val language: CodegenLanguage, val lastStage: Stage = TestExecution, val parameterizedModeLastStage: Stage = lastStage, @@ -168,7 +167,7 @@ abstract class CodeGenerationIntegrationTest( data class CodeGenerationTestCases( val testClass: KClass<*>, val testSets: List, - val lastStages: List + val lastStages: List ) class ReadRunningTestsNumberBeforeAllTestsCallback : BeforeAllCallback { 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 1873f721be..08243aeeb2 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,7 +10,6 @@ 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 @@ -74,11 +73,9 @@ class TestSpecificTestCaseGenerator( conflictTriggers.triggered(Conflict.ForceMockHappened) || conflictTriggers.triggered(Conflict.ForceStaticMockHappened) ) { - it.wasForceMocked = true - conflictTriggers.reset( - Conflict.ForceMockHappened, - Conflict.ForceStaticMockHappened - ) + it.containsMocking = true + + conflictTriggers.reset(Conflict.ForceMockHappened, Conflict.ForceStaticMockHappened) } executions += it } 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 2e0fc3c1b1..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,9 +44,9 @@ import kotlin.reflect.KFunction3 abstract class UtModelTestCaseChecker( testClass: KClass<*>, testCodeGeneration: Boolean = true, - pipelines: List = listOf( - CodeGenerationLastStage(CodegenLanguage.JAVA), - CodeGenerationLastStage(CodegenLanguage.KOTLIN) + pipelines: List = listOf( + TestLastStage(CodegenLanguage.JAVA), + TestLastStage(CodegenLanguage.KOTLIN) ) ) : CodeGenerationIntegrationTest(testClass, testCodeGeneration, pipelines) { protected fun check( 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 c70e2f7b85..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,9 +69,9 @@ import kotlin.reflect.KFunction5 abstract class UtValueTestCaseChecker( testClass: KClass<*>, testCodeGeneration: Boolean = true, - pipelines: List = listOf( - CodeGenerationLastStage(CodegenLanguage.JAVA), - CodeGenerationLastStage(CodegenLanguage.KOTLIN) + pipelines: List = listOf( + TestLastStage(CodegenLanguage.JAVA), + TestLastStage(CodegenLanguage.KOTLIN) ) ) : CodeGenerationIntegrationTest(testClass, testCodeGeneration, pipelines) { // contains already analyzed by the engine methods diff --git a/utbot-summary-tests/src/test/kotlin/examples/SummaryTestCaseGeneratorTest.kt b/utbot-summary-tests/src/test/kotlin/examples/SummaryTestCaseGeneratorTest.kt index de86786362..fcdc5d4b30 100644 --- a/utbot-summary-tests/src/test/kotlin/examples/SummaryTestCaseGeneratorTest.kt +++ b/utbot-summary-tests/src/test/kotlin/examples/SummaryTestCaseGeneratorTest.kt @@ -26,9 +26,9 @@ private const val COMMENT_SEPARATOR = "----------------------------------------- open class SummaryTestCaseGeneratorTest( testClass: KClass<*>, testCodeGeneration: Boolean = false, - pipelines: List = listOf( - CodeGenerationLastStage(CodegenLanguage.JAVA), - CodeGenerationLastStage(CodegenLanguage.KOTLIN, TestExecution) + pipelines: List = listOf( + TestLastStage(CodegenLanguage.JAVA), + TestLastStage(CodegenLanguage.KOTLIN, TestExecution) ) ) : UtValueTestCaseChecker(testClass, testCodeGeneration, pipelines) { private lateinit var cookie: AutoCloseable From b4d4e8b8408eeb58f1aa8ed7c160dfa3848edeef Mon Sep 17 00:00:00 2001 From: Andrey Tarbeev Date: Tue, 11 Oct 2022 16:12:05 +0300 Subject: [PATCH 3/3] Move *containsMocking* flag to UtSymbolicExecution --- .../kotlin/org/utbot/framework/plugin/api/Api.kt | 6 +++--- .../codegen/model/constructor/CgMethodTestSet.kt | 10 ++++++++-- .../infrastructure/TestSpecificTestCaseGenerator.kt | 12 ++++++++---- 3 files changed, 19 insertions(+), 9 deletions(-) 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 293006f99e..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 @@ -103,9 +103,7 @@ abstract class UtExecution( var summary: List? = null, var testMethodName: String? = null, var displayName: String? = null -) : UtResult() { - var containsMocking: Boolean = false -} +) : UtResult() /** * Symbolic execution. @@ -138,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/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 ac532526e6..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( @@ -69,8 +71,12 @@ data class CgMethodTestSet private constructor( * Excludes executions with mocking from [CgMethodTestSet]. * */ fun excludeExecutionsWithMocking(): CgMethodTestSet { - val executionsWithoutMocking = executions.filter { !it.containsMocking } - return substituteExecutions(executionsWithoutMocking) + val fuzzedExecutions = executions.filterIsInstance() + val symbolicExecutionsWithoutMocking = executions + .filterIsInstance() + .filter { !it.containsMocking } + + return substituteExecutions(symbolicExecutionsWithoutMocking + fuzzedExecutions) } /** 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 08243aeeb2..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 @@ -16,6 +16,7 @@ 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 @@ -69,13 +70,16 @@ class TestSpecificTestCaseGenerator( .collect { when (it) { is UtExecution -> { - if ( - conflictTriggers.triggered(Conflict.ForceMockHappened) || - conflictTriggers.triggered(Conflict.ForceStaticMockHappened) + if (it is UtSymbolicExecution && + (conflictTriggers.triggered(Conflict.ForceMockHappened) || + conflictTriggers.triggered(Conflict.ForceStaticMockHappened)) ) { it.containsMocking = true - conflictTriggers.reset(Conflict.ForceMockHappened, Conflict.ForceStaticMockHappened) + conflictTriggers.reset( + Conflict.ForceMockHappened, + Conflict.ForceStaticMockHappened + ) } executions += it }