Package org.apache.maven.scm

Examples of org.apache.maven.scm.ChangeSet


        ChangeLogSet changelogSets = (ChangeLogSet) changedLogs.get( 0 );

        assertEquals( "Test number of revisions on changelog 1", 2, changelogSets.getChangeSets().size() );

        ChangeSet changeSet = (ChangeSet) changelogSets.getChangeSets().get( 0 );


        Calendar cal = Calendar.getInstance(); // new cal with default TZ

        cal.set( 1977, 7, 6, 5, 30, 0); // expected date from min-changelog.xml

        cal.set( Calendar.MILLISECOND, 0);


        assertEquals( "Test changelog 1 set 1 date/time", cal.getTime().getTime(), changeSet.getDate().getTime() );

        assertEquals( "Test changelog 1 set 1 author", "Edwin Punzalan", changeSet.getAuthor() );

        assertEquals( "Test changelog 1 set 1 msg", "First commit msg", changeSet.getComment() );

        assertEquals( "Test changelog 1 set 1 files", 1, changeSet.getFiles().size() );

        ChangeFile changeFile = (ChangeFile) changeSet.getFiles().get( 0 );

        assertEquals( "Test changelog 1 set 1 file 1 filename", "/path/to/file.extension", changeFile.getName() );

        assertEquals( "Test changelog 1 set 1 file 1 revision", "1", changeFile.getRevision() );


        changeSet = (ChangeSet) changelogSets.getChangeSets().get( 1 );

        cal.set( 2005, 1, 24, 21, 30, 0 );

        assertEquals( "Test changelog 1 set 2 date/time", cal.getTime().getTime(), changeSet.getDate().getTime() );

        assertEquals( "Test changelog 1 set 2 author", "Edwin Punzalan", changeSet.getAuthor() );

        assertEquals( "Test changelog 1 set 2 msg", "Second commit msg", changeSet.getComment() );

        assertEquals( "Test changelog 1 set 2 files", 2, changeSet.getFiles().size() );

        changeFile = (ChangeFile) changeSet.getFiles().get( 0 );

        assertEquals( "Test changelog 1 set 2 file 1 filename", "/path/to/file.extension", changeFile.getName() );

        assertEquals( "Test changelog 1 set 2 file 1 revision", "2", changeFile.getRevision() );

        changeFile = (ChangeFile) changeSet.getFiles().get( 1 );

        assertEquals( "Test changelog 1 set 2 file 2 filename", "/path/to/file2.extension", changeFile.getName() );

        assertEquals( "Test changelog 1 set 2 file 2 revision", "2", changeFile.getRevision() );



        changelogSets = (ChangeLogSet) changedLogs.get( 1 );

        assertEquals( "Test number of revisions on changelog 2", 2, changelogSets.getChangeSets().size() );

        changeSet = (ChangeSet) changelogSets.getChangeSets().get( 0 );

        cal.set( 2005, 1, 25, 22, 45, 0 );

        assertEquals( "Test changelog 2 set 1 date/time", cal.getTime().getTime(), changeSet.getDate().getTime() );

        assertEquals( "Test changelog 2 set 1 author", "Keogh Edrich Punzalan", changeSet.getAuthor() );

        assertEquals( "Test changelog 2 set 1 msg", "Third commit msg", changeSet.getComment() );

        assertEquals( "Test changelog 2 set 1 files", 1, changeSet.getFiles().size() );

        changeFile = (ChangeFile) changeSet.getFiles().get( 0 );

        assertEquals( "Test changelog 2 set 1 file 1 filename", "/path/to/file.extension", changeFile.getName() );

        assertEquals( "Test changelog 2 set 1 file 1 revision", "3", changeFile.getRevision() );


        changeSet = (ChangeSet) changelogSets.getChangeSets().get( 1 );

        cal.set( 2100, 1, 25, 5, 30, 0 );

        assertEquals( "Test changelog 2 set 2 date/time", cal.getTime().getTime(), changeSet.getDate().getTime() );

        assertEquals( "Test changelog 2 set 2 author", "Keogh Edrich Punzalan", changeSet.getAuthor() );

        assertEquals( "Test changelog 2 set 2 msg", "Last commit msg", changeSet.getComment() );

        assertEquals( "Test changelog 2 set 2 files", 2, changeSet.getFiles().size() );

        changeFile = (ChangeFile) changeSet.getFiles().get( 0 );

        assertEquals( "Test changelog 2 set 2 file 1 filename", "/path/to/file.extension", changeFile.getName() );

        assertEquals( "Test changelog 2 set 2 file 1 revision", "4", changeFile.getRevision() );

        changeFile = (ChangeFile) changeSet.getFiles().get( 1 );

        assertEquals( "Test changelog 2 set 2 file 2 filename", "/path/to/file2.extension", changeFile.getName() );

        assertEquals( "Test changelog 2 set 2 file 2 revision", "4", changeFile.getRevision() );
    }
