1/*
2 * Copyright (C) 2009 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *      http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package android.test.mock;
18
19import android.content.ContentResolver;
20import android.database.CharArrayBuffer;
21import android.database.ContentObserver;
22import android.database.Cursor;
23import android.database.DataSetObserver;
24import android.net.Uri;
25import android.os.Bundle;
26
27/**
28 * A mock {@link android.database.Cursor} class that isolates the test code from real
29 * Cursor implementation.
30 *
31 * <p>
32 * All methods including ones related to querying the state of the cursor are
33 * are non-functional and throw {@link java.lang.UnsupportedOperationException}.
34 *
35 * @deprecated Use a mocking framework like <a href="https://github.com/mockito/mockito">Mockito</a>.
36 * New tests should be written using the
37 * <a href="{@docRoot}tools/testing-support-library/index.html">Android Testing Support Library</a>.
38 */
39@Deprecated
40public class MockCursor implements Cursor {
41    @Override
42    public int getColumnCount() {
43        throw new UnsupportedOperationException("unimplemented mock method");
44    }
45
46    @Override
47    public int getColumnIndex(String columnName) {
48        throw new UnsupportedOperationException("unimplemented mock method");
49    }
50
51    @Override
52    public int getColumnIndexOrThrow(String columnName) {
53        throw new UnsupportedOperationException("unimplemented mock method");
54    }
55
56    @Override
57    public String getColumnName(int columnIndex) {
58        throw new UnsupportedOperationException("unimplemented mock method");
59    }
60
61    @Override
62    public String[] getColumnNames() {
63        throw new UnsupportedOperationException("unimplemented mock method");
64    }
65
66    @Override
67    public int getCount() {
68        throw new UnsupportedOperationException("unimplemented mock method");
69    }
70
71    @Override
72    public boolean isNull(int columnIndex) {
73        throw new UnsupportedOperationException("unimplemented mock method");
74    }
75
76    @Override
77    public int getInt(int columnIndex) {
78        throw new UnsupportedOperationException("unimplemented mock method");
79    }
80
81    @Override
82    public long getLong(int columnIndex) {
83        throw new UnsupportedOperationException("unimplemented mock method");
84    }
85
86    @Override
87    public short getShort(int columnIndex) {
88        throw new UnsupportedOperationException("unimplemented mock method");
89    }
90
91    @Override
92    public float getFloat(int columnIndex) {
93        throw new UnsupportedOperationException("unimplemented mock method");
94    }
95
96    @Override
97    public double getDouble(int columnIndex) {
98        throw new UnsupportedOperationException("unimplemented mock method");
99    }
100
101    @Override
102    public byte[] getBlob(int columnIndex) {
103        throw new UnsupportedOperationException("unimplemented mock method");
104    }
105
106    @Override
107    public String getString(int columnIndex) {
108        throw new UnsupportedOperationException("unimplemented mock method");
109    }
110
111    @Override
112    public void setExtras(Bundle extras) {
113        throw new UnsupportedOperationException("unimplemented mock method");
114    }
115
116    @Override
117    public Bundle getExtras() {
118        throw new UnsupportedOperationException("unimplemented mock method");
119    }
120
121    @Override
122    public int getPosition() {
123        throw new UnsupportedOperationException("unimplemented mock method");
124    }
125
126    @Override
127    public boolean isAfterLast() {
128        throw new UnsupportedOperationException("unimplemented mock method");
129    }
130
131    @Override
132    public boolean isBeforeFirst() {
133        throw new UnsupportedOperationException("unimplemented mock method");
134    }
135
136    @Override
137    public boolean isFirst() {
138        throw new UnsupportedOperationException("unimplemented mock method");
139    }
140
141    @Override
142    public boolean isLast() {
143        throw new UnsupportedOperationException("unimplemented mock method");
144    }
145
146    @Override
147    public boolean move(int offset) {
148        throw new UnsupportedOperationException("unimplemented mock method");
149    }
150
151    @Override
152    public boolean moveToFirst() {
153        throw new UnsupportedOperationException("unimplemented mock method");
154    }
155
156    @Override
157    public boolean moveToLast() {
158        throw new UnsupportedOperationException("unimplemented mock method");
159    }
160
161    @Override
162    public boolean moveToNext() {
163        throw new UnsupportedOperationException("unimplemented mock method");
164    }
165
166    @Override
167    public boolean moveToPrevious() {
168        throw new UnsupportedOperationException("unimplemented mock method");
169    }
170
171    @Override
172    public boolean moveToPosition(int position) {
173        throw new UnsupportedOperationException("unimplemented mock method");
174    }
175
176    @Override
177    public void copyStringToBuffer(int columnIndex, CharArrayBuffer buffer) {
178        throw new UnsupportedOperationException("unimplemented mock method");
179    }
180
181    @Override
182    @Deprecated
183    public void deactivate() {
184        throw new UnsupportedOperationException("unimplemented mock method");
185    }
186
187    @Override
188    public void close() {
189        throw new UnsupportedOperationException("unimplemented mock method");
190    }
191
192    @Override
193    public boolean isClosed() {
194        throw new UnsupportedOperationException("unimplemented mock method");
195    }
196
197    @Override
198    @Deprecated
199    public boolean requery() {
200        throw new UnsupportedOperationException("unimplemented mock method");
201    }
202
203    @Override
204    public void registerContentObserver(ContentObserver observer) {
205        throw new UnsupportedOperationException("unimplemented mock method");
206    }
207
208    @Override
209    public void registerDataSetObserver(DataSetObserver observer) {
210        throw new UnsupportedOperationException("unimplemented mock method");
211    }
212
213    @Override
214    public Bundle respond(Bundle extras) {
215        throw new UnsupportedOperationException("unimplemented mock method");
216    }
217
218    @Override
219    public boolean getWantsAllOnMoveCalls() {
220        throw new UnsupportedOperationException("unimplemented mock method");
221    }
222
223    @Override
224    public void setNotificationUri(ContentResolver cr, Uri uri) {
225        throw new UnsupportedOperationException("unimplemented mock method");
226    }
227
228    @Override
229    public Uri getNotificationUri() {
230        throw new UnsupportedOperationException("unimplemented mock method");
231    }
232
233    @Override
234    public void unregisterContentObserver(ContentObserver observer) {
235        throw new UnsupportedOperationException("unimplemented mock method");
236    }
237
238    @Override
239    public void unregisterDataSetObserver(DataSetObserver observer) {
240        throw new UnsupportedOperationException("unimplemented mock method");
241    }
242
243    @Override
244    public int getType(int columnIndex) {
245        throw new UnsupportedOperationException("unimplemented mock method");
246    }
247}