use of de.danoeh.antennapod.model.feed.FeedMedia in project AntennaPod by AntennaPod.
the class RssParserTest method testRss2Basic.
@Test
public void testRss2Basic() throws Exception {
File feedFile = FeedParserTestHelper.getFeedFile("feed-rss-testRss2Basic.xml");
Feed feed = FeedParserTestHelper.runFeedParser(feedFile);
assertEquals(Feed.TYPE_RSS2, feed.getType());
assertEquals("title", feed.getTitle());
assertEquals("en", feed.getLanguage());
assertEquals("http://example.com", feed.getLink());
assertEquals("This is the description", feed.getDescription());
assertEquals("http://example.com/payment", feed.getPaymentLinks().get(0).url);
assertEquals("http://example.com/picture", feed.getImageUrl());
assertEquals(10, feed.getItems().size());
for (int i = 0; i < feed.getItems().size(); i++) {
FeedItem item = feed.getItems().get(i);
assertEquals("http://example.com/item-" + i, item.getItemIdentifier());
assertEquals("item-" + i, item.getTitle());
assertNull(item.getDescription());
assertEquals("http://example.com/items/" + i, item.getLink());
assertEquals(new Date(i * 60000), item.getPubDate());
assertNull(item.getPaymentLink());
assertEquals("http://example.com/picture", item.getImageLocation());
// media
assertTrue(item.hasMedia());
FeedMedia media = item.getMedia();
// noinspection ConstantConditions
assertEquals("http://example.com/media-" + i, media.getDownload_url());
assertEquals(1024 * 1024, media.getSize());
assertEquals("audio/mp3", media.getMime_type());
// chapters
assertNull(item.getChapters());
}
}
Aggregations