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 1
1
package org .utbot .api .exception ;
2
2
3
3
public class UtMockAssumptionViolatedException extends RuntimeException {
4
+
5
+ public static final String errorMessage = "UtMock assumption violated" ;
6
+
4
7
@ Override
5
8
public String getMessage () {
6
- return "UtMock assumption violated" ;
9
+ return errorMessage ;
7
10
}
8
11
}
Original file line number Diff line number Diff line change @@ -368,7 +368,11 @@ class UtBotSymbolicEngine(
368
368
// in case an exception occurred from the concrete execution
369
369
concreteExecutionResult ? : return @runJavaFuzzing BaseFeedback (result = Trie .emptyNode(), control = Control .PASS )
370
370
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) {
372
376
logger.debug { " Generated test case by fuzzer violates the UtMock assumption" }
373
377
return @runJavaFuzzing BaseFeedback (result = Trie .emptyNode(), control = Control .PASS )
374
378
}
You can’t perform that action at this time.
0 commit comments