Skip to content

Commit

Permalink
Fix test on Windows: now we get there an IO error as well.
Browse files Browse the repository at this point in the history
  • Loading branch information
uhafner committed Dec 22, 2023
1 parent 8c261be commit 7e585b2
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ void shouldGetIoErrorBySearchingForAffectedFiles() {

String consoleLog = getConsoleLog(result);
assertThat(consoleLog).contains("0 copied");
if (isWindows()) { // In Windows a file does not exist if it is unreadable
if (isWindows() && Runtime.version().feature() < 21) { // In Windows a file does not exist if it is unreadable
assertThat(consoleLog).contains("4 not-found", "0 with I/O error");
}
else {
Expand Down Expand Up @@ -267,7 +267,7 @@ private void buildAndVerifyFilesResolving(final FreeStyleProject job, final Colu
}

private IssuesRow getIssuesModel(final AnalysisResult result, final int rowNumber) {
IssuesDetail issuesDetail = (IssuesDetail) result.getOwner().getAction(ResultAction.class).getTarget();
IssuesDetail issuesDetail = result.getOwner().getAction(ResultAction.class).getTarget();
return (IssuesRow) issuesDetail.getTableModel("issues").getRows().get(rowNumber);
}

Check warning on line 272 in plugin/src/test/java/io/jenkins/plugins/analysis/warnings/steps/AffectedFilesResolverITest.java

View check run for this annotation

ci.jenkins.io / CPD

CPD

LOW: Found duplicated code.
Raw output
<pre><code>} private IssuesRow getIssuesModel(final AnalysisResult result, final int rowNumber) { IssuesDetail issuesDetail &#61; result.getOwner().getAction(ResultAction.class).getTarget(); return (IssuesRow) issuesDetail.getTableModel(&#34;issues&#34;).getRows().get(rowNumber); }</code></pre>

Expand Down

0 comments on commit 7e585b2

Please sign in to comment.