String ch_title = "The Great Demo Channel";
String ch_desc = "Just a very simple short description.";
// create dummy channel
ChannelIF channel = new Channel(ch_title);
channel.setDescription(ch_desc);
channel.setSite(new URL("http://nava.de"));
channel.setLocation(new URL("http://nava.de/news.rdf"));
ItemIF itemA = new Item("Bugo", "All about it!",
new URL("http://nava.de/huhu2002"));
itemA.setFound(new Date());
channel.addItem(itemA);
// TODO: what about markup here ???
ItemIF itemB = new Item("SoCool",
"????**$12 @??? # <strong>should</strong> work",
new URL("http://nava.de/very/nested/98"));
itemB.setFound(new Date());
channel.addItem(itemB);
assertEquals(2, channel.getItems().size());
// export this channel to file (encoding: utf-8)
String basename = "export-rss10.xml";
String exp_file = getOutputDir() + FS + basename;
ChannelExporterIF exporter = new RSS_1_0_Exporter(exp_file);
exporter.write(channel);
// clean channel object
channel = null;
// read in again
File inpFile = new File(exp_file);
channel = FeedParser.parse(new ChannelBuilder(), inpFile);
assertEquals(ch_title, channel.getTitle());
assertEquals(ch_desc, channel.getDescription());
Collection items = channel.getItems();
assertEquals(2, items.size());
Iterator it = items.iterator();
ItemIF item = (ItemIF) it.next();
if (item.equals(itemA)) {
assertEquals(item, itemA);