Examples of DependencyProjectStub


Examples of org.apache.maven.plugin.dependency.testUtils.stubs.DependencyProjectStub

            fail( "Caught Unexpected Exception:" + e.getLocalizedMessage() );
        }

        try
        {
            DependencyProjectStub project = (DependencyProjectStub) mojo.getProject();
            project.setDependencyManagement( depMgt );
            // test with exclusion
            mojo.execute();
        }
        catch ( Exception e )
        {
            e.printStackTrace();
            fail( "Caught Unexpected Exception:" + e.getLocalizedMessage() );
        }

        try
        {
            DependencyProjectStub project = (DependencyProjectStub) mojo.getProject();
            project.setDependencyManagement( depMgt );
            // test with exclusion
            mojo.setFailBuild( true );
            mojo.execute();
            fail( "Expected exception to fail the build." );
        }
        catch ( Exception e )
        {
            System.out.println( "Caught Expected Exception:" + e.getLocalizedMessage() );
        }

        try
        {
            DependencyProjectStub project = (DependencyProjectStub) mojo.getProject();
            project.setDependencyManagement( depMgt );
            // test with exclusion
            mojo.setFailBuild( true );
            mojo.setIgnoreDirect( true );
            mojo.execute();
        }
View Full Code Here

Examples of org.apache.maven.plugin.dependency.testUtils.stubs.DependencyProjectStub

    protected void setUp()
        throws Exception
    {

        mojo = new AnalyzeDepMgt();
        MavenProject project = new DependencyProjectStub();

        stubFactory = new DependencyArtifactStubFactory( new File( "" ), false );

        Set<Artifact> allArtifacts = stubFactory.getMixedArtifacts();
        Set<Artifact> directArtifacts = stubFactory.getClassifiedArtifacts();


        exclusionArtifact = stubFactory.getReleaseArtifact();
        directArtifacts.add( exclusionArtifact );
        ex = new Exclusion();
        ex.setArtifactId( exclusionArtifact.getArtifactId() );
        ex.setGroupId( exclusionArtifact.getGroupId() );

        exclusion = new Dependency();
        exclusion.setArtifactId( exclusionArtifact.getArtifactId() );
        exclusion.setGroupId( exclusionArtifact.getGroupId() );
        exclusion.setType( exclusionArtifact.getType() );
        exclusion.setClassifier( "" );
        exclusion.setVersion( "3.0" );

        exclusion.addExclusion( ex );
        List<Dependency> list = new ArrayList<Dependency>();
        list.add( exclusion );

        depMgt = new DependencyManagement();
        depMgt.setDependencies( list );


        project.setArtifacts( allArtifacts );
        project.setDependencyArtifacts( directArtifacts );

        mojo.setProject( project );

    }
View Full Code Here

Examples of org.apache.maven.plugin.dependency.testUtils.stubs.DependencyProjectStub

    protected void setUp()
        throws Exception
    {

        mojo = new AnalyzeDepMgt();
        MavenProject project = new DependencyProjectStub();

        stubFactory = new DependencyArtifactStubFactory( new File( "" ), false );

        Set<Artifact> allArtifacts = stubFactory.getMixedArtifacts();
        Set<Artifact> directArtifacts = stubFactory.getClassifiedArtifacts();


        exclusionArtifact = stubFactory.getReleaseArtifact();
        directArtifacts.add( exclusionArtifact );
        ex = new Exclusion();
        ex.setArtifactId( exclusionArtifact.getArtifactId() );
        ex.setGroupId( exclusionArtifact.getGroupId() );

        exclusion = new Dependency();
        exclusion.setArtifactId( exclusionArtifact.getArtifactId() );
        exclusion.setGroupId( exclusionArtifact.getGroupId() );
        exclusion.setType( exclusionArtifact.getType() );
        exclusion.setClassifier( "" );
        exclusion.setVersion( "3.0" );

        exclusion.addExclusion( ex );
        List<Dependency> list = new ArrayList<Dependency>();
        list.add( exclusion );

        depMgt = new DependencyManagement();
        depMgt.setDependencies( list );


        project.setArtifacts( allArtifacts );
        project.setDependencyArtifacts( directArtifacts );

        mojo.setProject( project );

    }
