IRI uri = new IRI("http://www.snellspace.com/public/contentsummary.xml");
Document<Feed> doc = parse(uri);
Feed feed = doc.getRoot();
int n = 1;
for (Entry entry : feed.getEntries()) {
Content content = entry.getContentElement();
Text summary = entry.getSummaryElement();
switch (n) {
case 1:
// XML Content Type
assertEquals(Content.Type.XML, content.getContentType());
assertTrue(content.getMimeType().match("application/xml"));
assertEquals(Text.Type.TEXT, summary.getTextType());
break;
case 2:
// XML Content Type by src reference
assertEquals(Content.Type.XML, content.getContentType());
assertNotNull(content.getResolvedSrc());
assertEquals(Text.Type.TEXT, summary.getTextType());
break;
case 3:
// Text Content Type. This is really an order test,
// to determine how a reader selects which text to show
assertEquals(Content.Type.TEXT, content.getContentType());
assertEquals(Text.Type.TEXT, summary.getTextType());
break;
case 4:
// Text Content Type. This is really an order test,
// to determine how a reader selects which text to show
assertEquals(Content.Type.TEXT, content.getContentType());
assertEquals(Text.Type.TEXT, summary.getTextType());
break;
case 5:
// Embedded iCalendar
assertEquals(Content.Type.MEDIA, content.getContentType());
assertTrue(content.getMimeType().match("text/calendar"));
assertEquals(Text.Type.TEXT, summary.getTextType());
break;
case 6:
// Embedded Base64 encoded GIF
assertEquals(Content.Type.MEDIA, content.getContentType());
assertTrue(content.getMimeType().match("image/gif"));
assertEquals(Text.Type.TEXT, summary.getTextType());
break;
}
n++;
}