Examples of Mojo


Examples of org.apache.maven.plugin.Mojo

    }

    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

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

Examples of org.apache.maven.plugin.Mojo

    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

Examples of org.apache.maven.plugin.Mojo

    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

Examples of org.apache.maven.plugin.Mojo

    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

Examples of org.apache.maven.plugin.Mojo

    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

Examples of org.apache.maven.plugin.Mojo

    }

    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

Examples of org.apache.maven.plugin.Mojo

    }

    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

Examples of org.apache.maven.plugin.Mojo

    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

Examples of org.apache.maven.plugin.Mojo

    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
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.