View Full Code Here


            .changeLog( getScmRepository(), fileSet, timeBeforeSecond, currentTime, 0, new ScmBranch( "" ) );

        //Thorough assert of the last result
        assertTrue( thirdResult.getProviderMessage(), thirdResult.isSuccess() );
        assertEquals( 1, thirdResult.getChangeLog().getChangeSets().size() );
        ChangeSet changeset = thirdResult.getChangeLog().getChangeSets().get( 0 );
        assertTrue( changeset.getDate().after( timeBeforeSecond ) );
        assertEquals( COMMIT_MSG, changeset.getComment() );
    }
View Full Code Here

     */
    private void countDevCommits( Collection entries )
    {
        for ( Iterator i = entries.iterator(); i.hasNext(); )
        {
            ChangeSet entry = (ChangeSet) i.next();

            String developer = entry.getAuthor();

            LinkedList list;

            if ( commits.containsKey( developer ) )
            {
View Full Code Here

     */
    private void countDevFiles( Collection entries )
    {
        for ( Iterator i2 = entries.iterator(); i2.hasNext(); )
        {
            ChangeSet entry = (ChangeSet) i2.next();

            String developer = entry.getAuthor();

            HashMap filesMap;

            if ( files.containsKey( developer ) )
            {
                filesMap = (HashMap) files.get( developer );
            }
            else
            {
                filesMap = new HashMap();
            }

            for ( Iterator i3 = entry.getFiles().iterator(); i3.hasNext(); )
            {
                ChangeFile file = (ChangeFile) i3.next();

                filesMap.put( file.getName(), file );
            }
View Full Code Here

        {
            bufFile = new ChangeFile( "" );
        }
        else if ( "changelog-entry".equals( qName ) )
        {
            bufEntry = new ChangeSet();
        }
        else if ( "date".equals( qName ) )
        {
            currentPattern = attributes.getValue( "pattern" );
            if ( currentPattern == null )
View Full Code Here

        Map map = new HashMap();

        for ( Iterator i = entries.iterator(); i.hasNext(); )
        {
            ChangeSet entry = (ChangeSet) i.next();

            for ( Iterator j = entry.getFiles().iterator(); j.hasNext(); )
            {
                ChangeFile file = (ChangeFile) j.next();

                List revisions;
View Full Code Here

        HashMap fileList = new HashMap();

        for ( Iterator i = entries.iterator(); i.hasNext(); )
        {
            ChangeSet entry = (ChangeSet) i.next();

            List files = entry.getFiles();

            for ( Iterator fileIterator = files.iterator(); fileIterator.hasNext(); )
            {
                ChangeFile file = (ChangeFile) fileIterator.next();
View Full Code Here

        List sortedEntries = new ArrayList( entries );
        Collections.sort( sortedEntries, new Comparator()
        {
            public int compare( Object arg0, Object arg1 )
            {
                ChangeSet changeSet0 = (ChangeSet) arg0;
                ChangeSet changeSet1 = (ChangeSet) arg1;
                return changeSet1.getDate().compareTo( changeSet0.getDate() );
            }
        } );

        for ( Iterator i = sortedEntries.iterator(); i.hasNext(); )
        {
            ChangeSet entry = (ChangeSet) i.next();

            doChangedSetDetail( entry, bundle, sink );
        }

        sink.table_();
View Full Code Here

            }

            spoolingComments = false;

            //Init a new changeset
            currentChange = new ChangeSet();
            currentChange.setFiles( new ArrayList<ChangeFile>( 0 ) );
            logEntries.add( currentChange );

            //Reset memeber vars
            currentComment = new ArrayList<String>();
View Full Code Here

    {
        final File svnLog = getTestFile( "/src/test/resources/svn/changelog/svnLogValidOutput.txt" );

        consumeLog( svnLog );

        final ChangeSet entry = consumer.getModifications().get( 0 );

        final List changedFiles = entry.getFiles();
        final String revision = ( (ChangeFile) changedFiles.get( 0 ) ).getRevision();

        assertEquals( "Valid revision expected", "15", revision );
        assertEquals( "Valid num changed files expected", 2, changedFiles.size() );
        assertEquals( "Valid name expected", "unconventional author output (somedata)", entry.getAuthor() );
        String expectedDate = getLocalizedDate( "2002-08-26 14:33:26", TimeZone.getTimeZone( "GMT-4" ) );
        assertEquals( "Valid date expected", expectedDate, entry.getDateFormatted() );
        assertEquals( "Valid comment expected", "Minor formatting changes.\n", entry.getComment() );
    }
View Full Code Here

TOP

Related Classes of org.apache.maven.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.