@@ -122,8 +122,8 @@ public static void verifyJVMStartup(String expectedMessages[],
122
122
outputAnalyzer .shouldHaveExitValue (exitCode .value );
123
123
} catch (RuntimeException e ) {
124
124
String errorMessage = String .format (
125
- "JVM process should have exit value '%d'.%n%s" ,
126
- exitCode .value , exitErrorMessage );
125
+ "JVM process should have exit value '%d', but has '%d' .%n%s" ,
126
+ exitCode .value , outputAnalyzer . getExitValue (), exitErrorMessage );
127
127
throw new AssertionError (errorMessage , e );
128
128
}
129
129
@@ -302,9 +302,12 @@ public static void verifyOptionValue(String optionName,
302
302
CommandLineOptionTest .PRINT_FLAGS_FINAL_FORMAT ,
303
303
optionName , expectedValue ));
304
304
} catch (RuntimeException e ) {
305
+ String observedValue = outputAnalyzer .firstMatch (String .format (
306
+ CommandLineOptionTest .PRINT_FLAGS_FINAL_FORMAT ,
307
+ optionName , "\\ S" ));
305
308
String errorMessage = String .format (
306
- "Option '%s' is expected to have '%s' value%n%s" ,
307
- optionName , expectedValue ,
309
+ "Option '%s' is expected to have '%s' value, but is '%s'. %n%s" ,
310
+ optionName , expectedValue , observedValue ,
308
311
optionErrorString );
309
312
throw new AssertionError (errorMessage , e );
310
313
}
0 commit comments