public class ChangeHistoryList extends Object implements List
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;
}
| Constructor and Description |
|---|
ChangeHistoryList() |
| Modifier and Type | Method and Description |
|---|---|
void |
add(int index,
Object element) |
boolean |
add(Object o) |
boolean |
addAll(Collection c) |
boolean |
addAll(int index,
Collection c) |
ChangeHistorySet |
addChangeSet(String changedBy) |
ChangeHistorySet |
addChangeSet(String changedBy,
String id) |
void |
assertContainsChangeHistory(ChangeHistoryList expectedChangeHistoryList)
Asserts that this
ChangeHistoryList contains the list of {@link ChangeHistorySet ) objects in
expectedChangeHistoryList. |
void |
assertContainsSomeOf(ChangeHistoryList expectedChangeHistoryList) |
void |
clear() |
boolean |
contains(Object o) |
boolean |
containsAll(Collection c) |
boolean |
containsSomeOf(ChangeHistorySet changeHistorySet)
Returns true if this ChangeHistoryList contains some of the provided ChangeHistorySet
|
boolean |
equals(Object o) |
Object |
get(int index) |
int |
hashCode() |
int |
indexOf(Object o) |
boolean |
isEmpty() |
Iterator |
iterator() |
int |
lastIndexOf(Object o) |
ListIterator |
listIterator() |
ListIterator |
listIterator(int index) |
Object |
remove(int index) |
boolean |
remove(Object o) |
boolean |
removeAll(Collection c) |
boolean |
retainAll(Collection c) |
Object |
set(int index,
Object element) |
int |
size() |
List |
subList(int fromIndex,
int toIndex) |
Object[] |
toArray() |
Object[] |
toArray(Object[] a) |
String |
toString() |
clone, finalize, getClass, notify, notifyAll, wait, wait, waitreplaceAll, sort, spliteratorparallelStream, removeIf, streampublic ChangeHistorySet addChangeSet(String changedBy, String id)
public ChangeHistorySet addChangeSet(String changedBy)
public void assertContainsChangeHistory(ChangeHistoryList expectedChangeHistoryList)
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.expectedChangeHistoryList - the list of expected ChangeHistoryEntry itemsAssertionFailedError - if this ChangeHistoryList does not contain all of the expected change
historypublic void assertContainsSomeOf(ChangeHistoryList expectedChangeHistoryList)
public boolean containsSomeOf(ChangeHistorySet changeHistorySet)
changeHistorySet - the ChangeHistorySet to see if we contain some of itpublic int size()
size in interface Collectionsize in interface Listpublic boolean isEmpty()
isEmpty in interface CollectionisEmpty in interface Listpublic boolean contains(Object o)
contains in interface Collectioncontains in interface Listpublic Iterator iterator()
public Object[] toArray()
toArray in interface CollectiontoArray in interface Listpublic Object[] toArray(Object[] a)
toArray in interface CollectiontoArray in interface Listpublic boolean add(Object o)
add in interface Collectionadd in interface Listpublic boolean remove(Object o)
remove in interface Collectionremove in interface Listpublic boolean containsAll(Collection c)
containsAll in interface CollectioncontainsAll in interface Listpublic boolean addAll(Collection c)
addAll in interface CollectionaddAll in interface Listpublic boolean addAll(int index,
Collection c)
public boolean removeAll(Collection c)
removeAll in interface CollectionremoveAll in interface Listpublic boolean retainAll(Collection c)
retainAll in interface CollectionretainAll in interface Listpublic void clear()
clear in interface Collectionclear in interface Listpublic boolean equals(Object o)
public int hashCode()
public int lastIndexOf(Object o)
lastIndexOf in interface Listpublic ListIterator listIterator()
listIterator in interface Listpublic ListIterator listIterator(int index)
listIterator in interface ListCopyright © 2002-2023 Atlassian. All Rights Reserved.