21
21
import java .nio .file .Files ;
22
22
import java .nio .file .Path ;
23
23
import java .util .ArrayList ;
24
+ import java .util .List ;
24
25
25
26
import de .sormuras .bartholdy .Result ;
26
27
import de .sormuras .bartholdy .jdk .Jar ;
@@ -390,8 +391,8 @@ void executeOnJava8() throws IOException {
390
391
assertEquals (1 , result .getExitCode (), () -> getExitCodeMessage (result ));
391
392
392
393
var workspace = Request .WORKSPACE .resolve ("standalone" );
393
- var expectedOutLines = Files .readAllLines (workspace .resolve ("expected-out-java8 .txt" ));
394
- var expectedErrLines = Files . readAllLines (workspace . resolve ( "expected-err-java8.txt" ) );
394
+ var expectedOutLines = Files .readAllLines (workspace .resolve ("expected-out.txt" ));
395
+ var expectedErrLines = getExpectedErrLinesOnJava8 (workspace );
395
396
assertLinesMatch (expectedOutLines , result .getOutputLines ("out" ));
396
397
assertLinesMatch (expectedErrLines , result .getOutputLines ("err" ));
397
398
@@ -427,8 +428,8 @@ void executeOnJava8SelectPackage() throws IOException {
427
428
assertEquals (1 , result .getExitCode (), () -> getExitCodeMessage (result ));
428
429
429
430
var workspace = Request .WORKSPACE .resolve ("standalone" );
430
- var expectedOutLines = Files .readAllLines (workspace .resolve ("expected-out-java8 .txt" ));
431
- var expectedErrLines = Files . readAllLines (workspace . resolve ( "expected-err-java8.txt" ) );
431
+ var expectedOutLines = Files .readAllLines (workspace .resolve ("expected-out.txt" ));
432
+ var expectedErrLines = getExpectedErrLinesOnJava8 (workspace );
432
433
assertLinesMatch (expectedOutLines , result .getOutputLines ("out" ));
433
434
assertLinesMatch (expectedErrLines , result .getOutputLines ("err" ));
434
435
@@ -440,6 +441,13 @@ void executeOnJava8SelectPackage() throws IOException {
440
441
+ " (group ID: org.junit.vintage, artifact ID: junit-vintage-engine, version: " + vintageVersion ));
441
442
}
442
443
444
+ private static List <String > getExpectedErrLinesOnJava8 (Path workspace ) throws IOException {
445
+ var expectedErrLines = new ArrayList <String >();
446
+ expectedErrLines .add (">> JAVA VERSION >>" );
447
+ expectedErrLines .addAll (Files .readAllLines (workspace .resolve ("expected-err.txt" )));
448
+ return expectedErrLines ;
449
+ }
450
+
443
451
@ Test
444
452
@ Order (6 )
445
453
@ Disabled ("https://github.com/junit-team/junit5/issues/1724" )
0 commit comments