Search in sources :

Example 1 with CheckstyleViolationCheckMojo

use of org.apache.maven.plugins.checkstyle.CheckstyleViolationCheckMojo in project maven-plugins by apache.

the class CheckstyleViolationCheckMojoTest method testDefaultConfig.

public void testDefaultConfig() throws Exception {
    File pluginXmlFile = new File(getBasedir(), "src/test/plugin-configs/check-plugin-config.xml");
    CheckstyleViolationCheckMojo mojo = (CheckstyleViolationCheckMojo) lookupMojo("check", pluginXmlFile);
    mojoSetup(mojo);
    assertNotNull("Mojo found.", mojo);
    assertNotNull("project null.", mojo.project);
    try {
        mojo.execute();
        fail("Must throw an exception on violations");
    } catch (MojoFailureException e) {
    // expected
    }
}
Also used : MojoFailureException(org.apache.maven.plugin.MojoFailureException) File(java.io.File) CheckstyleViolationCheckMojo(org.apache.maven.plugins.checkstyle.CheckstyleViolationCheckMojo)

Aggregations

File (java.io.File)1 MojoFailureException (org.apache.maven.plugin.MojoFailureException)1 CheckstyleViolationCheckMojo (org.apache.maven.plugins.checkstyle.CheckstyleViolationCheckMojo)1