Skip to content

Commit cf596fa

Browse files
committed
renames, small refactorings
1 parent c75242c commit cf596fa

File tree

5 files changed

+6
-14
lines changed

5 files changed

+6
-14
lines changed

clion-plugin/src/main/kotlin/org/utbot/cpp/clion/plugin/client/handlers/CoverageAndResultsHandler.kt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,6 @@ class CoverageAndResultsHandler(
102102
}
103103

104104
private fun notifyCoverageReceived() {
105-
val actions = mutableListOf<AnAction>()
106-
sourceFilePath?.let { actions.add(FocusAction(it)) }
107105
notifyInfo(
108106
UTBot.message("notify.coverage.received.title"),
109107
UTBot.message("notify.coverage.received"),

clion-plugin/src/main/kotlin/org/utbot/cpp/clion/plugin/client/handlers/StreamHandlerWithProgress.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ abstract class StreamHandlerWithProgress<T>(
5050

5151
override fun onCompletion(exception: Throwable?) {
5252
invokeOnEdt {
53-
indicator.stop()
53+
indicator.stopShowingProgressInUI()
5454
}
5555
if (exception != null) {
5656
throw exception

clion-plugin/src/main/kotlin/org/utbot/cpp/clion/plugin/client/handlers/TestsStreamHandler.kt

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ class TestsStreamHandler(
2828
progressName: String,
2929
cancellationJob: Job,
3030
private val onSuccess: (List<Path>) -> Unit = {},
31-
private val onError: (Throwable) -> Unit = {}
3231
) : StreamHandlerWithProgress<Testgen.TestsResponse>(project, grpcStream, progressName, cancellationJob) {
3332

3433
private val myGeneratedTestFilesLocalFS: MutableList<Path> = mutableListOf()
@@ -62,11 +61,10 @@ class TestsStreamHandler(
6261

6362
override fun onCompletion(exception: Throwable?) {
6463
invokeOnEdt {
65-
indicator.stop()
64+
indicator.stopShowingProgressInUI()
6665
}
67-
if (exception != null ) {
68-
if (exception !is CancellationException)
69-
onError(exception)
66+
if (exception != null && exception !is CancellationException) {
67+
throw exception
7068
} else {
7169
onSuccess(myGeneratedTestFilesLocalFS)
7270
}

clion-plugin/src/main/kotlin/org/utbot/cpp/clion/plugin/client/requests/test/BaseTestsRequest.kt

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ abstract class BaseTestsRequest<R>(params: GrpcRequestBuilder<R>, project: Proje
3131
progressName,
3232
cancellationJob,
3333
::notifySuccess,
34-
::notifyError
3534
).handle()
3635
}
3736
}
@@ -52,6 +51,4 @@ abstract class BaseTestsRequest<R>(params: GrpcRequestBuilder<R>, project: Proje
5251
FocusAction(it)
5352
})
5453
}
55-
56-
open fun notifyError(cause: Throwable) {}
57-
}
54+
}

clion-plugin/src/main/kotlin/org/utbot/cpp/clion/plugin/ui/UTBotRequestProgressIndicator.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,7 @@ class UTBotRequestProgressIndicator(
3131
super.start()
3232
}
3333

34-
override fun stop() {
35-
requestJob?.cancel()
34+
fun stopShowingProgressInUI() {
3635
finish()
3736
super.stop()
3837
}

0 commit comments

Comments
 (0)