Ejemplo n.º 1
0
  @Test
  public void queryAlbumTest() {
    Uri uri = MediaContract.Albums.buildAlbumUri(hostInfo.getId(), TestValues.Album.albumId);

    Cursor cursor = contentResolver.query(uri, TestValues.Album.PROJECTION, null, null, null);

    assertNotNull(cursor);
    assertEquals("cursor size ", 1, cursor.getCount());
    assertTrue(cursor.moveToFirst());
    TestValues.Album.test(cursor);
  }
Ejemplo n.º 2
0
  @Test
  public void queryAlbumWithMultipleArtistsTest() {
    Uri uri =
        MediaContract.Albums.buildAlbumUri(
            hostInfo.getId(), TestValues.AlbumWithMultipleArtists.albumId);

    Cursor cursor =
        contentResolver.query(
            uri, TestValues.AlbumWithMultipleArtists.PROJECTION, null, null, null);

    assertNotNull(cursor);
    assertEquals("cursor size ", 1, cursor.getCount());
    assertTrue(cursor.moveToFirst());
    LogUtils.LOGD("MediaProviderMusicTest", Utils.cursorToString(cursor));
    TestValues.AlbumWithMultipleArtists.test(cursor);
  }