1
1
/*
2
- * Copyright (c) 2013, 2021 , Oracle and/or its affiliates. All rights reserved.
2
+ * Copyright (c) 2013, 2022 , Oracle and/or its affiliates. All rights reserved.
3
3
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4
4
*
5
5
* This code is free software; you can redistribute it and/or modify it
@@ -218,7 +218,7 @@ public OutputAnalyzer shouldContain(String expectedString) {
218
218
String stderr = getStderr ();
219
219
if (!stdout .contains (expectedString ) && !stderr .contains (expectedString )) {
220
220
reportDiagnosticSummary ();
221
- throw new RuntimeException ("'" + expectedString + "' missing from stdout/stderr \n " );
221
+ throw new RuntimeException ("'" + expectedString + "' missing from stdout/stderr" );
222
222
}
223
223
return this ;
224
224
}
@@ -233,7 +233,7 @@ public OutputAnalyzer stdoutShouldContain(String expectedString) {
233
233
String stdout = getStdout ();
234
234
if (!stdout .contains (expectedString )) {
235
235
reportDiagnosticSummary ();
236
- throw new RuntimeException ("'" + expectedString + "' missing from stdout \n " );
236
+ throw new RuntimeException ("'" + expectedString + "' missing from stdout" );
237
237
}
238
238
return this ;
239
239
}
@@ -248,7 +248,7 @@ public OutputAnalyzer stderrShouldContain(String expectedString) {
248
248
String stderr = getStderr ();
249
249
if (!stderr .contains (expectedString )) {
250
250
reportDiagnosticSummary ();
251
- throw new RuntimeException ("'" + expectedString + "' missing from stderr \n " );
251
+ throw new RuntimeException ("'" + expectedString + "' missing from stderr" );
252
252
}
253
253
return this ;
254
254
}
@@ -264,11 +264,11 @@ public OutputAnalyzer shouldNotContain(String notExpectedString) {
264
264
String stderr = getStderr ();
265
265
if (stdout .contains (notExpectedString )) {
266
266
reportDiagnosticSummary ();
267
- throw new RuntimeException ("'" + notExpectedString + "' found in stdout \n " );
267
+ throw new RuntimeException ("'" + notExpectedString + "' found in stdout" );
268
268
}
269
269
if (stderr .contains (notExpectedString )) {
270
270
reportDiagnosticSummary ();
271
- throw new RuntimeException ("'" + notExpectedString + "' found in stderr \n " );
271
+ throw new RuntimeException ("'" + notExpectedString + "' found in stderr" );
272
272
}
273
273
return this ;
274
274
}
@@ -302,7 +302,7 @@ public OutputAnalyzer stdoutShouldNotContain(String notExpectedString) {
302
302
String stdout = getStdout ();
303
303
if (stdout .contains (notExpectedString )) {
304
304
reportDiagnosticSummary ();
305
- throw new RuntimeException ("'" + notExpectedString + "' found in stdout \n " );
305
+ throw new RuntimeException ("'" + notExpectedString + "' found in stdout" );
306
306
}
307
307
return this ;
308
308
}
@@ -317,7 +317,7 @@ public OutputAnalyzer stderrShouldNotContain(String notExpectedString) {
317
317
String stderr = getStderr ();
318
318
if (stderr .contains (notExpectedString )) {
319
319
reportDiagnosticSummary ();
320
- throw new RuntimeException ("'" + notExpectedString + "' found in stderr \n " );
320
+ throw new RuntimeException ("'" + notExpectedString + "' found in stderr" );
321
321
}
322
322
return this ;
323
323
}
@@ -338,7 +338,7 @@ public OutputAnalyzer shouldMatch(String regexp) {
338
338
if (!stdoutMatcher .find () && !stderrMatcher .find ()) {
339
339
reportDiagnosticSummary ();
340
340
throw new RuntimeException ("'" + regexp
341
- + "' missing from stdout/stderr \n " );
341
+ + "' missing from stdout/stderr" );
342
342
}
343
343
return this ;
344
344
}
@@ -356,7 +356,7 @@ public OutputAnalyzer stdoutShouldMatch(String regexp) {
356
356
if (!matcher .find ()) {
357
357
reportDiagnosticSummary ();
358
358
throw new RuntimeException ("'" + regexp
359
- + "' missing from stdout \n " );
359
+ + "' missing from stdout" );
360
360
}
361
361
return this ;
362
362
}
@@ -374,7 +374,7 @@ public OutputAnalyzer stderrShouldMatch(String pattern) {
374
374
if (!matcher .find ()) {
375
375
reportDiagnosticSummary ();
376
376
throw new RuntimeException ("'" + pattern
377
- + "' missing from stderr \n " );
377
+ + "' missing from stderr" );
378
378
}
379
379
return this ;
380
380
}
@@ -393,15 +393,15 @@ public OutputAnalyzer shouldNotMatch(String regexp) {
393
393
if (matcher .find ()) {
394
394
reportDiagnosticSummary ();
395
395
throw new RuntimeException ("'" + regexp
396
- + "' found in stdout: '" + matcher .group () + "' \n " );
396
+ + "' found in stdout: '" + matcher .group () + "'" );
397
397
}
398
398
399
399
String stderr = getStderr ();
400
400
matcher = pattern .matcher (stderr );
401
401
if (matcher .find ()) {
402
402
reportDiagnosticSummary ();
403
403
throw new RuntimeException ("'" + regexp
404
- + "' found in stderr: '" + matcher .group () + "' \n " );
404
+ + "' found in stderr: '" + matcher .group () + "'" );
405
405
}
406
406
407
407
return this ;
@@ -420,7 +420,7 @@ public OutputAnalyzer stdoutShouldNotMatch(String regexp) {
420
420
if (matcher .find ()) {
421
421
reportDiagnosticSummary ();
422
422
throw new RuntimeException ("'" + regexp
423
- + "' found in stdout \n " );
423
+ + "' found in stdout" );
424
424
}
425
425
return this ;
426
426
}
@@ -438,7 +438,7 @@ public OutputAnalyzer stderrShouldNotMatch(String regexp) {
438
438
if (matcher .find ()) {
439
439
reportDiagnosticSummary ();
440
440
throw new RuntimeException ("'" + regexp
441
- + "' found in stderr \n " );
441
+ + "' found in stderr" );
442
442
}
443
443
return this ;
444
444
}
@@ -487,7 +487,7 @@ public OutputAnalyzer shouldHaveExitValue(int expectedExitValue) {
487
487
if (getExitValue () != expectedExitValue ) {
488
488
reportDiagnosticSummary ();
489
489
throw new RuntimeException ("Expected to get exit value of ["
490
- + expectedExitValue + "]\n " );
490
+ + expectedExitValue + "], exit value is: [" + getExitValue () + "] " );
491
491
}
492
492
return this ;
493
493
}
@@ -502,7 +502,7 @@ public OutputAnalyzer shouldNotHaveExitValue(int notExpectedExitValue) {
502
502
if (getExitValue () == notExpectedExitValue ) {
503
503
reportDiagnosticSummary ();
504
504
throw new RuntimeException ("Unexpected to get exit value of ["
505
- + notExpectedExitValue + "]\n " );
505
+ + notExpectedExitValue + "]" );
506
506
}
507
507
return this ;
508
508
}
@@ -637,7 +637,7 @@ public OutputAnalyzer stderrShouldMatchIgnoreVMWarnings(String pattern) {
637
637
if (!matcher .find ()) {
638
638
reportDiagnosticSummary ();
639
639
throw new RuntimeException ("'" + pattern
640
- + "' missing from stderr \n " );
640
+ + "' missing from stderr" );
641
641
}
642
642
return this ;
643
643
}
0 commit comments