|
1 | 1 | package org.utbot.tests.infrastructure
|
2 | 2 |
|
3 | 3 | import kotlinx.coroutines.launch
|
| 4 | +import kotlinx.coroutines.runBlocking |
4 | 5 | import mu.KotlinLogging
|
5 |
| -import org.utbot.common.runBlockingWithCancellationPredicate |
6 |
| -import org.utbot.common.runIgnoringCancellationException |
7 | 6 | import org.utbot.engine.EngineController
|
8 | 7 | import org.utbot.engine.Mocker
|
9 | 8 | import org.utbot.engine.UtBotSymbolicEngine
|
@@ -61,32 +60,30 @@ class TestSpecificTestCaseGenerator(
|
61 | 60 | val forceMockListener = ForceMockListener.create(this, conflictTriggers, cancelJob = false)
|
62 | 61 | val forceStaticMockListener = ForceStaticMockListener.create(this, conflictTriggers, cancelJob = false)
|
63 | 62 |
|
64 |
| - runIgnoringCancellationException { |
65 |
| - runBlockingWithCancellationPredicate(isCanceled) { |
66 |
| - val controller = EngineController() |
67 |
| - controller.job = launch { |
68 |
| - super |
69 |
| - .generateAsync(controller, method, mockStrategy, mockAlwaysDefaults, defaultTimeEstimator) |
70 |
| - .collect { |
71 |
| - when (it) { |
72 |
| - is UtExecution -> { |
73 |
| - if (it is UtSymbolicExecution && |
74 |
| - (conflictTriggers.triggered(Conflict.ForceMockHappened) || |
75 |
| - conflictTriggers.triggered(Conflict.ForceStaticMockHappened)) |
76 |
| - ) { |
77 |
| - it.containsMocking = true |
| 63 | + runBlocking { |
| 64 | + val controller = EngineController() |
| 65 | + controller.job = launch { |
| 66 | + super |
| 67 | + .generateAsync(controller, method, mockStrategy, mockAlwaysDefaults, defaultTimeEstimator) |
| 68 | + .collect { |
| 69 | + when (it) { |
| 70 | + is UtExecution -> { |
| 71 | + if (it is UtSymbolicExecution && |
| 72 | + (conflictTriggers.triggered(Conflict.ForceMockHappened) || |
| 73 | + conflictTriggers.triggered(Conflict.ForceStaticMockHappened)) |
| 74 | + ) { |
| 75 | + it.containsMocking = true |
78 | 76 |
|
79 |
| - conflictTriggers.reset( |
80 |
| - Conflict.ForceMockHappened, |
81 |
| - Conflict.ForceStaticMockHappened |
82 |
| - ) |
83 |
| - } |
84 |
| - executions += it |
| 77 | + conflictTriggers.reset( |
| 78 | + Conflict.ForceMockHappened, |
| 79 | + Conflict.ForceStaticMockHappened |
| 80 | + ) |
85 | 81 | }
|
86 |
| - is UtError -> errors.merge(it.description, 1, Int::plus) |
| 82 | + executions += it |
87 | 83 | }
|
| 84 | + is UtError -> errors.merge(it.description, 1, Int::plus) |
88 | 85 | }
|
89 |
| - } |
| 86 | + } |
90 | 87 | }
|
91 | 88 | }
|
92 | 89 |
|
|
0 commit comments