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(

0 commit comments

Comments
 (0)