java.lang.Object |
↳ |
com.atlassian.jira.functest.framework.changehistory.ChangeHistoryList |
Class Overview
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;
}
Public Constructors
public
ChangeHistoryList
()
Public Methods
public
void
add
(int index, Object element)
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
AssertionFailedError
| if this ChangeHistoryList does not contain all of the expected change
history
|
public
boolean
contains
(Object o)
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
public
boolean
equals
(Object o)
public
boolean
isEmpty
()
public
int
lastIndexOf
(Object o)
public
Object
remove
(int index)
public
boolean
remove
(Object o)
public
List
subList
(int fromIndex, int toIndex)