use of org.jenkinsci.test.acceptance.plugins.checkstyle.CheckStyleAction in project acceptance-test-harness by jenkinsci.
the class CheckStylePluginTest method should_group_warnings_by_module.
/**
* Builds a multi-module maven project and checks that warnings are grouped by module.
*/
// TODO: Check module details
@Test
public void should_group_warnings_by_module() {
MavenModuleSet job = createMavenJob(CHECKSTYLE_PLUGIN_ROOT + "maven_multi_module", "clean package checkstyle:checkstyle", CheckStyleMavenSettings.class, new NullConfigurator<>());
Node slave = createSlaveForJob(job);
Build build = buildSuccessfulJobOnSlave(job, slave);
assertThatCheckStyleResultExists(job, build);
build.open();
CheckStyleAction checkstyle = new CheckStyleAction(build);
checkstyle.open();
assertThat(checkstyle.getNumberOfNewWarnings(), is(24));
assertThatModulesTabIsCorrectlyFilled(checkstyle);
}
use of org.jenkinsci.test.acceptance.plugins.checkstyle.CheckStyleAction in project acceptance-test-harness by jenkinsci.
the class CheckStylePluginTest method runBuild.
private void runBuild(final FreeStyleJob job, final int buildNumber, final Result expectedResult, final int expectedNewWarnings, final int expectedFixedWarnings, final boolean usePreviousAsReference) {
String fileName = "checkstyle-result-build" + buildNumber + ".xml";
editJob(CHECKSTYLE_PLUGIN_ROOT + fileName, false, job, CheckStyleFreestyleSettings.class, settings -> {
settings.setNewWarningsThresholdUnstable("0", usePreviousAsReference);
settings.pattern.set(fileName);
});
Build build = buildJobAndWait(job).shouldBe(expectedResult);
if (expectedNewWarnings > 0) {
assertThatCheckStyleResultExists(job, build);
build.open();
CheckStyleAction checkstyle = new CheckStyleAction(build);
checkstyle.open();
assertThat(checkstyle.getNumberOfNewWarnings(), is(expectedNewWarnings));
assertThat(checkstyle.getNumberOfFixedWarnings(), is(expectedFixedWarnings));
}
}
Aggregations