use of hudson.plugins.violations.model.FullBuildModel in project violations-plugin by jenkinsci.
the class ViolationsParserTest method getFullBuildModel.
protected FullBuildModel getFullBuildModel(ViolationsParser parser, String filename) throws IOException {
URL url = getClass().getResource(filename);
File xmlFile;
try {
xmlFile = new File(url.toURI());
} catch (URISyntaxException e) {
xmlFile = new File(url.getPath());
}
FullBuildModel model = new FullBuildModel();
parser.parse(model, xmlFile.getParentFile(), xmlFile.getName(), null);
model.cleanup();
return model;
}
use of hudson.plugins.violations.model.FullBuildModel in project violations-plugin by jenkinsci.
the class CodenarcParserTest method testParser2.
@Test
public void testParser2() throws Exception {
FullBuildModel model = getFullBuildModel("CodeNarcReport2.xml");
assertEquals("Number of violations is incorrect", 11, model.getCountNumber("codenarc"));
assertEquals("Number of files is incorrect", 1, model.getFileModelMap().size());
}
use of hudson.plugins.violations.model.FullBuildModel in project violations-plugin by jenkinsci.
the class CodenarcParserTest method testParseFullBuildModelFromFile.
@Test
public void testParseFullBuildModelFromFile() throws Exception {
FullBuildModel model = getFullBuildModel("CodeNarcXmlReport.xml");
FullFileModel fileModel = model.getFileModel("grails-app/controllers/LoginController.groovy");
assertEquals("Number of violations is incorrect", 10, model.getCountNumber("codenarc"));
assertEquals("Number of files is incorrect", 7, model.getFileModelMap().size());
assertNotNull("LoginController model is null", fileModel.getSourceFile());
}
use of hudson.plugins.violations.model.FullBuildModel in project violations-plugin by jenkinsci.
the class FxCopParserTest method testParseFullBuildModelFileStringStringArray.
@Test
public void testParseFullBuildModelFileStringStringArray() throws Exception {
FullBuildModel model = getFullBuildModel("fxcop.xml");
assertEquals("Number of violations is incorrect", 2, model.getCountNumber("fxcop"));
assertEquals("Number of files is incorrect", 2, model.getFileModelMap().size());
}
use of hudson.plugins.violations.model.FullBuildModel in project violations-plugin by jenkinsci.
the class GendarmeParserTest method assertThatCriticalIssuesAreMarkedAsHigh.
@Issue("JENKINS-11227")
@Test
public void assertThatCriticalIssuesAreMarkedAsHigh() throws IOException {
FullBuildModel model = getFullBuildModel("gendarme-2" + (File.separatorChar == '/' ? "_unix" : "") + ".xml");
SortedSet<Violation> set = model.getFileModel(getOsDependentFilename("workspaceLeave\\Leave.Gui\\Views\\LeaveGanttView\\Column\\LeaveFooter.cs")).getTypeMap().get(GendarmeParser.TYPE_NAME);
assertEquals("The severity is incorrect", Severity.HIGH, set.first().getSeverity());
}
Aggregations