use of android.database.MatrixCursor in project iosched by google.
the class SpeakersMockCursor method getCursorForNoSpeaker.
public static MatrixCursor getCursorForNoSpeaker() {
String[] data = { "", "", "", "", "", "", "" };
String[] columns = { "speaker_name", "speaker_image_url", "speaker_company", "speaker_abstract", "speaker_url", "plusone_url", "twitter_url" };
MatrixCursor matrixCursor = new MatrixCursor(columns);
matrixCursor.addRow(data);
return matrixCursor;
}
use of android.database.MatrixCursor in project reark by reark.
the class SimpleMockContentProvider method getCursor.
// Crude imitation of the behavior of SQL content provider
private Cursor getCursor(Uri uri, String... projection) {
MatrixCursor cursor = new MatrixCursor(projection);
if (values.containsKey(uri)) {
String[] result = { uri.getLastPathSegment(), values.get(uri) };
cursor.addRow(result);
} else if ("0".equals(uri.getLastPathSegment())) {
for (Uri key : values.keySet()) {
String[] result = { key.getLastPathSegment(), values.get(key) };
cursor.addRow(result);
}
}
return cursor;
}
use of android.database.MatrixCursor in project glide by bumptech.
the class ThumbnailStreamOpenerTest method testReturnsNullIfCursorIsEmpty.
@Test
public void testReturnsNullIfCursorIsEmpty() throws FileNotFoundException {
when(harness.query.query(eq(harness.uri))).thenReturn(new MatrixCursor(new String[1]));
assertNull(harness.get().open(harness.uri));
}
use of android.database.MatrixCursor in project glide by bumptech.
the class ThumbnailStreamOpenerTest method testReturnsNullIfCursorHasEmptyPath.
@Test
public void testReturnsNullIfCursorHasEmptyPath() throws FileNotFoundException {
MatrixCursor cursor = new MatrixCursor(new String[1]);
cursor.addRow(new Object[] { "" });
when(harness.query.query(eq(harness.uri))).thenReturn(cursor);
assertNull(harness.get().open(harness.uri));
}
use of android.database.MatrixCursor in project facebook-android-sdk by facebook.
the class MessengerUtilsTest method setupContentResolverForProtocolVersions.
/**
* Sets up the Messenger content resolver to reply that it supports the specified versions.
*
* @param versions the versions that it should support
*/
private void setupContentResolverForProtocolVersions(int... versions) {
MatrixCursor matrixCursor = new MatrixCursor(new String[] { "version" });
for (int version : versions) {
matrixCursor.addRow(new Object[] { version });
}
when(mMockContentResolver.query(Uri.parse("content://com.facebook.orca.provider.MessengerPlatformProvider/versions"), new String[] { "version" }, null, null, null)).thenReturn(matrixCursor);
}
Aggregations