• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 
17 package android.test.mock;
18 
19 import android.content.ContentResolver;
20 import android.database.CharArrayBuffer;
21 import android.database.ContentObserver;
22 import android.database.Cursor;
23 import android.database.DataSetObserver;
24 import android.net.Uri;
25 import android.os.Bundle;
26 
27 import java.util.Map;
28 
29 /**
30  * <P>
31  * A mock {@link android.database.Cursor} class that isolates the test code from real
32  * Cursor implementation.
33  * </P>
34  * <P>
35  * All methods including ones related to querying the state of the cursor are
36  * are non-functional and throw {@link java.lang.UnsupportedOperationException}.
37  * </P>
38  */
39 public class MockCursor implements Cursor {
getColumnCount()40     public int getColumnCount() {
41         throw new UnsupportedOperationException("unimplemented mock method");
42     }
43 
getColumnIndex(String columnName)44     public int getColumnIndex(String columnName) {
45         throw new UnsupportedOperationException("unimplemented mock method");
46     }
47 
getColumnIndexOrThrow(String columnName)48     public int getColumnIndexOrThrow(String columnName) {
49         throw new UnsupportedOperationException("unimplemented mock method");
50     }
51 
getColumnName(int columnIndex)52     public String getColumnName(int columnIndex) {
53         throw new UnsupportedOperationException("unimplemented mock method");
54     }
55 
getColumnNames()56     public String[] getColumnNames() {
57         throw new UnsupportedOperationException("unimplemented mock method");
58     }
59 
getCount()60     public int getCount() {
61         throw new UnsupportedOperationException("unimplemented mock method");
62     }
63 
isNull(int columnIndex)64     public boolean isNull(int columnIndex) {
65         throw new UnsupportedOperationException("unimplemented mock method");
66     }
67 
getInt(int columnIndex)68     public int getInt(int columnIndex) {
69         throw new UnsupportedOperationException("unimplemented mock method");
70     }
71 
getLong(int columnIndex)72     public long getLong(int columnIndex) {
73         throw new UnsupportedOperationException("unimplemented mock method");
74     }
75 
getShort(int columnIndex)76     public short getShort(int columnIndex) {
77         throw new UnsupportedOperationException("unimplemented mock method");
78     }
79 
getFloat(int columnIndex)80     public float getFloat(int columnIndex) {
81         throw new UnsupportedOperationException("unimplemented mock method");
82     }
83 
getDouble(int columnIndex)84     public double getDouble(int columnIndex) {
85         throw new UnsupportedOperationException("unimplemented mock method");
86     }
87 
getBlob(int columnIndex)88     public byte[] getBlob(int columnIndex) {
89         throw new UnsupportedOperationException("unimplemented mock method");
90     }
91 
getString(int columnIndex)92     public String getString(int columnIndex) {
93         throw new UnsupportedOperationException("unimplemented mock method");
94     }
95 
getExtras()96     public Bundle getExtras() {
97         throw new UnsupportedOperationException("unimplemented mock method");
98     }
99 
getPosition()100     public int getPosition() {
101         throw new UnsupportedOperationException("unimplemented mock method");
102     }
103 
isAfterLast()104     public boolean isAfterLast() {
105         throw new UnsupportedOperationException("unimplemented mock method");
106     }
107 
isBeforeFirst()108     public boolean isBeforeFirst() {
109         throw new UnsupportedOperationException("unimplemented mock method");
110     }
111 
isFirst()112     public boolean isFirst() {
113         throw new UnsupportedOperationException("unimplemented mock method");
114     }
115 
isLast()116     public boolean isLast() {
117         throw new UnsupportedOperationException("unimplemented mock method");
118     }
119 
move(int offset)120     public boolean move(int offset) {
121         throw new UnsupportedOperationException("unimplemented mock method");
122     }
123 
moveToFirst()124     public boolean moveToFirst() {
125         throw new UnsupportedOperationException("unimplemented mock method");
126     }
127 
moveToLast()128     public boolean moveToLast() {
129         throw new UnsupportedOperationException("unimplemented mock method");
130     }
131 
moveToNext()132     public boolean moveToNext() {
133         throw new UnsupportedOperationException("unimplemented mock method");
134     }
135 
moveToPrevious()136     public boolean moveToPrevious() {
137         throw new UnsupportedOperationException("unimplemented mock method");
138     }
139 
moveToPosition(int position)140     public boolean moveToPosition(int position) {
141         throw new UnsupportedOperationException("unimplemented mock method");
142     }
143 
copyStringToBuffer(int columnIndex, CharArrayBuffer buffer)144     public void copyStringToBuffer(int columnIndex, CharArrayBuffer buffer) {
145         throw new UnsupportedOperationException("unimplemented mock method");
146     }
147 
deactivate()148     public void deactivate() {
149         throw new UnsupportedOperationException("unimplemented mock method");
150     }
151 
close()152     public void close() {
153         throw new UnsupportedOperationException("unimplemented mock method");
154     }
155 
isClosed()156     public boolean isClosed() {
157         throw new UnsupportedOperationException("unimplemented mock method");
158     }
159 
requery()160     public boolean requery() {
161         throw new UnsupportedOperationException("unimplemented mock method");
162     }
163 
registerContentObserver(ContentObserver observer)164     public void registerContentObserver(ContentObserver observer) {
165         throw new UnsupportedOperationException("unimplemented mock method");
166     }
167 
registerDataSetObserver(DataSetObserver observer)168     public void registerDataSetObserver(DataSetObserver observer) {
169         throw new UnsupportedOperationException("unimplemented mock method");
170     }
171 
respond(Bundle extras)172     public Bundle respond(Bundle extras) {
173         throw new UnsupportedOperationException("unimplemented mock method");
174     }
175 
getWantsAllOnMoveCalls()176     public boolean getWantsAllOnMoveCalls() {
177         throw new UnsupportedOperationException("unimplemented mock method");
178     }
179 
180     @SuppressWarnings("deprecation")
setNotificationUri(ContentResolver cr, Uri uri)181     public void setNotificationUri(ContentResolver cr, Uri uri) {
182         throw new UnsupportedOperationException("unimplemented mock method");
183     }
184 
185     @SuppressWarnings("deprecation")
unregisterContentObserver(ContentObserver observer)186     public void unregisterContentObserver(ContentObserver observer) {
187         throw new UnsupportedOperationException("unimplemented mock method");
188     }
189 
190     @SuppressWarnings("deprecation")
unregisterDataSetObserver(DataSetObserver observer)191     public void unregisterDataSetObserver(DataSetObserver observer) {
192         throw new UnsupportedOperationException("unimplemented mock method");
193     }
194 
getType(int columnIndex)195     public int getType(int columnIndex) {
196         throw new UnsupportedOperationException("unimplemented mock method");
197     }
198 }