001: /*
002: * Licensed to the Apache Software Foundation (ASF) under one or more
003: * contributor license agreements. See the NOTICE file distributed with
004: * this work for additional information regarding copyright ownership.
005: * The ASF licenses this file to You under the Apache License, Version 2.0
006: * (the "License"); you may not use this file except in compliance with
007: * the License. You may obtain a copy of the License at
008: *
009: * http://www.apache.org/licenses/LICENSE-2.0
010: *
011: * Unless required by applicable law or agreed to in writing, software
012: * distributed under the License is distributed on an "AS IS" BASIS,
013: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014: * See the License for the specific language governing permissions and
015: * limitations under the License.
016: */
017:
018: package org.apache.harmony.beans.tests.support.mock;
019:
020: import java.beans.ExceptionListener;
021: import java.util.ArrayList;
022: import java.util.Collection;
023: import java.util.Iterator;
024: import java.util.List;
025: import java.util.ListIterator;
026:
027: /**
028: * Mock of ExceptionListener
029: */
030: @SuppressWarnings("unchecked")
031: public class MockExceptionListener implements ExceptionListener {
032:
033: public ArrayList<Object> exHistory = new ArrayList<Object>();
034:
035: public void exceptionThrown(Exception ex) {
036: exHistory.add(ex);
037: }
038:
039: /**
040: * @param arg0
041: * @param arg1
042: */
043: public void add(int arg0, Object arg1) {
044: exHistory.add(arg0, arg1);
045: }
046:
047: /**
048: * @param arg0
049: * @return
050: */
051: public boolean add(Object arg0) {
052: return exHistory.add(arg0);
053: }
054:
055: /**
056: * @param arg0
057: * @param arg1
058: * @return
059: */
060: public boolean addAll(int arg0, Collection arg1) {
061: return exHistory.addAll(arg0, arg1);
062: }
063:
064: /**
065: * @param arg0
066: * @return
067: */
068: public boolean addAll(Collection arg0) {
069: return exHistory.addAll(arg0);
070: }
071:
072: /**
073: *
074: */
075: public void clear() {
076: exHistory.clear();
077: }
078:
079: /**
080: * @param arg0
081: * @return
082: */
083: public boolean contains(Object arg0) {
084: return exHistory.contains(arg0);
085: }
086:
087: /**
088: * @param arg0
089: * @return
090: */
091: public boolean containsAll(Collection arg0) {
092: return exHistory.containsAll(arg0);
093: }
094:
095: /**
096: * @param arg0
097: */
098: public void ensureCapacity(int arg0) {
099: exHistory.ensureCapacity(arg0);
100: }
101:
102: /*
103: * (non-Javadoc)
104: *
105: * @see java.lang.Object#equals(java.lang.Object)
106: */
107: @Override
108: public boolean equals(Object arg0) {
109: return exHistory.equals(arg0);
110: }
111:
112: /**
113: * @param arg0
114: * @return
115: */
116: public Object get(int arg0) {
117: return exHistory.get(arg0);
118: }
119:
120: /*
121: * (non-Javadoc)
122: *
123: * @see java.lang.Object#hashCode()
124: */
125: @Override
126: public int hashCode() {
127: return exHistory.hashCode();
128: }
129:
130: /**
131: * @param arg0
132: * @return
133: */
134: public int indexOf(Object arg0) {
135: return exHistory.indexOf(arg0);
136: }
137:
138: /**
139: * @return
140: */
141: public boolean isEmpty() {
142: return exHistory.isEmpty();
143: }
144:
145: /**
146: * @return
147: */
148: public Iterator<Object> iterator() {
149: return exHistory.iterator();
150: }
151:
152: /**
153: * @param arg0
154: * @return
155: */
156: public int lastIndexOf(Object arg0) {
157: return exHistory.lastIndexOf(arg0);
158: }
159:
160: /**
161: * @return
162: */
163: public ListIterator<Object> listIterator() {
164: return exHistory.listIterator();
165: }
166:
167: /**
168: * @param arg0
169: * @return
170: */
171: public ListIterator<Object> listIterator(int arg0) {
172: return exHistory.listIterator(arg0);
173: }
174:
175: /**
176: * @param arg0
177: * @return
178: */
179: public Object remove(int arg0) {
180: return exHistory.remove(arg0);
181: }
182:
183: /**
184: * @param arg0
185: * @return
186: */
187: public boolean remove(Object arg0) {
188: return exHistory.remove(arg0);
189: }
190:
191: /**
192: * @param arg0
193: * @return
194: */
195: public boolean removeAll(Collection arg0) {
196: return exHistory.removeAll(arg0);
197: }
198:
199: /**
200: * @param arg0
201: * @return
202: */
203: public boolean retainAll(Collection arg0) {
204: return exHistory.retainAll(arg0);
205: }
206:
207: /**
208: * @param arg0
209: * @param arg1
210: * @return
211: */
212: public Object set(int arg0, Object arg1) {
213: return exHistory.set(arg0, arg1);
214: }
215:
216: /**
217: * @return
218: */
219: public int size() {
220: return exHistory.size();
221: }
222:
223: /**
224: * @param arg0
225: * @param arg1
226: * @return
227: */
228: public List<Object> subList(int arg0, int arg1) {
229: return exHistory.subList(arg0, arg1);
230: }
231:
232: /**
233: * @return
234: */
235: public Object[] toArray() {
236: return exHistory.toArray();
237: }
238:
239: /**
240: * @param arg0
241: * @return
242: */
243: public Object[] toArray(Object[] arg0) {
244: return exHistory.toArray(arg0);
245: }
246: }
|