Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
gnodet committed Jun 28, 2023
1 parent 58659ee commit 9f4c8ae
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import java.io.File;
import java.util.List;

import org.apache.maven.artifact.versioning.DefaultArtifactVersion;
import org.apache.maven.shared.verifier.Verifier;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.junit.jupiter.api.Test;
Expand Down Expand Up @@ -59,8 +60,13 @@ public void testit() throws Exception {
List<String> lines = verifier.loadLines(verifier.getLogFileName(), null);
for (String line : lines) {
if (line.contains(":bad/id:")) {
assertTrue("Line number not found in: " + line, line.indexOf("34") > 0);
assertTrue("Column number not found in: " + line, line.indexOf("7") > 0);
String location;
if (getMavenVersion().compareTo(new DefaultArtifactVersion("4.0.0-alpha-8-SNAPSHOT")) >= 0) {
location = "line 34, column 7";
} else {
location = "line 34, column 19";
}
assertTrue("Position not found in: " + line, line.indexOf(location) > 0);
foundError = true;
break;
}
Expand Down

0 comments on commit 9f4c8ae

Please sign in to comment.