Skip to content

Commit

Permalink
Use same expected files for all JDK versions
Browse files Browse the repository at this point in the history
  • Loading branch information
marcphilipp committed Sep 10, 2023
1 parent 977c85f commit e802db4
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 43 deletions.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.ArrayList;
import java.util.List;

import de.sormuras.bartholdy.Result;
import de.sormuras.bartholdy.jdk.Jar;
Expand Down Expand Up @@ -390,8 +391,8 @@ void executeOnJava8() throws IOException {
assertEquals(1, result.getExitCode(), () -> getExitCodeMessage(result));

var workspace = Request.WORKSPACE.resolve("standalone");
var expectedOutLines = Files.readAllLines(workspace.resolve("expected-out-java8.txt"));
var expectedErrLines = Files.readAllLines(workspace.resolve("expected-err-java8.txt"));
var expectedOutLines = Files.readAllLines(workspace.resolve("expected-out.txt"));
var expectedErrLines = getExpectedErrLinesOnJava8(workspace);
assertLinesMatch(expectedOutLines, result.getOutputLines("out"));
assertLinesMatch(expectedErrLines, result.getOutputLines("err"));

Expand Down Expand Up @@ -427,8 +428,8 @@ void executeOnJava8SelectPackage() throws IOException {
assertEquals(1, result.getExitCode(), () -> getExitCodeMessage(result));

var workspace = Request.WORKSPACE.resolve("standalone");
var expectedOutLines = Files.readAllLines(workspace.resolve("expected-out-java8.txt"));
var expectedErrLines = Files.readAllLines(workspace.resolve("expected-err-java8.txt"));
var expectedOutLines = Files.readAllLines(workspace.resolve("expected-out.txt"));
var expectedErrLines = getExpectedErrLinesOnJava8(workspace);
assertLinesMatch(expectedOutLines, result.getOutputLines("out"));
assertLinesMatch(expectedErrLines, result.getOutputLines("err"));

Expand All @@ -440,6 +441,13 @@ void executeOnJava8SelectPackage() throws IOException {
+ " (group ID: org.junit.vintage, artifact ID: junit-vintage-engine, version: " + vintageVersion));
}

private static List<String> getExpectedErrLinesOnJava8(Path workspace) throws IOException {
var expectedErrLines = new ArrayList<String>();
expectedErrLines.add(">> JAVA VERSION >>");
expectedErrLines.addAll(Files.readAllLines(workspace.resolve("expected-err.txt")));
return expectedErrLines;
}

@Test
@Order(6)
@Disabled("https://github.com/junit-team/junit5/issues/1724")
Expand Down

0 comments on commit e802db4

Please sign in to comment.