Skip to content

Commit 95623c0

Browse files
authored
Move test-specific implementation #1349 (#1327)
1 parent 0aadc5f commit 95623c0

File tree

179 files changed

+583
-520
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

179 files changed

+583
-520
lines changed

settings.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ include("utbot-gradle")
3636
include("utbot-maven")
3737
include("utbot-summary-tests")
3838
include("utbot-framework-test")
39+
include("utbot-testing")
3940
include("utbot-rd")
4041
include("utbot-android-studio")
4142

utbot-analytics/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ dependencies {
3333
implementation group: 'org.apache.commons', name: 'commons-text', version: '1.9'
3434
implementation group: 'com.github.javaparser', name: 'javaparser-core', version: '3.22.1'
3535

36+
testImplementation project(':utbot-testing')
3637
testImplementation project(':utbot-framework').sourceSets.test.output
3738
}
3839

utbot-analytics/src/main/kotlin/org/utbot/features/FeatureProcessorWithStatesRepetition.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ class FeatureProcessorWithStatesRepetition(
107107
}
108108
}
109109

110-
internal class RewardEstimator {
110+
class RewardEstimator {
111111

112112
fun calculateRewards(testCases: List<TestCase>): Map<Int, Double> {
113113
val rewards = mutableMapOf<Int, Double>()

utbot-analytics/src/test/kotlin/org/utbot/features/FeatureProcessorWithRepetitionTest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ import org.junit.jupiter.api.Assertions
55
import org.junit.jupiter.api.BeforeAll
66
import org.junit.jupiter.api.Test
77
import org.utbot.analytics.EngineAnalyticsContext
8-
import org.utbot.tests.infrastructure.UtValueTestCaseChecker
98
import org.utbot.testcheckers.eq
109
import org.utbot.testcheckers.withFeaturePath
10+
import org.utbot.testing.UtValueTestCaseChecker
1111
import java.io.File
1212
import java.io.FileInputStream
1313

utbot-framework-api/src/main/kotlin/org/utbot/framework/plugin/api/UtExecutionResult.kt

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -102,11 +102,6 @@ inline fun UtExecutionResult.onFailure(action: (exception: Throwable) -> Unit):
102102
return this
103103
}
104104

105-
fun UtExecutionResult.getOrThrow(): UtModel = when (this) {
106-
is UtExecutionSuccess -> model
107-
is UtExecutionFailure -> throw exception
108-
}
109-
110105
fun UtExecutionResult.exceptionOrNull(): Throwable? = when (this) {
111106
is UtExecutionFailure -> rootCauseException
112107
is UtExecutionSuccess -> null

utbot-framework-test/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ configurations {
2222

2323
dependencies {
2424
api project(':utbot-framework-api')
25+
testImplementation project(':utbot-testing')
2526

2627
api project(':utbot-fuzzers')
2728
api project(':utbot-instrumentation')

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
package org.utbot.examples.algorithms
22

3-
import org.utbot.tests.infrastructure.UtValueTestCaseChecker
4-
import org.utbot.tests.infrastructure.ignoreExecutionsNumber
5-
import org.utbot.tests.infrastructure.isException
63
import org.utbot.framework.plugin.api.DocCodeStmt
74
import org.utbot.framework.plugin.api.DocPreTagStatement
85
import org.utbot.framework.plugin.api.DocRegularStmt
96
import org.utbot.framework.plugin.api.DocStatement
107
import org.junit.jupiter.api.Test
8+
import org.utbot.testing.UtValueTestCaseChecker
9+
import org.utbot.testing.ignoreExecutionsNumber
10+
import org.utbot.testing.isException
1111

1212
class BinarySearchTest : UtValueTestCaseChecker(testClass = BinarySearch::class,) {
1313
@Test

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
package org.utbot.examples.algorithms
22

3-
import org.utbot.tests.infrastructure.UtValueTestCaseChecker
4-
import org.utbot.examples.algorithms.CorrectBracketSequences.isBracket
5-
import org.utbot.examples.algorithms.CorrectBracketSequences.isOpen
6-
import org.utbot.tests.infrastructure.ignoreExecutionsNumber
7-
import org.utbot.tests.infrastructure.isException
8-
import org.utbot.tests.infrastructure.keyMatch
93
import org.utbot.framework.plugin.api.CodegenLanguage
104
import org.utbot.framework.plugin.api.DocCodeStmt
115
import org.utbot.framework.plugin.api.DocPreTagStatement
126
import org.utbot.framework.plugin.api.DocRegularStmt
137
import org.junit.jupiter.api.Test
8+
import org.utbot.examples.algorithms.CorrectBracketSequences.isBracket
9+
import org.utbot.examples.algorithms.CorrectBracketSequences.isOpen
1410
import org.utbot.testcheckers.eq
15-
import org.utbot.tests.infrastructure.CodeGeneration
11+
import org.utbot.testing.CodeGeneration
12+
import org.utbot.testing.UtValueTestCaseChecker
13+
import org.utbot.testing.ignoreExecutionsNumber
14+
import org.utbot.testing.isException
15+
import org.utbot.testing.keyMatch
1616

1717
internal class CorrectBracketSequencesTest : UtValueTestCaseChecker(
1818
testClass = CorrectBracketSequences::class,

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
package org.utbot.examples.algorithms
22

3-
import org.utbot.tests.infrastructure.UtValueTestCaseChecker
4-
import org.utbot.tests.infrastructure.ignoreExecutionsNumber
5-
import org.utbot.tests.infrastructure.isException
63
import org.junit.jupiter.api.Tag
74
import org.junit.jupiter.api.Test
85
import org.utbot.testcheckers.eq
6+
import org.utbot.testing.UtValueTestCaseChecker
7+
import org.utbot.testing.ignoreExecutionsNumber
8+
import org.utbot.testing.isException
99

1010
internal class GraphTest : UtValueTestCaseChecker(testClass = GraphExample::class) {
1111
@Test

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
package org.utbot.examples.algorithms
22

3-
import org.utbot.tests.infrastructure.UtValueTestCaseChecker
4-
import org.utbot.tests.infrastructure.ignoreExecutionsNumber
5-
import org.utbot.tests.infrastructure.isException
6-
import org.utbot.tests.infrastructure.keyMatch
73
import org.utbot.framework.plugin.api.DocCodeStmt
84
import org.utbot.framework.plugin.api.DocPreTagStatement
95
import org.utbot.framework.plugin.api.DocRegularStmt
@@ -12,7 +8,11 @@ import org.junit.jupiter.api.Test
128
import org.utbot.framework.plugin.api.CodegenLanguage
139
import org.utbot.testcheckers.eq
1410
import org.utbot.testcheckers.ge
15-
import org.utbot.tests.infrastructure.CodeGeneration
11+
import org.utbot.testing.CodeGeneration
12+
import org.utbot.testing.UtValueTestCaseChecker
13+
import org.utbot.testing.ignoreExecutionsNumber
14+
import org.utbot.testing.isException
15+
import org.utbot.testing.keyMatch
1616

1717
// TODO Kotlin mocks generics https://github.com/UnitTestBot/UTBotJava/issues/88
1818
internal class SortTest : UtValueTestCaseChecker(

utbot-framework-test/src/test/kotlin/org/utbot/examples/annotations/NotNullAnnotationTest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
package org.utbot.examples.annotations
22

3-
import org.utbot.tests.infrastructure.UtValueTestCaseChecker
43
import org.junit.jupiter.api.Disabled
54
import org.junit.jupiter.api.Test
65
import org.utbot.testcheckers.eq
6+
import org.utbot.testing.UtValueTestCaseChecker
77

88
internal class NotNullAnnotationTest : UtValueTestCaseChecker(testClass = NotNullAnnotation::class) {
99
@Test

utbot-framework-test/src/test/kotlin/org/utbot/examples/annotations/lombok/EnumWithAnnotationsTest.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
package org.utbot.examples.annotations.lombok
22

33
import org.junit.jupiter.api.Test
4-
import org.utbot.tests.infrastructure.DoNotCalculate
5-
import org.utbot.tests.infrastructure.UtValueTestCaseChecker
64
import org.utbot.testcheckers.eq
5+
import org.utbot.testing.DoNotCalculate
6+
import org.utbot.testing.UtValueTestCaseChecker
77

88
/**
99
* Tests for Lombok annotations

utbot-framework-test/src/test/kotlin/org/utbot/examples/annotations/lombok/EnumWithoutAnnotationsTest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
package org.utbot.examples.annotations.lombok
22

33
import org.junit.jupiter.api.Test
4-
import org.utbot.tests.infrastructure.UtValueTestCaseChecker
54
import org.utbot.testcheckers.eq
5+
import org.utbot.testing.UtValueTestCaseChecker
66

77
internal class EnumWithoutAnnotationsTest : UtValueTestCaseChecker(testClass = EnumWithoutAnnotations::class) {
88
@Test

utbot-framework-test/src/test/kotlin/org/utbot/examples/annotations/lombok/NotNullAnnotationsTest.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
package org.utbot.examples.annotations.lombok
22

33
import org.junit.jupiter.api.Test
4-
import org.utbot.tests.infrastructure.DoNotCalculate
5-
import org.utbot.tests.infrastructure.UtValueTestCaseChecker
64
import org.utbot.testcheckers.eq
5+
import org.utbot.testing.DoNotCalculate
6+
import org.utbot.testing.UtValueTestCaseChecker
77

88
/**
99
* Tests for Lombok NonNull annotation

utbot-framework-test/src/test/kotlin/org/utbot/examples/arrays/ArrayOfArraysTest.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
package org.utbot.examples.arrays
22

33
import org.junit.jupiter.api.Disabled
4-
import org.utbot.tests.infrastructure.UtValueTestCaseChecker
5-
import org.utbot.tests.infrastructure.DoNotCalculate
6-
import org.utbot.tests.infrastructure.atLeast
74
import org.utbot.examples.casts.ColoredPoint
85
import org.utbot.examples.casts.Point
9-
import org.utbot.tests.infrastructure.ignoreExecutionsNumber
106
import org.junit.jupiter.api.Test
117
import org.utbot.testcheckers.eq
128
import org.utbot.testcheckers.withoutMinimization
9+
import org.utbot.testing.DoNotCalculate
10+
import org.utbot.testing.UtValueTestCaseChecker
11+
import org.utbot.testing.atLeast
12+
import org.utbot.testing.ignoreExecutionsNumber
1313

1414
@Suppress("NestedLambdaShadowedImplicitParameter")
1515
internal class ArrayOfArraysTest : UtValueTestCaseChecker(testClass = ArrayOfArrays::class) {

utbot-framework-test/src/test/kotlin/org/utbot/examples/arrays/ArrayOfObjectsTest.kt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
package org.utbot.examples.arrays
22

3-
import org.utbot.tests.infrastructure.UtValueTestCaseChecker
4-
import org.utbot.tests.infrastructure.DoNotCalculate
5-
import org.utbot.tests.infrastructure.atLeast
6-
import org.utbot.tests.infrastructure.between
7-
import org.utbot.tests.infrastructure.ignoreExecutionsNumber
8-
import org.utbot.tests.infrastructure.isException
93
import org.utbot.framework.plugin.api.CodegenLanguage
104
import org.junit.jupiter.api.Test
115
import org.utbot.testcheckers.eq
126
import org.utbot.testcheckers.ge
13-
import org.utbot.tests.infrastructure.CodeGeneration
7+
import org.utbot.testing.CodeGeneration
8+
import org.utbot.testing.DoNotCalculate
9+
import org.utbot.testing.UtValueTestCaseChecker
10+
import org.utbot.testing.atLeast
11+
import org.utbot.testing.between
12+
import org.utbot.testing.ignoreExecutionsNumber
13+
import org.utbot.testing.isException
1414

1515
// TODO failed Kotlin compilation SAT-1332
1616
internal class ArrayOfObjectsTest : UtValueTestCaseChecker(

utbot-framework-test/src/test/kotlin/org/utbot/examples/arrays/ArrayStoreExceptionExamplesTest.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ import org.junit.jupiter.api.Disabled
44
import org.junit.jupiter.api.Test
55
import org.utbot.framework.plugin.api.CodegenLanguage
66
import org.utbot.testcheckers.eq
7-
import org.utbot.tests.infrastructure.AtLeast
8-
import org.utbot.tests.infrastructure.CodeGeneration
9-
import org.utbot.tests.infrastructure.UtValueTestCaseChecker
10-
import org.utbot.tests.infrastructure.isException
7+
import org.utbot.testing.AtLeast
8+
import org.utbot.testing.CodeGeneration
9+
import org.utbot.testing.UtValueTestCaseChecker
10+
import org.utbot.testing.isException
1111

1212
class ArrayStoreExceptionExamplesTest : UtValueTestCaseChecker(
1313
testClass = ArrayStoreExceptionExamples::class,

utbot-framework-test/src/test/kotlin/org/utbot/examples/arrays/ArraysOverwriteValueTest.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
package org.utbot.examples.arrays
22

3-
import org.utbot.tests.infrastructure.UtValueTestCaseChecker
43
import org.utbot.framework.plugin.api.CodegenLanguage
54
import org.junit.jupiter.api.Test
65
import org.utbot.testcheckers.eq
7-
import org.utbot.tests.infrastructure.CodeGeneration
6+
import org.utbot.testing.CodeGeneration
7+
import org.utbot.testing.UtValueTestCaseChecker
88

99
// TODO failed Kotlin compilation SAT-1332
1010
class ArraysOverwriteValueTest : UtValueTestCaseChecker(

utbot-framework-test/src/test/kotlin/org/utbot/examples/arrays/FinalStaticFieldArrayTest.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
package org.utbot.examples.arrays
22

3-
import org.utbot.tests.infrastructure.UtValueTestCaseChecker
4-
import org.utbot.tests.infrastructure.ignoreExecutionsNumber
53
import org.junit.jupiter.api.Test
4+
import org.utbot.testing.UtValueTestCaseChecker
5+
import org.utbot.testing.ignoreExecutionsNumber
66

77
internal class FinalStaticFieldArrayTest : UtValueTestCaseChecker(testClass = FinalStaticFieldArray::class) {
88

utbot-framework-test/src/test/kotlin/org/utbot/examples/arrays/IntArrayBasicsTest.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
package org.utbot.examples.arrays
22

33
import org.junit.jupiter.api.Disabled
4-
import org.utbot.tests.infrastructure.UtValueTestCaseChecker
5-
import org.utbot.tests.infrastructure.ignoreExecutionsNumber
6-
import org.utbot.tests.infrastructure.isException
74
import org.utbot.framework.plugin.api.CodegenLanguage
85
import org.junit.jupiter.api.Test
96
import org.utbot.testcheckers.eq
107
import org.utbot.testcheckers.ge
11-
import org.utbot.tests.infrastructure.CodeGeneration
8+
import org.utbot.testing.CodeGeneration
9+
import org.utbot.testing.UtValueTestCaseChecker
10+
import org.utbot.testing.ignoreExecutionsNumber
11+
import org.utbot.testing.isException
1212

1313
// TODO failed Kotlin compilation SAT-1332
1414
internal class IntArrayBasicsTest : UtValueTestCaseChecker(

utbot-framework-test/src/test/kotlin/org/utbot/examples/arrays/PrimitiveArraysTest.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
package org.utbot.examples.arrays
22

3-
import org.utbot.tests.infrastructure.UtValueTestCaseChecker
4-
import org.utbot.tests.infrastructure.atLeast
5-
import org.utbot.tests.infrastructure.isException
63
import org.utbot.framework.plugin.api.CodegenLanguage
74
import org.junit.jupiter.api.Test
85
import org.utbot.testcheckers.eq
9-
import org.utbot.tests.infrastructure.CodeGeneration
6+
import org.utbot.testing.CodeGeneration
7+
import org.utbot.testing.UtValueTestCaseChecker
8+
import org.utbot.testing.atLeast
9+
import org.utbot.testing.isException
1010

1111
// TODO failed Kotlin compilation SAT-1332
1212
internal class PrimitiveArraysTest : UtValueTestCaseChecker(

utbot-framework-test/src/test/kotlin/org/utbot/examples/casts/ArrayCastExampleTest.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
package org.utbot.examples.casts
22

33
import org.junit.jupiter.api.Disabled
4-
import org.utbot.tests.infrastructure.UtValueTestCaseChecker
5-
import org.utbot.tests.infrastructure.DoNotCalculate
64
import org.utbot.framework.plugin.api.CodegenLanguage
75
import org.junit.jupiter.api.Test
86
import org.utbot.testcheckers.eq
9-
import org.utbot.tests.infrastructure.CodeGeneration
7+
import org.utbot.testing.CodeGeneration
8+
import org.utbot.testing.DoNotCalculate
9+
import org.utbot.testing.UtValueTestCaseChecker
1010

1111
// TODO failed Kotlin compilation (generics) SAT-1332
1212
//TODO: SAT-1487 calculate coverage for all methods of this test class

utbot-framework-test/src/test/kotlin/org/utbot/examples/casts/CastClassTest.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
package org.utbot.examples.casts
22

33
import org.junit.jupiter.api.Test
4-
import org.utbot.tests.infrastructure.DoNotCalculate
5-
import org.utbot.tests.infrastructure.UtValueTestCaseChecker
64
import org.utbot.framework.plugin.api.CodegenLanguage
75
import org.utbot.testcheckers.eq
8-
import org.utbot.tests.infrastructure.CodeGeneration
6+
import org.utbot.testing.CodeGeneration
7+
import org.utbot.testing.DoNotCalculate
8+
import org.utbot.testing.UtValueTestCaseChecker
99

1010
internal class CastClassTest : UtValueTestCaseChecker(
1111
testClass = CastClass::class,

utbot-framework-test/src/test/kotlin/org/utbot/examples/casts/CastExampleTest.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
package org.utbot.examples.casts
22

3-
import org.utbot.tests.infrastructure.UtValueTestCaseChecker
4-
import org.utbot.tests.infrastructure.DoNotCalculate
5-
import org.utbot.tests.infrastructure.isException
63
import org.utbot.framework.plugin.api.CodegenLanguage
74
import org.junit.jupiter.api.Test
85
import org.utbot.testcheckers.eq
9-
import org.utbot.tests.infrastructure.CodeGeneration
6+
import org.utbot.testing.CodeGeneration
7+
import org.utbot.testing.DoNotCalculate
8+
import org.utbot.testing.UtValueTestCaseChecker
9+
import org.utbot.testing.isException
1010

1111
// TODO failed Kotlin compilation SAT-1332
1212
internal class CastExampleTest : UtValueTestCaseChecker(

utbot-framework-test/src/test/kotlin/org/utbot/examples/casts/GenericCastExampleTest.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
package org.utbot.examples.casts
22

3-
import org.utbot.tests.infrastructure.UtValueTestCaseChecker
4-
import org.utbot.tests.infrastructure.DoNotCalculate
5-
import org.utbot.tests.infrastructure.between
63
import org.utbot.framework.plugin.api.CodegenLanguage
74
import org.junit.jupiter.api.Test
85
import org.utbot.testcheckers.eq
9-
import org.utbot.tests.infrastructure.CodeGeneration
6+
import org.utbot.testing.CodeGeneration
7+
import org.utbot.testing.DoNotCalculate
8+
import org.utbot.testing.UtValueTestCaseChecker
9+
import org.utbot.testing.between
1010

1111
// TODO failed Kotlin compilation SAT-1332
1212
internal class GenericCastExampleTest : UtValueTestCaseChecker(

utbot-framework-test/src/test/kotlin/org/utbot/examples/casts/InstanceOfExampleTest.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
package org.utbot.examples.casts
22

3-
import org.utbot.tests.infrastructure.UtValueTestCaseChecker
4-
import org.utbot.tests.infrastructure.DoNotCalculate
5-
import org.utbot.tests.infrastructure.ignoreExecutionsNumber
63
import org.utbot.framework.plugin.api.CodegenLanguage
74
import org.junit.jupiter.api.Disabled
85
import org.junit.jupiter.api.Test
96
import org.utbot.testcheckers.eq
107
import org.utbot.testcheckers.ge
11-
import org.utbot.tests.infrastructure.CodeGeneration
8+
import org.utbot.testing.CodeGeneration
9+
import org.utbot.testing.DoNotCalculate
10+
import org.utbot.testing.UtValueTestCaseChecker
11+
import org.utbot.testing.ignoreExecutionsNumber
1212

1313
// TODO failed Kotlin compilation SAT-1332
1414
internal class InstanceOfExampleTest : UtValueTestCaseChecker(

0 commit comments

Comments
 (0)