Package org.apache.maven.project.harness

Examples of org.apache.maven.project.harness.PomTestWrapper


    }   

    public void testMailingListsAreInheritedButNotAggregated()
        throws Exception
    {
        PomTestWrapper pom = buildPom( "mailing-lists-inheritance/child-2" );
        assertEquals( 1, ( (List<?>) pom.getValue( "mailingLists" ) ).size() );
        assertEquals( "child-mailing-list", pom.getValue( "mailingLists[1]/name" ) );
    }   
View Full Code Here


    }   

    public void testPluginInheritanceOrder()
        throws Exception
    {
        PomTestWrapper pom = buildPom( "plugin-inheritance-order/child" );

        assertEquals( "maven-it-plugin-log-file", pom.getValue( "build/plugins[1]/artifactId" ) );
        assertEquals( "maven-it-plugin-expression", pom.getValue( "build/plugins[2]/artifactId" ) );
        assertEquals( "maven-it-plugin-configuration", pom.getValue( "build/plugins[3]/artifactId" ) );

        assertEquals( "maven-it-plugin-log-file", pom.getValue( "reporting/plugins[1]/artifactId" ) );
        assertEquals( "maven-it-plugin-expression", pom.getValue( "reporting/plugins[2]/artifactId" ) );
        assertEquals( "maven-it-plugin-configuration", pom.getValue( "reporting/plugins[3]/artifactId" ) );
    }
View Full Code Here

    public void testCliPropsDominateProjectPropsDuringInterpolation()
        throws Exception
    {
        Properties props = new Properties();
        props.setProperty( "testProperty", "PASSED" );
        PomTestWrapper pom = buildPom( "interpolation-cli-wins", props );

        assertEquals( "PASSED", pom.getValue( "properties/interpolatedProperty" ) );
    }
View Full Code Here

    /** MNG-522, MNG-3018 */
    public void testManagedPluginConfigurationAppliesToImplicitPluginsIntroducedByPackaging()
        throws Exception
    {
        PomTestWrapper pom = buildPom( "plugin-management-for-implicit-plugin/child" );
        assertEquals( "passed.txt",
                      pom.getValue( "build/plugins[@artifactId='maven-resources-plugin']/configuration/pathname" ) );
        assertEquals( "passed.txt",
                      pom.getValue( "build/plugins[@artifactId='maven-it-plugin-log-file']/configuration/logFile" ) );
    }
View Full Code Here

    }

    public void testDefaultPluginsExecutionContributedByPackagingExecuteBeforeUserDefinedExecutions()
        throws Exception
    {
        PomTestWrapper pom = buildPom( "plugin-exec-order-and-default-exec" );
        List<PluginExecution> executions =
            (List<PluginExecution>) pom.getValue( "build/plugins[@artifactId='maven-resources-plugin']/executions" );
        assertNotNull( executions );
        assertEquals( 4, executions.size() );
        assertEquals( "default-resources", executions.get( 0 ).getId() );
        assertEquals( "default-testResources", executions.get( 1 ).getId() );
        assertEquals( "test-1", executions.get( 2 ).getId() );
View Full Code Here

    }

    public void testPluginDeclarationsRetainPomOrderAfterInjectionOfDefaultPlugins()
        throws Exception
    {
        PomTestWrapper pom = buildPom( "plugin-exec-order-with-lifecycle" );
        List<Plugin> plugins = (List<Plugin>) pom.getValue( "build/plugins" );
        int resourcesPlugin = -1;
        int customPlugin = -1;
        for ( int i = 0; i < plugins.size(); i++ )
        {
            Plugin plugin = plugins.get( i );
View Full Code Here

    /** MNG-4415 */
    public void testPluginOrderAfterMergingWithInheritedPlugins()
        throws Exception
    {
        PomTestWrapper pom = buildPom( "plugin-inheritance-merge-order/sub" );

        List<String> expected = new ArrayList<String>();
        expected.add( "maven-it-plugin-error" );
        expected.add( "maven-it-plugin-configuration" );
        expected.add( "maven-it-plugin-dependency-resolution" );
        expected.add( "maven-it-plugin-packaging" );
        expected.add( "maven-it-plugin-log-file" );
        expected.add( "maven-it-plugin-expression" );
        expected.add( "maven-it-plugin-fork" );
        expected.add( "maven-it-plugin-touch" );

        List<String> actual = new ArrayList<String>();
        for ( Plugin plugin : (List<Plugin>) pom.getValue( "build/plugins" ) )
        {
            actual.add( plugin.getArtifactId() );
        }

        actual.retainAll( expected );
View Full Code Here

    /** MNG-4416 */
    public void testPluginOrderAfterMergingWithInjectedPlugins()
        throws Exception
    {
        PomTestWrapper pom = buildPom( "plugin-injection-merge-order" );

        List<String> expected = new ArrayList<String>();
        expected.add( "maven-it-plugin-error" );
        expected.add( "maven-it-plugin-configuration" );
        expected.add( "maven-it-plugin-dependency-resolution" );
        expected.add( "maven-it-plugin-packaging" );
        expected.add( "maven-it-plugin-log-file" );
        expected.add( "maven-it-plugin-expression" );
        expected.add( "maven-it-plugin-fork" );
        expected.add( "maven-it-plugin-touch" );

        List<String> actual = new ArrayList<String>();
        for ( Plugin plugin : (List<Plugin>) pom.getValue( "build/plugins" ) )
        {
            actual.add( plugin.getArtifactId() );
        }

        actual.retainAll( expected );
View Full Code Here

        repoSession.setLocalRepositoryManager( new SimpleLocalRepositoryManager(
                                                                                 new File(
                                                                                           config.getLocalRepository().getBasedir() ) ) );
        config.setRepositorySession( repoSession );

        return new PomTestWrapper( pomFile, projectBuilder.build( pomFile, config ).getProject() );
    }
View Full Code Here

     */
    /* MNG-786*/
    public void testProfileModules()
        throws Exception
    {
        PomTestWrapper pom = buildPom( "profile-module", "a" );
        assertEquals( "test-prop", pom.getValue( "properties[1]/b" ) );// verifies profile applied
        assertEquals( 4, ( (List<?>) pom.getValue( "modules" ) ).size() );
        assertEquals( "module-2", pom.getValue( "modules[1]" ) );
        assertEquals( "module-1", pom.getValue( "modules[2]" ) );
        assertEquals( "module-3", pom.getValue( "modules[3]" ) );
        assertEquals( "module-4", pom.getValue( "modules[4]" ) );
    }
View Full Code Here

TOP

Related Classes of org.apache.maven.project.harness.PomTestWrapper

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.