Search in sources :

Example 11 with ChangeFile

use of org.apache.maven.scm.ChangeFile in project maven-plugins by apache.

the class FileActivityComparatorTest method testCompareByName.

public void testCompareByName() {
    List<ChangeFile> list1 = new ArrayList<ChangeFile>();
    list1.add(new ChangeFile("changefile-1", "123"));
    list1.add(new ChangeFile("changefile-1", "468"));
    List<ChangeFile> list2 = new ArrayList<ChangeFile>();
    list2.add(new ChangeFile("changefile-2", "246"));
    list2.add(new ChangeFile("changefile-2", "468"));
    assertTrue("Test compare by name, less than", comparator.compare(list1, list2) < 0);
    list1 = new ArrayList<ChangeFile>();
    list1.add(new ChangeFile("changefile-1", "246"));
    list1.add(new ChangeFile("changefile-1", "468"));
    list2 = new ArrayList<ChangeFile>();
    list2.add(new ChangeFile("changefile-2", "123"));
    list2.add(new ChangeFile("changefile-2", "234"));
    assertTrue("Test compare by name, greater than", comparator.compare(list1, list2) > 0);
}
Also used : ChangeFile(org.apache.maven.scm.ChangeFile) ArrayList(java.util.ArrayList)

Aggregations

ChangeFile (org.apache.maven.scm.ChangeFile)11 ChangeSet (org.apache.maven.scm.ChangeSet)6 ArrayList (java.util.ArrayList)4 LinkedList (java.util.LinkedList)3 List (java.util.List)3 SimpleDateFormat (java.text.SimpleDateFormat)2 HashMap (java.util.HashMap)2 ChangeLogSet (org.apache.maven.scm.command.changelog.ChangeLogSet)2 ParseException (java.text.ParseException)1 Date (java.util.Date)1 ScmTag (org.apache.maven.scm.ScmTag)1 SAXException (org.xml.sax.SAXException)1