Daisuke Miyakawa | ba2b21b | 2009-10-11 18:23:19 -0700 | [diff] [blame] | 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 | |
Daisuke Miyakawa | 54616f3 | 2009-10-15 14:57:55 -0700 | [diff] [blame] | 17 | package android.test.mock; |
Daisuke Miyakawa | ba2b21b | 2009-10-11 18:23:19 -0700 | [diff] [blame] | 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 | |
Daisuke Miyakawa | 54616f3 | 2009-10-15 14:57:55 -0700 | [diff] [blame] | 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 | */ |
Daisuke Miyakawa | ba2b21b | 2009-10-11 18:23:19 -0700 | [diff] [blame] | 39 | public class MockCursor implements Cursor { |
| 40 | public int getColumnCount() { |
| 41 | throw new UnsupportedOperationException("unimplemented mock method"); |
| 42 | } |
| 43 | |
| 44 | public int getColumnIndex(String columnName) { |
| 45 | throw new UnsupportedOperationException("unimplemented mock method"); |
| 46 | } |
| 47 | |
| 48 | public int getColumnIndexOrThrow(String columnName) { |
| 49 | throw new UnsupportedOperationException("unimplemented mock method"); |
| 50 | } |
| 51 | |
| 52 | public String getColumnName(int columnIndex) { |
| 53 | throw new UnsupportedOperationException("unimplemented mock method"); |
| 54 | } |
| 55 | |
| 56 | public String[] getColumnNames() { |
| 57 | throw new UnsupportedOperationException("unimplemented mock method"); |
| 58 | } |
| 59 | |
| 60 | public int getCount() { |
| 61 | throw new UnsupportedOperationException("unimplemented mock method"); |
| 62 | } |
| 63 | |
| 64 | public boolean isNull(int columnIndex) { |
| 65 | throw new UnsupportedOperationException("unimplemented mock method"); |
| 66 | } |
| 67 | |
| 68 | public int getInt(int columnIndex) { |
| 69 | throw new UnsupportedOperationException("unimplemented mock method"); |
| 70 | } |
| 71 | |
| 72 | public long getLong(int columnIndex) { |
| 73 | throw new UnsupportedOperationException("unimplemented mock method"); |
| 74 | } |
| 75 | |
| 76 | public short getShort(int columnIndex) { |
| 77 | throw new UnsupportedOperationException("unimplemented mock method"); |
| 78 | } |
| 79 | |
| 80 | public float getFloat(int columnIndex) { |
| 81 | throw new UnsupportedOperationException("unimplemented mock method"); |
| 82 | } |
| 83 | |
| 84 | public double getDouble(int columnIndex) { |
| 85 | throw new UnsupportedOperationException("unimplemented mock method"); |
| 86 | } |
| 87 | |
| 88 | public byte[] getBlob(int columnIndex) { |
| 89 | throw new UnsupportedOperationException("unimplemented mock method"); |
| 90 | } |
| 91 | |
| 92 | public String getString(int columnIndex) { |
| 93 | throw new UnsupportedOperationException("unimplemented mock method"); |
| 94 | } |
| 95 | |
| 96 | public Bundle getExtras() { |
| 97 | throw new UnsupportedOperationException("unimplemented mock method"); |
| 98 | } |
| 99 | |
| 100 | public int getPosition() { |
| 101 | throw new UnsupportedOperationException("unimplemented mock method"); |
| 102 | } |
| 103 | |
| 104 | public boolean isAfterLast() { |
| 105 | throw new UnsupportedOperationException("unimplemented mock method"); |
| 106 | } |
| 107 | |
| 108 | public boolean isBeforeFirst() { |
| 109 | throw new UnsupportedOperationException("unimplemented mock method"); |
| 110 | } |
| 111 | |
| 112 | public boolean isFirst() { |
| 113 | throw new UnsupportedOperationException("unimplemented mock method"); |
| 114 | } |
| 115 | |
| 116 | public boolean isLast() { |
| 117 | throw new UnsupportedOperationException("unimplemented mock method"); |
| 118 | } |
| 119 | |
| 120 | public boolean move(int offset) { |
| 121 | throw new UnsupportedOperationException("unimplemented mock method"); |
| 122 | } |
| 123 | |
| 124 | public boolean moveToFirst() { |
| 125 | throw new UnsupportedOperationException("unimplemented mock method"); |
| 126 | } |
| 127 | |
| 128 | public boolean moveToLast() { |
| 129 | throw new UnsupportedOperationException("unimplemented mock method"); |
| 130 | } |
| 131 | |
| 132 | public boolean moveToNext() { |
| 133 | throw new UnsupportedOperationException("unimplemented mock method"); |
| 134 | } |
| 135 | |
| 136 | public boolean moveToPrevious() { |
| 137 | throw new UnsupportedOperationException("unimplemented mock method"); |
| 138 | } |
| 139 | |
| 140 | public boolean moveToPosition(int position) { |
| 141 | throw new UnsupportedOperationException("unimplemented mock method"); |
| 142 | } |
| 143 | |
| 144 | public void copyStringToBuffer(int columnIndex, CharArrayBuffer buffer) { |
| 145 | throw new UnsupportedOperationException("unimplemented mock method"); |
| 146 | } |
| 147 | |
| 148 | public void deactivate() { |
| 149 | throw new UnsupportedOperationException("unimplemented mock method"); |
| 150 | } |
| 151 | |
| 152 | public void close() { |
| 153 | throw new UnsupportedOperationException("unimplemented mock method"); |
| 154 | } |
| 155 | |
| 156 | public boolean isClosed() { |
| 157 | throw new UnsupportedOperationException("unimplemented mock method"); |
| 158 | } |
| 159 | |
| 160 | public boolean requery() { |
| 161 | throw new UnsupportedOperationException("unimplemented mock method"); |
| 162 | } |
| 163 | |
| 164 | public void registerContentObserver(ContentObserver observer) { |
| 165 | throw new UnsupportedOperationException("unimplemented mock method"); |
| 166 | } |
| 167 | |
| 168 | public void registerDataSetObserver(DataSetObserver observer) { |
| 169 | throw new UnsupportedOperationException("unimplemented mock method"); |
| 170 | } |
| 171 | |
| 172 | public Bundle respond(Bundle extras) { |
| 173 | throw new UnsupportedOperationException("unimplemented mock method"); |
| 174 | } |
| 175 | |
| 176 | public boolean getWantsAllOnMoveCalls() { |
| 177 | throw new UnsupportedOperationException("unimplemented mock method"); |
| 178 | } |
| 179 | |
Daisuke Miyakawa | ba2b21b | 2009-10-11 18:23:19 -0700 | [diff] [blame] | 180 | public void setNotificationUri(ContentResolver cr, Uri uri) { |
| 181 | throw new UnsupportedOperationException("unimplemented mock method"); |
| 182 | } |
| 183 | |
Dianne Hackborn | c87c92e | 2013-05-14 13:44:29 -0700 | [diff] [blame] | 184 | public Uri getNotificationUri() { |
| 185 | throw new UnsupportedOperationException("unimplemented mock method"); |
| 186 | } |
| 187 | |
Daisuke Miyakawa | ba2b21b | 2009-10-11 18:23:19 -0700 | [diff] [blame] | 188 | public void unregisterContentObserver(ContentObserver observer) { |
| 189 | throw new UnsupportedOperationException("unimplemented mock method"); |
| 190 | } |
| 191 | |
Daisuke Miyakawa | ba2b21b | 2009-10-11 18:23:19 -0700 | [diff] [blame] | 192 | public void unregisterDataSetObserver(DataSetObserver observer) { |
| 193 | throw new UnsupportedOperationException("unimplemented mock method"); |
| 194 | } |
Vasu Nori | 8b0dd7d | 2010-05-18 11:54:31 -0700 | [diff] [blame] | 195 | |
| 196 | public int getType(int columnIndex) { |
| 197 | throw new UnsupportedOperationException("unimplemented mock method"); |
| 198 | } |
Daisuke Miyakawa | ba2b21b | 2009-10-11 18:23:19 -0700 | [diff] [blame] | 199 | } |