use of org.jenkinsci.test.acceptance.plugins.findbugs.FindBugsAction in project acceptance-test-harness by jenkinsci.
the class FindBugsPluginTest method should_retrieve_results_from_maven_job.
/**
* Builds a maven project and checks if a new warning is displayed.
*/
@Test
public void should_retrieve_results_from_maven_job() {
MavenModuleSet job = createMavenJob();
Build build = buildSuccessfulJob(job);
assertThatFindBugsResultExists(job, build);
build.open();
FindBugsAction action = new FindBugsAction(build);
action.open();
assertThat(action.getNumberOfNewWarnings(), is(1));
}
use of org.jenkinsci.test.acceptance.plugins.findbugs.FindBugsAction in project acceptance-test-harness by jenkinsci.
the class FindBugsPluginTest method should_link_to_source_code_in_real_project.
/**
* Builds a freestyle project and checks if new warning are displayed.
*/
@Test
public void should_link_to_source_code_in_real_project() {
FreeStyleJob job = createJob(jenkins, "/findbugs_plugin/sample_findbugs_project", FreeStyleJob.class, FindBugsFreestyleSettings.class, settings -> settings.pattern.set("target/findbugsXml.xml"));
setMavenGoal(job, "clean package findbugs:findbugs");
Build build = buildSuccessfulJob(job);
assertThatFindBugsResultExists(job, build);
build.open();
FindBugsAction action = new FindBugsAction(build);
action.open();
assertThat(action.getNumberOfNewWarnings(), is(1));
verifySourceLine(action, "Main.java", 18, "18 if(o == null) {", "Redundant nullcheck of o, which is known to be non-null in Main.main(String[])");
}
use of org.jenkinsci.test.acceptance.plugins.findbugs.FindBugsAction in project acceptance-test-harness by jenkinsci.
the class FindBugsPluginTest method verifyWarningCounts.
private void verifyWarningCounts(final Build build) {
FindBugsAction action = new FindBugsAction(build);
assertThatWarningsCountInSummaryIs(action, 5);
assertThatNewWarningsCountInSummaryIs(action, 1);
assertThatFixedWarningsCountInSummaryIs(action, 2);
action.open();
assertThat(action.getNumberOfWarnings(), is(5));
assertThat(action.getNumberOfNewWarnings(), is(1));
assertThat(action.getNumberOfFixedWarnings(), is(2));
assertThat(action.getNumberOfWarningsWithHighPriority(), is(3));
assertThat(action.getNumberOfWarningsWithNormalPriority(), is(2));
assertThat(action.getNumberOfWarningsWithLowPriority(), is(0));
action.openNew();
assertThat(action.getNumberOfWarningsWithHighPriority(), is(1));
assertThat(action.getNumberOfWarningsWithNormalPriority(), is(0));
assertThat(action.getNumberOfWarningsWithLowPriority(), is(0));
action.openFixed();
assertThat(action.getNumberOfRowsInFixedWarningsTable(), is(2));
}
Aggregations