fail("should not get here.");
}
try {
rss1 = rssDoc.readRSSToBean(expectedRSS2);
Channel channel = rss1.getChannel();
List<Extension> extns = channel.getExtensions();
if (extns == null) {
extns = new LinkedList<Extension>();
}
// test a bound extension prefix.
List<Attribute> attrs = new LinkedList<Attribute>();
attrs.add(rssDoc.buildAttribute("xmlns:test", "http://12345.com"));
extns.add(rssDoc.buildExtension("test:ext", attrs,
"I am a bound extension element"));
channel = rssDoc.buildChannel(channel.getTitle(),
channel.getLink(), channel.getDescription(),
channel.getLanguage(), channel.getCopyright(),
channel.getManagingEditor(), channel.getWebMaster(),
channel.getPubDate(), channel.getLastBuildDate(),
channel.getCategories(), channel.getGenerator(),
channel.getDocs(), channel.getCloud(), channel.getTtl(),
channel.getImage(), channel.getRating(),
channel.getTextInput(), channel.getSkipHours(),
channel.getSkipDays(), extns, channel.getItems());
assertNotNull(rssDoc.buildRSS(channel, rss1.getAttributes(),
rss1.getExtensions()));
// test an unbound extension prefix at the channel level.
extns = new LinkedList<Extension>();
extns.add(rssDoc.buildExtension("test:ext", null,
"I am an unbound extension element"));
channel = rssDoc.buildChannel(channel.getTitle(),
channel.getLink(), channel.getDescription(),
channel.getLanguage(), channel.getCopyright(),
channel.getManagingEditor(), channel.getWebMaster(),
channel.getPubDate(), channel.getLastBuildDate(),
channel.getCategories(), channel.getGenerator(),
channel.getDocs(), channel.getCloud(), channel.getTtl(),
channel.getImage(), channel.getRating(),
channel.getTextInput(), channel.getSkipHours(),
channel.getSkipDays(), extns, channel.getItems());
rssDoc.buildRSS(channel, rss1.getAttributes(), rss1.getExtensions());
fail("should not get here");
} catch (Exception e) {
assertTrue(e instanceof RSSpectException);
assertTrue(e