Package org.apache.maven.shared.release.stubs

Examples of org.apache.maven.shared.release.stubs.ScmManagerStub


            .method( "tag" )
            .with( arguments )
            .will( new ReturnStub( new TagScmResult( "...", Collections.singletonList( new ScmFile( getPath( rootProject
                       .getFile() ), ScmFileStatus.TAGGED ) ) ) ) );

        ScmManagerStub stub = (ScmManagerStub) lookup( ScmManager.ROLE );
        stub.setScmProvider( (ScmProvider) scmProviderMock.proxy() );

        phase.execute( descriptor, new DefaultReleaseEnvironment(), reactorProjects );

        assertTrue( true );
    }
View Full Code Here


        descriptor.setScmReleaseLabel( "release-label" );

        Mock scmProviderMock = new Mock( ScmProvider.class );
        scmProviderMock.expects( new TestFailureMatcher( "Shouldn't have called tag" ) ).method( "tag" );

        ScmManagerStub stub = (ScmManagerStub) lookup( ScmManager.ROLE );
        stub.setScmProvider( (ScmProvider) scmProviderMock.proxy() );

        phase.simulate( descriptor, new DefaultReleaseEnvironment(), reactorProjects );

        assertTrue( true );
    }
View Full Code Here

        Mock scmProviderMock = new Mock( ScmProvider.class );
        scmProviderMock.expects( new InvokeOnceMatcher() ).method( "tag" ).will(
            new ThrowStub( new ScmException( "..." ) ) );

        ScmManagerStub stub = (ScmManagerStub) lookup( ScmManager.ROLE );
        stub.setScmProvider( (ScmProvider) scmProviderMock.proxy() );

        try
        {
            phase.execute( releaseDescriptor, new DefaultReleaseEnvironment(), reactorProjects );
View Full Code Here

            new Constraint[]{new IsEqual( repository ), new IsScmFileSetEquals( new ScmFileSet( checkoutDirectory ) ),
                new IsScmTagEquals( new ScmTag( "release-label" ) )};
        scmProviderMock.expects( new InvokeOnceMatcher() ).method( "checkOut" ).with( arguments ).will(
            new ReturnStub( new CheckOutScmResult( "", null ) ) );

        ScmManagerStub stub = (ScmManagerStub) lookup( ScmManager.ROLE );
        stub.setScmProvider( (ScmProvider) scmProviderMock.proxy() );
        stub.addScmRepositoryForUrl( scmUrl, repository );

        List<MavenProject> reactorProjects = createReactorProjects( "scm-commit", "/single-pom" );
        phase.execute( descriptor, new DefaultReleaseEnvironment(), reactorProjects );

        assertEquals( "", descriptor.getScmRelativePathProjectDirectory() );
View Full Code Here

            new Constraint[]{new IsEqual( repository ), new IsScmFileSetEquals( new ScmFileSet( checkoutDirectory ) ),
                new IsScmTagEquals( new ScmTag( "release-label" ) )};
        scmProviderMock.expects( new InvokeOnceMatcher() ).method( "checkOut" ).with( arguments ).will(
            new ReturnStub( new CheckOutScmResult( "", null ) ) );

        ScmManagerStub stub = (ScmManagerStub) lookup( ScmManager.ROLE );
        stub.setScmProvider( (ScmProvider) scmProviderMock.proxy() );
        stub.addScmRepositoryForUrl( scmUrl, repository );

        List<MavenProject> reactorProjects = createReactorProjects( "scm-commit", "/multimodule-with-deep-subprojects" );
        phase.execute( descriptor, new DefaultReleaseEnvironment(), reactorProjects );

        assertEquals( "", descriptor.getScmRelativePathProjectDirectory() );
View Full Code Here

            new Constraint[]{new IsEqual( repository ), new IsScmFileSetEquals( new ScmFileSet( checkoutDirectory ) ),
                new IsScmTagEquals( new ScmTag( "release-label" ) )};
        scmProviderMock.expects( new InvokeOnceMatcher() ).method( "checkOut" ).with( arguments ).will(
            new ReturnStub( new CheckOutScmResult( "", null ) ) );

        ScmManagerStub stub = (ScmManagerStub) lookup( ScmManager.ROLE );
        stub.setScmProvider( (ScmProvider) scmProviderMock.proxy() );
        stub.addScmRepositoryForUrl( scmUrl, repository );

        List<MavenProject> reactorProjects = createReactorProjects( "rewrite-for-release/pom-with-parent-flat", "/root-project" );
        phase.execute( descriptor, new DefaultReleaseEnvironment(), reactorProjects );

        assertEquals( "not found root-project but " + descriptor.getScmRelativePathProjectDirectory(), "root-project",
View Full Code Here

                                   eq( "release-label" ),
                                   argThat( new IsScmTagParamtersEquals( new ScmTagParameters( "[my prefix] copy for tag release-label" ) ) ) ) ).
                                   thenReturn( new TagScmResult( "...",
                                                                 Collections.singletonList( new ScmFile( getPath (rootProject
                                                                                                                  .getFile() ), ScmFileStatus.TAGGED ) ) ) );
        ScmManagerStub stub = (ScmManagerStub) lookup( ScmManager.ROLE );
        stub.setScmProvider( scmProviderMock );

        // execute
        phase.execute( descriptor, new DefaultReleaseEnvironment(), reactorProjects );

        // verify
View Full Code Here

                                   eq( "release-label" ),
                                   argThat(new IsScmTagParamtersEquals( new ScmTagParameters( "[my prefix] copy for tag release-label" ) ) ) ) ).
                                       thenReturnnew TagScmResult( "...", Collections.singletonList( new ScmFile( getPath (rootProject
                                                                                                                              .getFile() ), ScmFileStatus.TAGGED ) ) ) ) ;

        ScmManagerStub stub = (ScmManagerStub) lookup( ScmManager.ROLE );
        stub.setScmProvider( scmProviderMock );
        stub.addScmRepositoryForUrl( scmUrl, repository );

        // execute
        phase.execute( descriptor, new DefaultReleaseEnvironment(), reactorProjects );
       
        // verify
View Full Code Here

                                                "...",
                                                Collections.singletonList( new ScmFile(
                                                                                        getPath( rootProject.getFile() ),
                                                                                        ScmFileStatus.TAGGED ) ) ) );

        ScmManagerStub stub = (ScmManagerStub) lookup( ScmManager.ROLE );
        stub.setScmProvider( scmProviderMock );
        stub.addScmRepositoryForUrl( "scm:svn:" + scmUrl, repository );

        // execute
        phase.execute( descriptor, new DefaultReleaseEnvironment(), reactorProjects );
       
        // verify
View Full Code Here

                                   argThat( new IsScmFileSetEquals( fileSet ) ),
                                   eq( "release-label" ),
                                   argThat( new IsScmTagParamtersEquals( new ScmTagParameters( "[my prefix] copy for tag release-label" ) ) ) ) ).thenReturn( new TagScmResult( "...", Collections.singletonList( new ScmFile( getPath( rootProject
                       .getFile() ), ScmFileStatus.TAGGED ) ) ) );

        ScmManagerStub stub = (ScmManagerStub) lookup( ScmManager.ROLE );
        stub.setScmProvider( scmProviderMock );

        // exeucte
        phase.execute( descriptor, new DefaultReleaseEnvironment(), reactorProjects );

        // verify
View Full Code Here

TOP

Related Classes of org.apache.maven.shared.release.stubs.ScmManagerStub

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.