"<category domain=\"http://www.nytimes.com/namespaces/keywords/des\" >Subprime Mortgage Crisis</category>");
}
}
try {
Item item = rssDoc.buildItem(null, null, rssDoc
.buildDescription("something cool"), null, null, null,
null, null, null, null, null);
assertNotNull(item.getDescription());
assertNull(item.getTitle());
} catch (RSSpectException r) {
fail("should not fail here.");
}
try {
Item item = rssDoc.buildItem(rssDoc.buildTitle("try me"), null,
null, null, null, null, null, null, null, null, null);
assertNotNull(item.getTitle());
assertNull(item.getDescription());
} catch (RSSpectException r) {
fail("should not fail here.");
}
try {
rssDoc.buildItem(null, null, null, null, null, null, null,
null, null, null, null);
fail("we should have thrown an exception above.");
} catch (RSSpectException r) {
assertEquals(r.getMessage(),
"item elements MUST contain either a title or description element.");
}
} catch (Exception e) {
e.printStackTrace();
fail("should be working. " + e.getLocalizedMessage());
}
try {
rss1 = rssDoc.readRSSToBean(expectedRSS5);
assertNotNull(rss1);
assertNotNull(rss1.getChannel());
Item itmTitle = rss1.getChannel().getItem("first title");
assertNotNull(itmTitle);
Item itmDesc = rss1.getChannel().getItem("first description");
assertNotNull(itmDesc);
assertNull(rss1.getChannel().getItem("Bunky"));
} catch (Exception r) {
fail("should just work.");
}