com.emarsys.ecommon.test
Class ChainedAssertion

java.lang.Object
  extended by com.emarsys.ecommon.test.ChainedAssertion
All Implemented Interfaces:
Assertion, java.lang.Iterable<Assertion>, java.util.Collection<Assertion>, java.util.List<Assertion>

public class ChainedAssertion
extends java.lang.Object
implements Assertion, java.util.List<Assertion>

An aggregation of Assertions.

Author:
Michael "kULO" Kulovits

Field Summary
protected  java.util.List<Assertion> assertions
           
 
Constructor Summary
ChainedAssertion()
           
 
Method Summary
 boolean add(Assertion o)
           
 void add(int index, Assertion element)
           
 boolean addAll(java.util.Collection<? extends Assertion> c)
           
 boolean addAll(int index, java.util.Collection<? extends Assertion> c)
           
 void check()
          Checks if the assertion is correct.
 void clear()
           
 boolean contains(java.lang.Object o)
           
 boolean containsAll(java.util.Collection<?> c)
           
 boolean equals(java.lang.Object o)
           
 Assertion get(int index)
           
 int hashCode()
           
 int indexOf(java.lang.Object o)
           
 boolean isEmpty()
           
 java.util.Iterator<Assertion> iterator()
           
 int lastIndexOf(java.lang.Object o)
           
 java.util.ListIterator<Assertion> listIterator()
           
 java.util.ListIterator<Assertion> listIterator(int index)
           
 Assertion remove(int index)
           
 boolean remove(java.lang.Object o)
           
 boolean removeAll(java.util.Collection<?> c)
           
 boolean retainAll(java.util.Collection<?> c)
           
 Assertion set(int index, Assertion element)
           
 int size()
           
 java.util.List<Assertion> subList(int fromIndex, int toIndex)
           
 java.lang.Object[] toArray()
           
<T> T[]
toArray(T[] a)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

assertions

protected java.util.List<Assertion> assertions
Constructor Detail

ChainedAssertion

public ChainedAssertion()
Method Detail

check

public void check()
           throws java.lang.Exception,
                  java.lang.AssertionError
Description copied from interface: Assertion
Checks if the assertion is correct.

Specified by:
check in interface Assertion
Throws:
java.lang.Exception - - if a error occures
java.lang.AssertionError - - if the assertion is not correct/fails
See Also:
Assertion.check()

add

public boolean add(Assertion o)
Specified by:
add in interface java.util.Collection<Assertion>
Specified by:
add in interface java.util.List<Assertion>

add

public void add(int index,
                Assertion element)
Specified by:
add in interface java.util.List<Assertion>

addAll

public boolean addAll(java.util.Collection<? extends Assertion> c)
Specified by:
addAll in interface java.util.Collection<Assertion>
Specified by:
addAll in interface java.util.List<Assertion>

addAll

public boolean addAll(int index,
                      java.util.Collection<? extends Assertion> c)
Specified by:
addAll in interface java.util.List<Assertion>

clear

public void clear()
Specified by:
clear in interface java.util.Collection<Assertion>
Specified by:
clear in interface java.util.List<Assertion>

contains

public boolean contains(java.lang.Object o)
Specified by:
contains in interface java.util.Collection<Assertion>
Specified by:
contains in interface java.util.List<Assertion>

containsAll

public boolean containsAll(java.util.Collection<?> c)
Specified by:
containsAll in interface java.util.Collection<Assertion>
Specified by:
containsAll in interface java.util.List<Assertion>

equals

public boolean equals(java.lang.Object o)
Specified by:
equals in interface java.util.Collection<Assertion>
Specified by:
equals in interface java.util.List<Assertion>
Overrides:
equals in class java.lang.Object

get

public Assertion get(int index)
Specified by:
get in interface java.util.List<Assertion>

hashCode

public int hashCode()
Specified by:
hashCode in interface java.util.Collection<Assertion>
Specified by:
hashCode in interface java.util.List<Assertion>
Overrides:
hashCode in class java.lang.Object

indexOf

public int indexOf(java.lang.Object o)
Specified by:
indexOf in interface java.util.List<Assertion>

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface java.util.Collection<Assertion>
Specified by:
isEmpty in interface java.util.List<Assertion>

iterator

public java.util.Iterator<Assertion> iterator()
Specified by:
iterator in interface java.lang.Iterable<Assertion>
Specified by:
iterator in interface java.util.Collection<Assertion>
Specified by:
iterator in interface java.util.List<Assertion>

lastIndexOf

public int lastIndexOf(java.lang.Object o)
Specified by:
lastIndexOf in interface java.util.List<Assertion>

listIterator

public java.util.ListIterator<Assertion> listIterator()
Specified by:
listIterator in interface java.util.List<Assertion>

listIterator

public java.util.ListIterator<Assertion> listIterator(int index)
Specified by:
listIterator in interface java.util.List<Assertion>

remove

public Assertion remove(int index)
Specified by:
remove in interface java.util.List<Assertion>

remove

public boolean remove(java.lang.Object o)
Specified by:
remove in interface java.util.Collection<Assertion>
Specified by:
remove in interface java.util.List<Assertion>

removeAll

public boolean removeAll(java.util.Collection<?> c)
Specified by:
removeAll in interface java.util.Collection<Assertion>
Specified by:
removeAll in interface java.util.List<Assertion>

retainAll

public boolean retainAll(java.util.Collection<?> c)
Specified by:
retainAll in interface java.util.Collection<Assertion>
Specified by:
retainAll in interface java.util.List<Assertion>

set

public Assertion set(int index,
                     Assertion element)
Specified by:
set in interface java.util.List<Assertion>

size

public int size()
Specified by:
size in interface java.util.Collection<Assertion>
Specified by:
size in interface java.util.List<Assertion>

subList

public java.util.List<Assertion> subList(int fromIndex,
                                         int toIndex)
Specified by:
subList in interface java.util.List<Assertion>

toArray

public java.lang.Object[] toArray()
Specified by:
toArray in interface java.util.Collection<Assertion>
Specified by:
toArray in interface java.util.List<Assertion>

toArray

public <T> T[] toArray(T[] a)
Specified by:
toArray in interface java.util.Collection<Assertion>
Specified by:
toArray in interface java.util.List<Assertion>


Copyright © 2010 emarsys AG. All Rights Reserved.