com.atlassian.jira.functest.framework.changehistory
Class ChangeHistoryList
java.lang.Object
com.atlassian.jira.functest.framework.changehistory.ChangeHistoryList
- All Implemented Interfaces:
- Iterable, Collection, List
public class ChangeHistoryList
- extends Object
- implements List
This represents a simple object model for testing change history. A ChangeHistoryList
is a list of ChangeHistorySet objects.
The order of change history field items is database dependant and hence the order of the items
can be gauranteed. Hence the name ChangeHistorySet
However the order of the each set of changes is time dependant and hence can be represented by a list
hence the name {ChangeHistoryList}.
You can use this class using a fluent object notation like this :
ChangeHistoryList expectedList = new ChangeHistoryList();
expectedList.addChangeSet("Administrator")
.add("Time Spent", "1 hour [ 3600 ]")
.add("Remaining Estimate", "1 week [ 604800 ]");
expectedList.addChangeSet("Administrator")
.add("Time Spent", "2 hours [ 7200 ]")
.add("Remaining Estimate", "3 days [ 259200 ]");
expectedList.addChangeSet("Administrator")
.add("Time Spent", "1 day, 2 hours [ 93600 ] ")
.add("Remaining Estimate", "2 days [ 172800 ]");
expectedList.addChangeSet("Administrator")
.add("Time Spent", "2 days, 2 hours [ 180000 ] ");
try
{
ChangeHistoryList actualList = ChangeHistoryParser.getChangeHistory(getDialog());
actualList.assertContainsChangeHistory(expectedList);
}
catch (Error e)
{
dumpResponse(e);
throw e;
}
- Since:
- v3.13
ChangeHistoryList
public ChangeHistoryList()
addChangeSet
public ChangeHistorySet addChangeSet(String changedBy)
assertContainsChangeHistory
public void assertContainsChangeHistory(ChangeHistoryList expectedChangeHistoryList)
- Asserts that this
ChangeHistoryList contains the list of {@link ChangeHistorySet ) objects in
expectedChangeHistoryList. Note that this is a "contains" test and hence it may have more change history than
specified in expectedChangeHistoryList but not less.
- Parameters:
expectedChangeHistoryList - the list of expected ChangeHistoryEntry items
- Throws:
junit.framework.AssertionFailedError - if this ChangeHistoryList does not contain all of the expected change
history
assertContainsSomeOf
public void assertContainsSomeOf(ChangeHistoryList expectedChangeHistoryList)
containsSomeOf
public boolean containsSomeOf(ChangeHistorySet changeHistorySet)
- Returns true if this ChangeHistoryList contains some of the provided ChangeHistorySet
- Parameters:
changeHistorySet - the ChangeHistorySet to see if we contain some of it
- Returns:
- true if we contain some of the ChangeHistorySet
size
public int size()
- Specified by:
size in interface Collection- Specified by:
size in interface List
isEmpty
public boolean isEmpty()
- Specified by:
isEmpty in interface Collection- Specified by:
isEmpty in interface List
contains
public boolean contains(Object o)
- Specified by:
contains in interface Collection- Specified by:
contains in interface List
iterator
public Iterator iterator()
- Specified by:
iterator in interface Iterable- Specified by:
iterator in interface Collection- Specified by:
iterator in interface List
toArray
public Object[] toArray()
- Specified by:
toArray in interface Collection- Specified by:
toArray in interface List
toArray
public Object[] toArray(Object[] a)
- Specified by:
toArray in interface Collection- Specified by:
toArray in interface List
add
public boolean add(Object o)
- Specified by:
add in interface Collection- Specified by:
add in interface List
remove
public boolean remove(Object o)
- Specified by:
remove in interface Collection- Specified by:
remove in interface List
containsAll
public boolean containsAll(Collection c)
- Specified by:
containsAll in interface Collection- Specified by:
containsAll in interface List
addAll
public boolean addAll(Collection c)
- Specified by:
addAll in interface Collection- Specified by:
addAll in interface List
addAll
public boolean addAll(int index,
Collection c)
- Specified by:
addAll in interface List
removeAll
public boolean removeAll(Collection c)
- Specified by:
removeAll in interface Collection- Specified by:
removeAll in interface List
retainAll
public boolean retainAll(Collection c)
- Specified by:
retainAll in interface Collection- Specified by:
retainAll in interface List
clear
public void clear()
- Specified by:
clear in interface Collection- Specified by:
clear in interface List
equals
public boolean equals(Object o)
- Specified by:
equals in interface Collection- Specified by:
equals in interface List- Overrides:
equals in class Object
hashCode
public int hashCode()
- Specified by:
hashCode in interface Collection- Specified by:
hashCode in interface List- Overrides:
hashCode in class Object
get
public Object get(int index)
- Specified by:
get in interface List
set
public Object set(int index,
Object element)
- Specified by:
set in interface List
add
public void add(int index,
Object element)
- Specified by:
add in interface List
remove
public Object remove(int index)
- Specified by:
remove in interface List
indexOf
public int indexOf(Object o)
- Specified by:
indexOf in interface List
lastIndexOf
public int lastIndexOf(Object o)
- Specified by:
lastIndexOf in interface List
listIterator
public ListIterator listIterator()
- Specified by:
listIterator in interface List
listIterator
public ListIterator listIterator(int index)
- Specified by:
listIterator in interface List
subList
public List subList(int fromIndex,
int toIndex)
- Specified by:
subList in interface List
toString
public String toString()
- Overrides:
toString in class Object
Copyright © 2002-2014 Atlassian. All Rights Reserved.