01: package junit.support;
02:
03: import javax.cache.spi.CacheLoader;
04: import javax.cache.spi.CacheLoaderException;
05: import java.util.Collection;
06: import java.util.Map;
07:
08: /**
09: * {@link javax.cache.spi.CacheLoader} implementation that throws {@link RecordingException}s for all
10: * methods called on it, recording the parameters passed into the method in the exception.
11: *
12: * @author <a href="mailto:manik@jboss.org">Manik Surtani</a>
13: */
14: public class FailingCacheLoader implements CacheLoader {
15: public Object load(Object oKey) throws CacheLoaderException {
16: throw new RecordingException(oKey);
17: }
18:
19: public Map loadAll(Collection colKeys) throws CacheLoaderException {
20: throw new RecordingException(colKeys);
21: }
22:
23: public void censorPut(Object key, Object value)
24: throws CacheLoaderException {
25: throw new RecordingException(key, value);
26: }
27: }
|