use of hudson.plugins.violations.model.FullBuildModel in project violations-plugin by jenkinsci.
the class GendarmeParserTest method assertThatSourceFileForTypeDefectsIsAddedFileModel.
@Issue("JENKINS-11227")
@Test
public void assertThatSourceFileForTypeDefectsIsAddedFileModel() throws IOException {
FullBuildModel model = getFullBuildModel("gendarme-2" + (File.separatorChar == '/' ? "_unix" : "") + ".xml");
assertEquals("Number of files is incorrect", 7, model.getFileModelMap().size());
}
use of hudson.plugins.violations.model.FullBuildModel in project violations-plugin by jenkinsci.
the class JcReportParserTest method testParseFullBuildModelFileStringStringArray.
@Test
public void testParseFullBuildModelFileStringStringArray() throws Exception {
FullBuildModel model = getFullBuildModel("jcoderz-report.xml");
assertEquals("Number of violations is incorrect", 42, model.getCountNumber("jcreport"));
assertEquals("Number of files is incorrect", 3, model.getFileModelMap().size());
}
use of hudson.plugins.violations.model.FullBuildModel in project violations-plugin by jenkinsci.
the class JsLintParserTest method testParseWithMultipleFile.
@Test
public void testParseWithMultipleFile() throws Exception {
FullBuildModel model = getFullBuildModel("multi.xml");
assertEquals(102, model.getCountNumber(JsLintParser.TYPE_NAME));
assertEquals(2, model.getFileModelMap().size());
assertScriptaculous(model);
assertPrototype(model);
}
use of hudson.plugins.violations.model.FullBuildModel in project violations-plugin by jenkinsci.
the class StyleCopParserTest method testViolationCompareTo.
/**
* Test to catch a NPE in Violation.compareTo() because violation has to little data
*/
@Test
public void testViolationCompareTo() throws Exception {
FullBuildModel model = getFullBuildModel("onefile.xml");
Iterator<Violation> iterator = model.getFileModel("MainClass.cs").getTypeMap().get(StyleCopParser.TYPE_NAME).descendingIterator();
Violation v = iterator.next();
Violation otherV = iterator.next();
assertTrue("compareTo() should return false", v.compareTo(otherV) != 0);
}
use of hudson.plugins.violations.model.FullBuildModel in project violations-plugin by jenkinsci.
the class CodenarcParserTest method testParseFullBuildModelFromFileWithSourceDirectory.
@Test
public void testParseFullBuildModelFromFileWithSourceDirectory() throws Exception {
FullBuildModel model = getFullBuildModel("CodeNarcXmlReportWithSourceDirectory.xml");
FullFileModel fileModel = model.getFileModel("webapps/testapp/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());
}
Aggregations