Class AbstractListExpectation
- java.lang.Object
-
- org.ikasan.testharness.flow.expectation.service.AbstractListExpectation
-
- All Implemented Interfaces:
FlowExpectation
- Direct Known Subclasses:
OrderedExpectation,UnorderedExpectation
public abstract class AbstractListExpectation extends java.lang.Object implements FlowExpectation
Abstract expectation based on a List of DefaultExpectations- Author:
- Ikasan Development Team
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected classAbstractListExpectation.DefaultExpectation<T>Default expectation allows for anything to be provided as an expectation.
-
Field Summary
Fields Modifier and Type Field Description protected ComparatorServicecomparatorServicecomparator service for expectationsprotected java.util.List<AbstractListExpectation.DefaultExpectation>expectations
-
Constructor Summary
Constructors Constructor Description AbstractListExpectation()AbstractListExpectation(ComparatorService comparatorService)Constructor allowing an alternate comparator service.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected voidaddExpectation(AbstractListExpectation.DefaultExpectation<?> defaultExpectation, java.lang.String description)Append the expectation to the already defined expectationsabstract voidallSatisfied(java.util.List<Capture<?>> captures)Have all expectations been satisfied<T> voidexpectation(T expectation)Add an Expectation to the ordered expectations<T> voidexpectation(T expectation, java.lang.String description)Add an Expectation to the ordered expectations and provide a description to help identify this expectation at runtime.<T> voidexpectation(T expectation, ExpectationComparator<?,?> expectationComparator)Add an Expectation and specific user defined comparator to the ordered expectations<T> voidexpectation(T expectation, ExpectationComparator<?,?> expectationComparator, java.lang.String description)Add an Expectation and specific user defined comparator to the ordered expectations and provide a specific description to help identity this expectation at runtime.protected java.lang.StringformatList(java.util.List<?> list)protected static ComparatorServicegetDefaultComparatorService()Default comparator serviceprotected org.ikasan.testharness.flow.expectation.service.AbstractListExpectation.ExpectationDifferencegetExpectationDifference(java.util.List<AbstractListExpectation.DefaultExpectation> expectations, java.util.List<Capture<?>> captures)<T> voidignore(T expectation)Add an ignore operation to the expectations order<T> voidignore(T expectation, java.lang.String description)Add an ignore operation to the expectations order and provide a description to help identify this expectation at runtime.
-
-
-
Field Detail
-
expectations
protected java.util.List<AbstractListExpectation.DefaultExpectation> expectations
-
comparatorService
protected ComparatorService comparatorService
comparator service for expectations
-
-
Constructor Detail
-
AbstractListExpectation
public AbstractListExpectation()
-
AbstractListExpectation
public AbstractListExpectation(ComparatorService comparatorService)
Constructor allowing an alternate comparator service.- Parameters:
comparatorService-
-
-
Method Detail
-
getDefaultComparatorService
protected static ComparatorService getDefaultComparatorService()
Default comparator service- Returns:
-
expectation
public <T> void expectation(T expectation, ExpectationComparator<?,?> expectationComparator)Add an Expectation and specific user defined comparator to the ordered expectations- Specified by:
expectationin interfaceFlowExpectation- Parameters:
expectation-expectationComparator-
-
expectation
public <T> void expectation(T expectation, ExpectationComparator<?,?> expectationComparator, java.lang.String description)Add an Expectation and specific user defined comparator to the ordered expectations and provide a specific description to help identity this expectation at runtime.- Specified by:
expectationin interfaceFlowExpectation- Parameters:
expectation-expectationComparator-description-
-
expectation
public <T> void expectation(T expectation)
Add an Expectation to the ordered expectations- Specified by:
expectationin interfaceFlowExpectation- Parameters:
expectation-
-
expectation
public <T> void expectation(T expectation, java.lang.String description)Add an Expectation to the ordered expectations and provide a description to help identify this expectation at runtime.- Specified by:
expectationin interfaceFlowExpectation- Parameters:
expectation-description-
-
ignore
public <T> void ignore(T expectation)
Add an ignore operation to the expectations order- Specified by:
ignorein interfaceFlowExpectation- Parameters:
expectation-
-
ignore
public <T> void ignore(T expectation, java.lang.String description)Add an ignore operation to the expectations order and provide a description to help identify this expectation at runtime.- Specified by:
ignorein interfaceFlowExpectation- Parameters:
expectation-description-
-
addExpectation
protected void addExpectation(AbstractListExpectation.DefaultExpectation<?> defaultExpectation, java.lang.String description)
Append the expectation to the already defined expectations- Parameters:
defaultExpectation-description-
-
allSatisfied
public abstract void allSatisfied(java.util.List<Capture<?>> captures)
Have all expectations been satisfied- Specified by:
allSatisfiedin interfaceFlowExpectation- Parameters:
captures- Ordered list of captured FlowElement invocations- Throws:
java.lang.AssertionError- if all expected invocations not satisfied
-
getExpectationDifference
protected org.ikasan.testharness.flow.expectation.service.AbstractListExpectation.ExpectationDifference getExpectationDifference(java.util.List<AbstractListExpectation.DefaultExpectation> expectations, java.util.List<Capture<?>> captures)
-
formatList
protected java.lang.String formatList(java.util.List<?> list)
-
-