Package org.apache.maven.plugin

Examples of org.apache.maven.plugin.Mojo.execute()


        Mojo mojo = (Mojo) lookupMojo( mojoName, pluginConfigFile.getAbsolutePath() );

        FileLoggingArchiverManagerStub archiverManager = (FileLoggingArchiverManagerStub) getVariableValueFromObject( mojo, "archiverManager" );
        archiverManager.clearArchiver();
       
        mojo.execute();

        return mojo;
    }

    private void assertFilesAdded( Mojo mojo, List requiredDependencies ) throws Exception
View Full Code Here


            new File( getBasedir(), "target/test-classes/unit/skip-test/" + configFile );
        Mojo mojo = lookupMojo( mojoName, testPom );
        assertNotNull( mojo );
        CapturingLog log = new CapturingLog();
        mojo.setLog( log );
        mojo.execute();

        assertTrue( log.getContent().indexOf( "Skipping plugin execution" ) != -1 );
    }

    class CapturingLog
View Full Code Here

        Mojo mojo =
            lookupMojo( "check", PlexusTestCase.getBasedir() + "/src/test/plugin-configs/check-plugin-config.xml" );

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

        mojo.execute();
    }

    public void testCheckWithRegexPassing()
        throws Exception
    {
View Full Code Here

            lookupMojo( "check", PlexusTestCase.getBasedir() +
                "/src/test/plugin-configs/check-regex-pass-plugin-config.xml" );

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

        mojo.execute();
    }

    public void testCheckWithRegexFailing()
        throws Exception
    {
View Full Code Here

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

        try
        {
            mojo.execute();

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

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

        try
        {
            mojo.execute();

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

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

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

        setVariableValueToObject( mojo, "check", null );

        try
        {
            mojo.execute();

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

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

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

        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

TOP
Copyright © 2018 www.massapi.com. 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.