コード例 #1
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);
  }
コード例 #2
0
  @Test
  public void querySongWithArtistWithoutAlbumTest() {
    Uri uri =
        MediaContract.Songs.buildArtistSongsListUri(
            hostInfo.getId(), TestValues.SongWithArtistWithoutAlbum.artistId);

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

    assertNotNull(cursor);
    assertEquals("cursor size ", 1, cursor.getCount());
    assertTrue(cursor.moveToFirst());
    Utils.cursorToString(cursor);
    TestValues.SongWithArtistWithoutAlbum.test(cursor);
  }