Package org.apache.maven.plugin

Examples of org.apache.maven.plugin.Mojo


    }

    public void testInstrumentation()
        throws Exception
    {
        Mojo mojo =
            lookupMojo( "instrument", PlexusTestCase.getBasedir() + "/src/test/plugin-configs/" +
                "instrument-instrumentation-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


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

        File dataFile = (File) getVariableValueFromObject( mojo, "dataFile" );

        assertTrue( "Test if the ser file has been prepared", dataFile.exists() );

        mojo.execute();

        assertFalse( "ser file must have been deleted", dataFile.exists() );
    }
View Full Code Here

    public void testInvalidFormat()
        throws Exception
    {
        File pluginXmlFile = new File( getBasedir(), "src/test/plugin-configs/check-plugin-config.xml" );

        Mojo mojo = lookupMojo( "check", pluginXmlFile );

        assertNotNull( "Mojo found.", mojo );

        mojoSetup( mojo );
       
        setVariableValueToObject( mojo, "outputFileFormat", "plain" );

        try
        {
            mojo.execute();

            fail( "Must throw an exception invalid format: plain" );
        }
        catch ( MojoExecutionException e )
        {
View Full Code Here

    public void testNoOutputFile()
        throws Exception
    {
        File pluginXmlFile = new File( getBasedir(), "src/test/plugin-configs/check-plugin-config.xml" );

        Mojo mojo = lookupMojo( "check", pluginXmlFile );

        assertNotNull( "Mojo found.", mojo );

        mojoSetup( mojo );
       
        setVariableValueToObject( mojo, "outputFile", new File( "target/NoSuchFile.xml" ) );

        mojo.execute();
    }
View Full Code Here

    public void testNoFail()
        throws Exception
    {
        File pluginXmlFile = new File( getBasedir(), "src/test/plugin-configs/check-plugin-config.xml" );

        Mojo mojo = lookupMojo( "check", pluginXmlFile );

        assertNotNull( "Mojo found.", mojo );

        mojoSetup( mojo );
       
        setVariableValueToObject( mojo, "failOnViolation", Boolean.FALSE );

        mojo.execute();
    }
View Full Code Here

    }

    public void testAttachedMojo()
        throws Exception
    {
        Mojo mojo = lookupMojo( "attached", basedir + "/src/test/plugin-configs/attached/min-plugin-config.xml" );

        mojo.execute();

        assertTrue( "Test an archive was created", ArchiverManagerStub.archiverStub.getDestFile().exists() );
    }
View Full Code Here

    }

    public void testAttachedMojoDependencySet()
        throws Exception
    {
        Mojo mojo = lookupMojo( "attached", basedir + "/src/test/plugin-configs/attached/depSet-plugin-config.xml" );

        mojo.execute();

        MavenProject project = (MavenProject) getVariableValueFromObject( mojo, "project" );
        Set artifactSet = project.getArtifacts();

        Map archiveMap = ArchiverManagerStub.archiverStub.getFiles();
View Full Code Here

    public void testIdea()
        throws Exception
    {
        File pluginXmlFile = new File( getBasedir(), "src/test/idea-plugin-configs/min-plugin-config.xml" );

        Mojo mojo = lookupMojo( "idea", pluginXmlFile );

        mojo.execute();

        File basedir = new File( getBasedir()"target/test-harness/i-min" );

        String artifactId = "plugin-test-i-min";
View Full Code Here

    public void testIdeaWithMacro()
        throws Exception
    {
        File pluginXmlFile = new File( getBasedir(), "src/test/idea-plugin-configs/macro-plugin-config.xml" );

        Mojo mojo = lookupMojo( "idea", pluginXmlFile );

        mojo.execute();

        File basedir = new File( getBasedir(), "target/test-harness/i-macro" );

        String artifactId = "plugin-test-i-macro";
View Full Code Here

        assertTrue( "Test creation of project files", imlFile.createNewFile() );

        File iwsFile = new File( basedir, artifactId + ".iws" );
        assertTrue( "Test creation of project files", iwsFile.createNewFile() );

        Mojo mojo = lookupMojo( "clean", pluginXmlFile );

        mojo.execute();

        assertFalse( "Test idea project file was deleted", iprFile.exists() );

        assertFalse( "Test idea module file was deleted", imlFile.exists() );
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.