@Test
public void testReadSummary() {
try {
reader = XMLInputFactory.newInstance().createXMLStreamReader(
new StringReader(summary1));
Summary summary = feedReader.readSummary(reader);
assertTrue(summary.getText()
.equals("This is <b>XHTML</b> content."));
assertTrue(summary.getAttributes() != null);
assertTrue(summary.getAttributes().size() == 1);
assertTrue(summary.getAttributes().get(0).getName().equals("type"));
assertTrue(summary.getAttributes().get(0).getValue()
.equals("xhtml"));
reader = XMLInputFactory.newInstance().createXMLStreamReader(
new StringReader(summary2));
summary = feedReader.readSummary(reader);
assertTrue(summary.getText().equals(
"This is <xhtml:b>XHTML</xhtml:b> content."));
assertTrue(summary.getAttributes() != null);
assertTrue(summary.getAttributes().size() == 1);
assertTrue(summary.getAttributes().get(0).getName().equals("type"));
assertTrue(summary.getAttributes().get(0).getValue()
.equals("xhtml"));
reader = XMLInputFactory.newInstance().createXMLStreamReader(
new StringReader(summary3));
List<Entry> entries = feedReader.readEntry(reader, null);
assertTrue(entries != null);
assertTrue(entries.size() == 1);
Entry entry = entries.iterator().next();
assertTrue(entry.getAttributes() != null);
assertTrue(entry.getAttributes().size() == 1);
assertTrue(entry.getAttributes().get(0).getName()
.equals("xmlns:xh"));
assertTrue(entry.getAttributes().get(0).getValue().equals(
"http://some.xh.specific.uri/xh"));
summary = entry.getSummary();
assertTrue(summary != null);
assertTrue(summary.getText().equals(
"This is <xh:b>XHTML</xh:b> content."));
assertTrue(summary.getAttributes() != null);
assertTrue(summary.getAttributes().size() == 1);
assertTrue(summary.getAttributes().get(0).getName().equals("type"));
assertTrue(summary.getAttributes().get(0).getValue()
.equals("xhtml"));
} catch (Exception e) {
e.printStackTrace();
fail("could not read title fragment.");