Search in sources :

Example 16 with FullBuildModel

use of hudson.plugins.violations.model.FullBuildModel in project violations-plugin by jenkinsci.

the class GendarmeParserTest method assertThatMultipleDefectsInATargetIsCollected.

@Issue("JENKINS-11227")
@Test
public void assertThatMultipleDefectsInATargetIsCollected() throws IOException {
    FullBuildModel model = getFullBuildModel("gendarme-2" + (File.separatorChar == '/' ? "_unix" : "") + ".xml");
    assertEquals("Number of violations is incorrect", 12, model.getCountNumber(GendarmeParser.TYPE_NAME));
}
Also used : FullBuildModel(hudson.plugins.violations.model.FullBuildModel) Issue(org.jvnet.hudson.test.Issue) ViolationsParserTest(hudson.plugins.violations.ViolationsParserTest) Test(org.junit.Test)

Example 17 with FullBuildModel

use of hudson.plugins.violations.model.FullBuildModel in project violations-plugin by jenkinsci.

the class GendarmeParserTest method testParseViolationData.

@Test
public void testParseViolationData() throws IOException {
    FullBuildModel model = getFullBuildModel("Gendarme" + (File.separatorChar == '/' ? "_unix" : "") + ".xml");
    assertEquals("Number of violations is incorrect", 3, model.getCountNumber(GendarmeParser.TYPE_NAME));
    for (String fileModelKey : model.getFileModelMap().keySet()) {
        FullFileModel ffmodel = model.getFileModelMap().get(fileModelKey);
        logger.info(fileModelKey + ".displayName=" + ffmodel.getDisplayName());
        logger.info(fileModelKey + ".path=" + (ffmodel.getSourceFile() == null ? "null" : ffmodel.getSourceFile().getAbsolutePath()));
    }
    assertEquals("Number of files is incorrect", 2, model.getFileModelMap().size());
}
Also used : FullBuildModel(hudson.plugins.violations.model.FullBuildModel) FullFileModel(hudson.plugins.violations.model.FullFileModel) ViolationsParserTest(hudson.plugins.violations.ViolationsParserTest) Test(org.junit.Test)

Example 18 with FullBuildModel

use of hudson.plugins.violations.model.FullBuildModel in project violations-plugin by jenkinsci.

the class JsLintParserTest method testParseWithSingleFile.

@Test
public void testParseWithSingleFile() throws Exception {
    FullBuildModel model = getFullBuildModel("single.xml");
    // check number of violations and number of files
    assertEquals(51, model.getCountNumber(JsLintParser.TYPE_NAME));
    assertEquals(1, model.getFileModelMap().size());
    assertPrototype(model);
}
Also used : FullBuildModel(hudson.plugins.violations.model.FullBuildModel) ViolationsParserTest(hudson.plugins.violations.ViolationsParserTest) Test(org.junit.Test)

Example 19 with FullBuildModel

use of hudson.plugins.violations.model.FullBuildModel in project violations-plugin by jenkinsci.

the class SimianParserTest method testTwoFileParsing.

@Test
public void testTwoFileParsing() throws Exception {
    FullBuildModel model = getFullBuildModel("twofile.xml");
    assertEquals("Number of violations is incorrect", 2, model.getCountNumber(SimianParser.TYPE_NAME));
    assertEquals("Number of files is incorrect", 2, model.getFileModelMap().size());
}
Also used : FullBuildModel(hudson.plugins.violations.model.FullBuildModel) ViolationsParserTest(hudson.plugins.violations.ViolationsParserTest) Test(org.junit.Test)

Example 20 with FullBuildModel

use of hudson.plugins.violations.model.FullBuildModel in project violations-plugin by jenkinsci.

the class SimianParserTest method testOneFileParsing.

@Test
public void testOneFileParsing() throws Exception {
    FullBuildModel model = getFullBuildModel("onefile.xml");
    assertEquals("Number of violations is incorrect", 2, model.getCountNumber(SimianParser.TYPE_NAME));
    assertEquals("Number of files is incorrect", 1, model.getFileModelMap().size());
}
Also used : FullBuildModel(hudson.plugins.violations.model.FullBuildModel) ViolationsParserTest(hudson.plugins.violations.ViolationsParserTest) Test(org.junit.Test)

Aggregations

FullBuildModel (hudson.plugins.violations.model.FullBuildModel)25 ViolationsParserTest (hudson.plugins.violations.ViolationsParserTest)23 Test (org.junit.Test)23 Violation (hudson.plugins.violations.model.Violation)8 FullFileModel (hudson.plugins.violations.model.FullFileModel)3 Issue (org.jvnet.hudson.test.Issue)3 File (java.io.File)2 GenerateXML (hudson.plugins.violations.generate.GenerateXML)1 IOException2 (hudson.util.IOException2)1 URISyntaxException (java.net.URISyntaxException)1 URL (java.net.URL)1