File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed
utbot-api/src/main/java/org/utbot/api/exception
utbot-framework/src/main/kotlin/org/utbot/engine Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change 11package org .utbot .api .exception ;
22
33public class UtMockAssumptionViolatedException extends RuntimeException {
4+
5+ public static final String errorMessage = "UtMock assumption violated" ;
6+
47 @ Override
58 public String getMessage () {
6- return "UtMock assumption violated" ;
9+ return errorMessage ;
710 }
811}
Original file line number Diff line number Diff line change @@ -368,7 +368,11 @@ class UtBotSymbolicEngine(
368368 // in case an exception occurred from the concrete execution
369369 concreteExecutionResult ? : return @runJavaFuzzing BaseFeedback (result = Trie .emptyNode(), control = Control .PASS )
370370
371- if (concreteExecutionResult.result.exceptionOrNull() is UtMockAssumptionViolatedException ) {
371+ // We should compare messages instead of `if (... is UtMockAssumptionViolatedException)`
372+ // because the exception from the `concreteExecutionResult` is loaded by user's ClassLoader,
373+ // but the `UtMockAssumptionViolatedException` is loaded by the current ClassLoader,
374+ // so we can't cast them to each other.
375+ if (concreteExecutionResult.result.exceptionOrNull()?.message == UtMockAssumptionViolatedException .errorMessage) {
372376 logger.debug { " Generated test case by fuzzer violates the UtMock assumption" }
373377 return @runJavaFuzzing BaseFeedback (result = Trie .emptyNode(), control = Control .PASS )
374378 }
You can’t perform that action at this time.
0 commit comments