Class AbstractFailingFetcher<T>
- java.lang.Object
-
- psidev.psi.mi.jami.bridges.fetcher.mock.AbstractMockFetcher<T>
-
- psidev.psi.mi.jami.bridges.fetcher.mock.AbstractFailingFetcher<T>
-
- All Implemented Interfaces:
MockFetcher<T>
- Direct Known Subclasses:
FailingBioactiveEntityFetcher,FailingCvTermFetcher,FailingGeneFetcher,FailingOrganismFetcher,FailingProteinFetcher,FailingPublicationFetcher
public abstract class AbstractFailingFetcher<T> extends AbstractMockFetcher<T>
A mock fetcher for testing behaviour of bridgeFailedExceptions. It can be set to throw exceptions for a given number of queries or to continuously throw the exception.- Since:
- 07/08/13
- Author:
- Gabriel Aldam (galdam@ebi.ac.uk)
-
-
Field Summary
-
Fields inherited from class psidev.psi.mi.jami.bridges.fetcher.mock.AbstractMockFetcher
localMap
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractFailingFetcher(int maxQuery)Sets up the mock fetcher with a number of times to throw exceptions before returning the solution to the query.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Collection<T>getEntries(Collection<String> identifier)getEntries.protected TgetEntry(String identifier)getEntry.-
Methods inherited from class psidev.psi.mi.jami.bridges.fetcher.mock.AbstractMockFetcher
addEntry, clearEntries, removeEntry
-
-
-
-
Constructor Detail
-
AbstractFailingFetcher
protected AbstractFailingFetcher(int maxQuery)
Sets up the mock fetcher with a number of times to throw exceptions before returning the solution to the query. If the maxQuery is positive, a query must be made that many times before a solution is given. If a new query is made, the count resets. If the maxQuery is -1, it will always throw an exception.- Parameters:
maxQuery- The number of time to throw an exception, or -1 if exception should always be thrown.
-
-
Method Detail
-
getEntry
protected T getEntry(String identifier) throws BridgeFailedException
getEntry.
Used to retrieve an entry from the internal list. will throw exceptions if the required number of queries has not been made.- Overrides:
getEntryin classAbstractMockFetcher<T>- Parameters:
identifier- aStringobject.- Returns:
- a T object.
- Throws:
BridgeFailedException- if any.
-
getEntries
protected Collection<T> getEntries(Collection<String> identifier) throws BridgeFailedException
getEntries.
- Parameters:
identifier- aCollectionobject.- Returns:
- a
Collectionobject. - Throws:
BridgeFailedException- if any.
-
-