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