Package org.apache.maven.continuum.model.scm

Examples of org.apache.maven.continuum.model.scm.ChangeSet


        return result;
    }

    private static ChangeSet convertScmFileSetToChangeSet( List<ScmFile> files )
    {
        ChangeSet changeSet = null;

        if ( files != null && !files.isEmpty() )
        {
            changeSet = new ChangeSet();

            // TODO: author, etc.
            for ( ScmFile scmFile : files )
            {
                ChangeFile file = new ChangeFile();

                file.setName( scmFile.getPath() );

                // TODO: revision?

                file.setStatus( scmFile.getStatus().toString() );

                changeSet.addFile( file );
            }
        }
        return changeSet;
    }
View Full Code Here


        {
            scmResult = new ScmResult();

            for ( Map<String, Object> map : scmChanges )
            {
                ChangeSet changeSet = new ChangeSet();
                changeSet.setAuthor( ContinuumBuildAgentUtil.getChangeSetAuthor( map ) );
                changeSet.setComment( ContinuumBuildAgentUtil.getChangeSetComment( map ) );
                changeSet.setDate( ContinuumBuildAgentUtil.getChangeSetDate( map ) );
                setChangeFiles( changeSet, map );
                scmResult.addChange( changeSet );
            }
        }
View Full Code Here

        if ( scmResult != null && scmResult.getChanges() != null )
        {
            for ( Object obj : scmResult.getChanges() )
            {
                ChangeSet changeSet = (ChangeSet) obj;

                Map<String, Object> map = new HashMap<String, Object>();
                if ( StringUtils.isNotEmpty( changeSet.getAuthor() ) )
                {
                    map.put( ContinuumBuildAgentUtil.KEY_CHANGESET_AUTHOR, changeSet.getAuthor() );
                }
                else
                {
                    map.put( ContinuumBuildAgentUtil.KEY_CHANGESET_AUTHOR, "" );
                }
                if ( StringUtils.isNotEmpty( changeSet.getComment() ) )
                {
                    map.put( ContinuumBuildAgentUtil.KEY_CHANGESET_COMMENT, changeSet.getComment() );
                }
                else
                {
                    map.put( ContinuumBuildAgentUtil.KEY_CHANGESET_COMMENT, "" );
                }
                if ( changeSet.getDateAsDate() != null )
                {
                    map.put( ContinuumBuildAgentUtil.KEY_CHANGESET_DATE, changeSet.getDateAsDate() );
                }
                map.put( ContinuumBuildAgentUtil.KEY_CHANGESET_FILES, getScmChangeFiles( changeSet.getFiles() ) );
                scmChanges.add( map );
            }
        }

        return scmChanges;
View Full Code Here

        return scmResult;
    }

    private static ChangeSet createTestChangeSet( String author, String comment, String base )
    {
        ChangeSet changeSet = new ChangeSet();
        changeSet.setAuthor( author );
        changeSet.setComment( comment );
        changeSet.setDate( System.currentTimeMillis() );
        List<ChangeFile> files = new ArrayList<ChangeFile>();
        files.add( createTestChangeFile( "name" + base + ".1", "rev" + base + ".1" ) );
        files.add( createTestChangeFile( "name" + base + ".2", "rev" + base + ".2" ) );
        files.add( createTestChangeFile( "name" + base + ".3", "rev" + base + ".3" ) );
        changeSet.setFiles( files );
        return changeSet;
    }
View Full Code Here

        if ( scmResult.getChanges() != null && !scmResult.getChanges().isEmpty() )
        {
            for ( org.apache.maven.scm.ChangeSet scmChangeSet : (List<org.apache.maven.scm.ChangeSet>) scmResult.getChanges() )
            {
                ChangeSet change = new ChangeSet();

                change.setAuthor( scmChangeSet.getAuthor() );

                change.setComment( scmChangeSet.getComment() );

                if ( scmChangeSet.getDate() != null )
                {
                    change.setDate( scmChangeSet.getDate().getTime() );
                }

                if ( scmChangeSet.getFiles() != null )
                {
                    for ( org.apache.maven.scm.ChangeFile f : (List<org.apache.maven.scm.ChangeFile>) scmChangeSet.getFiles() )
                    {
                        ChangeFile file = new ChangeFile();

                        file.setName( f.getName() );

                        file.setRevision( f.getRevision() );

                        change.addFile( file );
                    }
                }

                result.addChange( change );
            }
        }
        else
        {
            // We don't have a changes information probably because provider doesn't have a changelog command
            // so we use the updated list that contains only the updated files list
            ChangeSet changeSet = convertScmFileSetToChangeSet( scmResult.getUpdatedFiles() );

            if ( changeSet != null )
            {
                result.addChange( changeSet );
            }
View Full Code Here

        return result;
    }

    private static ChangeSet convertScmFileSetToChangeSet( List<ScmFile> files )
    {
        ChangeSet changeSet = null;

        if ( files != null && !files.isEmpty() )
        {
            changeSet = new ChangeSet();

            // TODO: author, etc.
            for ( ScmFile scmFile : files )
            {
                ChangeFile file = new ChangeFile();

                file.setName( scmFile.getPath() );

                // TODO: revision?

                file.setStatus( scmFile.getStatus().toString() );

                changeSet.addFile( file );
            }
        }
        return changeSet;
    }
View Full Code Here

        if ( scmChanges != null )
        {
            for ( Map<String, Object> map : scmChanges )
            {
                ChangeSet changeSet = new ChangeSet();
                changeSet.setAuthor( ContinuumBuildConstant.getChangeSetAuthor( map ) );
                changeSet.setComment( ContinuumBuildConstant.getChangeSetComment( map ) );
                changeSet.setDate( ContinuumBuildConstant.getChangeSetDate( map ) );
                setChangeFiles( changeSet, map );
                changes.add( changeSet );
            }
        }
View Full Code Here

                setVersion( "1.0.3" );
            }
        };
        final ChangeFile changeFile = new ChangeFile();
        changeFile.setName( "continuum-notifiers/pom.xml");
        ChangeSet changeSet = new ChangeSet()
        {
            {
                addFile( changeFile );
            }
        };
View Full Code Here

                setVersion( "1.0.3" );
            }
        };
        final ChangeFile changeFile = new ChangeFile();
        changeFile.setName( "continuum-notifiers/pom.xml" );
        ChangeSet changeSet = new ChangeSet()
        {
            {
                addFile( changeFile );
            }
        };
View Full Code Here

        ScmResult scmResult = project.getCheckoutResult();

        assertEquals( "check # change sets", 1, scmResult.getChanges().size() );

        ChangeSet changeSet = (ChangeSet) scmResult.getChanges().get( 0 );

        List actualCheckedOutFiles = changeSet.getFiles();

        if ( expectedCheckedOutFiles.length != actualCheckedOutFiles.size() )
        {
            print( "Expected files: " );
View Full Code Here

TOP

Related Classes of org.apache.maven.continuum.model.scm.ChangeSet

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.