Skip to content
This repository has been archived by the owner on Feb 11, 2022. It is now read-only.

Commit

Permalink
Illustrate usage of effort and reportLevel for findbugs
Browse files Browse the repository at this point in the history
  • Loading branch information
Eduard Bolos committed Nov 10, 2016
1 parent 11dece4 commit 0082a16
Showing 1 changed file with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,22 @@ class FindbugsIntegrationTest {
result.buildFile('reports/findbugs/debug.html'))
}

@Test
public void shouldDetectMoreWarningsWhenEffortIsMaxAndReportLevelIsLow() {
TestProject.Result result = projectRule.newProject()
.withSourceSet('debug', SOURCES_WITH_LOW_VIOLATION, SOURCES_WITH_MEDIUM_VIOLATION)
.withPenalty('''{
maxErrors = 0
maxWarnings = 1
}''')
.withFindbugs('findbugs { effort = \'max\' \n reportLevel = \'low\'}')
.buildAndFail('check')

assertThat(result.logs).containsLimitExceeded(0, 2)
assertThat(result.logs).containsFindbugsViolations(0, 3,
result.buildFile('reports/findbugs/debug.html'))
}

@Test
public void shouldFailBuildWhenFindbugsErrorsOverTheThreshold() {
TestProject.Result result = projectRule.newProject()
Expand Down

0 comments on commit 0082a16

Please sign in to comment.