Skip to content

Commit

Permalink
Override assignBuildNumber rather than saveNextBuildNumber
Browse files Browse the repository at this point in the history
  • Loading branch information
jglick authored and centic9 committed Oct 9, 2024
1 parent 81a93e7 commit a5b8d3a
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,10 @@ public MyRun getLastSuccessfulBuild() {
}
}

@Override
protected synchronized void saveNextBuildNumber() {
}
@Override
public int assignBuildNumber() throws IOException {
return nextBuildNumber++;
}
};
assertTrue(abstractJaCoCoCoverageColumn.hasCoverage(mockJob));
assertEquals("66.67", abstractJaCoCoCoverageColumn.getPercent(mockJob));
Expand Down Expand Up @@ -218,8 +219,9 @@ public MyRun getLastSuccessfulBuild() {
}

@Override
protected synchronized void saveNextBuildNumber() {
}
public int assignBuildNumber() throws IOException {
return nextBuildNumber++;
}
}

private class MyJob extends Job<MyJob,MyRun> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,10 @@ public MyRun getLastSuccessfulBuild() {
}
}

@Override
protected synchronized void saveNextBuildNumber() {
}
@Override
public int assignBuildNumber() throws IOException {
return nextBuildNumber++;
}
};
assertEquals("66.67", sut.getPercent(mockJob));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,10 @@ public MyRun getLastSuccessfulBuild() {
}
}

@Override
protected synchronized void saveNextBuildNumber() {
}
@Override
public int assignBuildNumber() throws IOException {
return nextBuildNumber++;
}
};
assertTrue(jaCoCoColumn.hasCoverage(mockJob));
assertEquals("33.33", jaCoCoColumn.getPercent(mockJob));
Expand Down

0 comments on commit a5b8d3a

Please sign in to comment.