Skip to content
This repository has been archived by the owner on Nov 19, 2024. It is now read-only.

Commit

Permalink
Override assignBuildNumber rather than saveNextBuildNumber
Browse files Browse the repository at this point in the history
  • Loading branch information
jglick committed Oct 9, 2024
1 parent 1a9c05f commit e8c0af2
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 @@ -57,9 +57,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 @@ -56,9 +56,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 e8c0af2

Please sign in to comment.