View Full Code Here

Examples of org.apache.maven.plugin.dependency.testUtils.stubs.DependencyProjectStub

            fail( "Caught Unexpected Exception:" + e.getLocalizedMessage() );
        }

        try
        {
            DependencyProjectStub project = (DependencyProjectStub) mojo.getProject();
            project.setDependencyManagement( depMgt );
            // test with exclusion
            mojo.execute();
        }
        catch ( Exception e )
        {
            e.printStackTrace();
            fail( "Caught Unexpected Exception:" + e.getLocalizedMessage() );
        }

        try
        {
            DependencyProjectStub project = (DependencyProjectStub) mojo.getProject();
            project.setDependencyManagement( depMgt );
            // test with exclusion
            mojo.setFailBuild( true );
            mojo.execute();
            fail( "Expected exception to fail the build." );
        }
        catch ( Exception e )
        {
            System.out.println( "Caught Expected Exception:" + e.getLocalizedMessage() );
        }

        try
        {
            DependencyProjectStub project = (DependencyProjectStub) mojo.getProject();
            project.setDependencyManagement( depMgt );
            // test with exclusion
            mojo.setFailBuild( true );
            mojo.setIgnoreDirect( true );
            mojo.execute();
        }
View Full Code Here

Examples of org.apache.maven.plugin.dependency.testUtils.stubs.DependencyProjectStub

    protected void setUp()
        throws Exception
    {

        mojo = new AnalyzeDepMgt();
        MavenProject project = new DependencyProjectStub();

        stubFactory = new DependencyArtifactStubFactory( new File( "" ), false );

        Set<Artifact> allArtifacts = stubFactory.getMixedArtifacts();
        Set<Artifact> directArtifacts = stubFactory.getClassifiedArtifacts();


        exclusionArtifact = stubFactory.getReleaseArtifact();
        directArtifacts.add( exclusionArtifact );
        ex = new Exclusion();
        ex.setArtifactId( exclusionArtifact.getArtifactId() );
        ex.setGroupId( exclusionArtifact.getGroupId() );

        exclusion = new Dependency();
        exclusion.setArtifactId( exclusionArtifact.getArtifactId() );
        exclusion.setGroupId( exclusionArtifact.getGroupId() );
        exclusion.setType( exclusionArtifact.getType() );
        exclusion.setClassifier( "" );
        exclusion.setVersion( "3.0" );

        exclusion.addExclusion( ex );
        List<Dependency> list = new ArrayList<Dependency>();
        list.add( exclusion );

        depMgt = new DependencyManagement();
        depMgt.setDependencies( list );


        project.setArtifacts( allArtifacts );
        project.setDependencyArtifacts( directArtifacts );

        mojo.setProject( project );

    }
View Full Code Here

Examples of org.apache.maven.plugin.dependency.testUtils.stubs.DependencyProjectStub

            fail( "Caught Unexpected Exception:" + e.getLocalizedMessage() );
        }

        try
        {
            DependencyProjectStub project = (DependencyProjectStub) mojo.getProject();
            project.setDependencyManagement( depMgt );
            // test with exclusion
            mojo.execute();
        }
        catch ( Exception e )
        {
            e.printStackTrace();
            fail( "Caught Unexpected Exception:" + e.getLocalizedMessage() );
        }

        try
        {
            DependencyProjectStub project = (DependencyProjectStub) mojo.getProject();
            project.setDependencyManagement( depMgt );
            // test with exclusion
            mojo.setFailBuild( true );
            mojo.execute();
            fail( "Expected exception to fail the build." );
        }
        catch ( Exception e )
        {
            System.out.println( "Caught Expected Exception:" + e.getLocalizedMessage() );
        }

        try
        {
            DependencyProjectStub project = (DependencyProjectStub) mojo.getProject();
            project.setDependencyManagement( depMgt );
            // test with exclusion
            mojo.setFailBuild( true );
            mojo.setIgnoreDirect( true );
            mojo.execute();
        }
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.