コード例 #1
0
  public void testAddItemToPlaybackHistoryNotPlayedYet()
      throws ExecutionException, InterruptedException, TimeoutException {
    FeedMedia media = playbackHistorySetup(null);
    DBWriter.addItemToPlaybackHistory(media).get(TIMEOUT, TimeUnit.SECONDS);
    PodDBAdapter adapter = PodDBAdapter.getInstance();
    adapter.open();
    media = DBReader.getFeedMedia(media.getId());
    adapter.close();

    assertNotNull(media);
    assertNotNull(media.getPlaybackCompletionDate());
  }
コード例 #2
0
  public void testAddItemToPlaybackHistoryAlreadyPlayed()
      throws ExecutionException, InterruptedException, TimeoutException {
    final long OLD_DATE = 0;

    FeedMedia media = playbackHistorySetup(new Date(OLD_DATE));
    DBWriter.addItemToPlaybackHistory(media).get(TIMEOUT, TimeUnit.SECONDS);
    PodDBAdapter adapter = PodDBAdapter.getInstance();
    adapter.open();
    media = DBReader.getFeedMedia(media.getId());
    adapter.close();

    assertNotNull(media);
    assertNotNull(media.getPlaybackCompletionDate());
    assertFalse(OLD_DATE == media.getPlaybackCompletionDate().getTime());
  }