Package org.apache.maven.plugin

Examples of org.apache.maven.plugin.Mojo


    }

    public void testCheckWithRegexPassing()
        throws Exception
    {
        Mojo mojo =
            lookupMojo( "check", PlexusTestCase.getBasedir() +
                "/src/test/plugin-configs/check-regex-pass-plugin-config.xml" );

        setVariableValueToObject( mojo, "pluginClasspathList", getPluginClasspath() );

        mojo.execute();
    }
View Full Code Here


    }

    public void testCheckWithRegexFailing()
        throws Exception
    {
        Mojo mojo =
            lookupMojo( "check", PlexusTestCase.getBasedir() +
                "/src/test/plugin-configs/check-regex-fail-plugin-config.xml" );

        setVariableValueToObject( mojo, "pluginClasspathList", getPluginClasspath() );

        try
        {
            mojo.execute();

            fail( "regex should fail at < 100% coverage" );
        }
        catch ( MojoExecutionException e )
        {
View Full Code Here

    }

    public void testCheckFailure()
        throws Exception
    {
        Mojo mojo =
            lookupMojo( "check", PlexusTestCase.getBasedir() + "/src/test/plugin-configs/check-halt-plugin-config.xml" );

        setVariableValueToObject( mojo, "pluginClasspathList", getPluginClasspath() );

        try
        {
            mojo.execute();

            fail( "Should fail when rates are not satisfied" );
        }
        catch ( MojoExecutionException e )
        {
View Full Code Here

    }

    public void testCheckFailureNoHalt()
        throws Exception
    {
        Mojo mojo =
            lookupMojo( "check", PlexusTestCase.getBasedir() +
                "/src/test/plugin-configs/check-no-halt-plugin-config.xml" );

        setVariableValueToObject( mojo, "pluginClasspathList", getPluginClasspath() );

        try
        {
            mojo.execute();
        }
        catch ( MojoExecutionException e )
        {
            if ( e.getMessage().equals( "Coverage check failed. See messages above." ) )
            {
View Full Code Here

    }

    public void testNoCheckParameter()
        throws Exception
    {
        Mojo mojo =
            lookupMojo( "check", PlexusTestCase.getBasedir() + "/src/test/plugin-configs/check-plugin-config.xml" );

        setVariableValueToObject( mojo, "pluginClasspathList", getPluginClasspath() );

        setVariableValueToObject( mojo, "check", null );

        try
        {
            mojo.execute();

            fail( "Should fail on null check parameter" );
        }
        catch ( MojoExecutionException e )
        {
View Full Code Here

    }

    public void testNoDataFileParameter()
        throws Exception
    {
        Mojo mojo =
            lookupMojo( "check", PlexusTestCase.getBasedir() + "/src/test/plugin-configs/check-plugin-config.xml" );

        setVariableValueToObject( mojo, "pluginClasspathList", getPluginClasspath() );

        setVariableValueToObject( mojo, "dataFile", new File( PlexusTestCase.getBasedir() + "/no/such/file" ) );

        try
        {
            mojo.execute();
        }
        catch ( MojoExecutionException e )
        {
            fail( "Should not fail" );
        }
View Full Code Here

    extends AbstractCoberturaTestCase
{
    public void testReport()
        throws Exception
    {
        Mojo mojo =
            lookupMojo( "cobertura", PlexusTestCase.getBasedir() + "/src/test/plugin-configs/report-plugin-config.xml" );

        setMojoPluginClasspath( mojo );

        MavenReport reportMojo = (MavenReport) mojo;

        assertTrue( "Should be able to generate a report", reportMojo.canGenerateReport() );

        assertTrue( "Should be an externale report", reportMojo.isExternalReport() );

        mojo.execute();

        File outputHtml = new File( reportMojo.getReportOutputDirectory(), reportMojo.getOutputName() + ".html" );

        assertTrue( "Test for generated html file", outputHtml.exists() );
    }
View Full Code Here

    }

    public void testReportEmptySourceDir()
        throws Exception
    {
        Mojo mojo =
            lookupMojo( "cobertura", PlexusTestCase.getBasedir() +
                "/src/test/plugin-configs/report-empty-src-plugin-config.xml" );

        setMojoPluginClasspath( mojo );
View Full Code Here

    }

    public void testDefault()
        throws Exception
    {
        Mojo mojo =
            lookupMojo( "instrument", PlexusTestCase.getBasedir() +
                "/src/test/plugin-configs/instrument-plugin-config.xml" );

        setVariableValueToObject( mojo, "pluginClasspathList", getPluginClasspath() );

        mojo.execute();

        MavenProject project = (MavenProject) getVariableValueFromObject( mojo, "project" );

        File instrumentedDir = new File( project.getBuild().getOutputDirectory() );
View Full Code Here

    }

    public void testDebugEnabled()
        throws Exception
    {
        Mojo mojo =
            lookupMojo( "instrument", PlexusTestCase.getBasedir() +
                "/src/test/plugin-configs/instrument-plugin-config.xml" );

        setVariableValueToObject( mojo, "pluginClasspathList", getPluginClasspath() );

        Log log = new SystemStreamLog()
        {
            public boolean isDebugEnabled()
            {
                return true;
            }
        };

        setVariableValueToObject( mojo, "log", log );

        mojo.execute();

        MavenProject project = (MavenProject) getVariableValueFromObject( mojo, "project" );

        File instrumentedDir = new File( project.getBuild().getOutputDirectory() );
View Full Code Here

TOP

Related Classes of org.apache.maven.plugin.Mojo

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.