01: package junit.support;
02:
03: import javax.cache.spi.CacheLoaderException;
04: import java.util.Arrays;
05: import java.util.LinkedList;
06: import java.util.List;
07:
08: /**
09: * A subclass to {@link javax.cache.spi.CacheLoaderException} that contains a record of the exception thrown - implemented
10: * as a {@link List} of Objects.
11: *
12: * @author <a href="mailto:manik@jboss.org">Manik Surtani</a>
13: */
14: public class RecordingException extends CacheLoaderException {
15: private List record = new LinkedList();
16:
17: public RecordingException(Object... record) {
18: if (record != null) {
19: this .record = Arrays.asList(record);
20: }
21: }
22:
23: /**
24: * @return the record of events registered with this exception. Guaranteed to be not null, although it may be empty.
25: */
26: public List getRecord() {
27: return record;
28: }
29:
30: public RecordingException() {
31: super ();
32: }
33:
34: public RecordingException(String message) {
35: super (message);
36: }
37:
38: public RecordingException(String message, Throwable cause) {
39: super (message, cause);
40: }
41:
42: public RecordingException(Throwable cause) {
43: super(cause);
44: }
45: }
|